Closed
Bug 1009313
Opened 11 years ago
Closed 11 years ago
ContentSearch.jsm should call nsIBrowserSearchService.init
Categories
(Firefox :: Search, defect)
Firefox
Search
Tracking
()
VERIFIED
FIXED
Firefox 32
People
(Reporter: adw, Assigned: adw)
References
Details
(Whiteboard: p=5 s=it-32c-31a-30b.2 [qa-])
Attachments
(1 file)
3.50 KB,
patch
|
Felipe
:
review+
|
Details | Diff | Splinter Review |
I forgot to have ContentSearch.jsm call nsIBrowserSearchService.init, so if the service isn't initialized before ContentSearch uses it, you get:
> DEPRECATION WARNING: Search service falling back to synchronous
> initialization. This is generally the consequence of an add-on
> using a deprecated search service API.
Updated•11 years ago
|
Whiteboard: p=0 s=it-32c-31a-30b.2 [qa?]
Updated•11 years ago
|
Flags: firefox-backlog+
Assignee | ||
Updated•11 years ago
|
Whiteboard: p=0 s=it-32c-31a-30b.2 [qa?] → p=5 s=it-32c-31a-30b.2 [qa?]
Updated•11 years ago
|
Whiteboard: p=5 s=it-32c-31a-30b.2 [qa?] → p=5 s=it-32c-31a-30b.2 [qa-]
Assignee | ||
Comment 1•11 years ago
|
||
This adds new _initService calls in the module's two entry points, receiveMessage and observe. That way everything after the entry points can assume the service has been initialized.
Attachment #8425069 -
Flags: review?(felipc)
Updated•11 years ago
|
Attachment #8425069 -
Flags: review?(felipc) → review+
Assignee | ||
Comment 2•11 years ago
|
||
Comment 3•11 years ago
|
||
Comment on attachment 8425069 [details] [diff] [review]
patch
Some drive-by comments, feel free to ignore...
>diff --git a/browser/modules/ContentSearch.jsm b/browser/modules/ContentSearch.jsm
>-Cu.import("resource://gre/modules/Services.jsm");
>+XPCOMUtils.defineLazyModuleGetter(this, "Services",
>+ "resource://gre/modules/Services.jsm");
>+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Not a big deal, but this is a bit strange - why lazy import Services.jsm, but not XPCOMUtils? Generally both XPCOMUtils and Services are treated as "guaranteed to already be imported" and thus not lazy loaded.
> observe: function (subj, topic, data) {
>+ this._initService().then(() => {
>+ switch (topic) {
>+ case "browser-search-engine-modified":
I don't think it's possible for this topic to be fired unless the search service is initialized, so the _initService call here should be redundant? It looks like waiting an extra spin of the event loop shouldn't really matter though.
>+ _initService: function () {
>+ Services.search.init(() => deferred.resolve());
Not sure you considered this, but search service initialization can fail - might be better to Cu.report it here rather than just waiting for subsequent use to fail?
Comment 4•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 32
Updated•11 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•