Closed
Bug 692119
Opened 13 years ago
Closed 13 years ago
Don't init the autocomplete database connection till the first search
Categories
(Toolkit :: Places, defect)
Toolkit
Places
Tracking
()
RESOLVED
FIXED
mozilla10
People
(Reporter: mak, Assigned: mak)
References
Details
(Whiteboard: [Ts])
Attachments
(1 file)
(deleted),
patch
|
dietrich
:
review+
|
Details | Diff | Splinter Review |
RegisterOpenPage runs really early in the browser startup, but we don't need the data till the first search. So we may temporarily cache it till the first autocomplete search.
Assignee | ||
Comment 1•13 years ago
|
||
This was an easy win.
I use a local array while the connection does not exist, when it is inited for the first search I populate the temp table with the cache contents, and from that point on requests directly go the database.
Attachment #564949 -
Flags: review?(dietrich)
Comment 2•13 years ago
|
||
Comment on attachment 564949 [details] [diff] [review]
patch v1.0
Review of attachment 564949 [details] [diff] [review]:
-----------------------------------------------------------------
r=me comments addressed.
::: toolkit/components/places/nsPlacesAutoComplete.js
@@ +527,3 @@
> registerOpenPage: function PAC_registerOpenPage(aURI)
> {
> + if (Object.getOwnPropertyDescriptor(this, "_db").value === undefined) {
would prefer using an explicit flag or isInited helper here.
Comment 3•13 years ago
|
||
Comment on attachment 564949 [details] [diff] [review]
patch v1.0
Review of attachment 564949 [details] [diff] [review]:
-----------------------------------------------------------------
r=me comments addressed.
::: toolkit/components/places/nsPlacesAutoComplete.js
@@ +527,3 @@
> registerOpenPage: function PAC_registerOpenPage(aURI)
> {
> + if (Object.getOwnPropertyDescriptor(this, "_db").value === undefined) {
would prefer using an explicit flag or isInited helper here.
Attachment #564949 -
Flags: review?(dietrich) → review+
Assignee | ||
Comment 4•13 years ago
|
||
(In reply to Dietrich Ayala (:dietrich) from comment #3)
> > + if (Object.getOwnPropertyDescriptor(this, "_db").value === undefined) {
>
> would prefer using an explicit flag or isInited helper here.
I uses that since it's consistent with the other checks in the same file. I'll add a private _databaseInitialized getter and replaces all uses.
Assignee | ||
Comment 5•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
You need to log in
before you can comment on or make changes to this bug.
Description
•