Closed Bug 1017903 Opened 5 years ago Closed 5 years ago

Synchronous initialization of search service when handling open search tag

Categories

(Firefox for Android :: General, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 35
Tracking Status
fennec 34+ ---

People

(Reporter: Margaret, Assigned: Margaret)

References

Details

Attachments

(2 files)

I'm seeing this warning the first time I load a URL (testing in today's Nightly):

DEPRECATION WARNING: Search service falling back to synchronous initialization. This is generally the consequence of an add-on using a deprecated search service API.
You may find more details about this deprecation at: https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIBrowserSearchService#async_warning
jar:jar:file:///data/app/org.mozilla.fennec-1.apk!/assets/omni.ja!/components/nsSearchService.js 2802 SRCH_SVC__ensureInitialized
jar:jar:file:///data/app/org.mozilla.fennec-1.apk!/assets/omni.ja!/components/nsSearchService.js 3724 SRCH_SVC_getVisible
chrome://browser/content/browser.js 3734 Tab.prototype.handleEvent
null 0 null

I traced this back to this line:
http://hg.mozilla.org/mozilla-central/annotate/b85b57f05fda/mobile/android/chrome/content/browser.js#l3739

We should find a way to do this asynchronously, especially as this could affect load times when loading an external URL on startup.
My bad, that should be passed as a callback to Services.search.init. Will be an easy fix though.
Assignee: nobody → liuche
tracking-fennec: --- → ?
This makes me really want to fix bug 935259, but that's less important.
Assignee: liuche → margaret.leibovic
Attachment #8483842 - Flags: review?(liuche)
tracking-fennec: ? → 34+
Comment on attachment 8483842 [details] [diff] [review]
Remove synchronous search service initialization

Review of attachment 8483842 [details] [diff] [review]:
-----------------------------------------------------------------

Nice.
Attachment #8483842 - Flags: review?(liuche) → review+
This is happening because testBrowserDiscovery expects the open search link to be parsed synchronously. 

To work around this, I added a line to testBrowserDiscovery to synchronously load the search service before starting the test, and that fixed things for me locally. Here's a try push:
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=2b24c7483c39
Flags: needinfo?(margaret.leibovic)
This seems to solve the problem.

I made a few retriggers to make sure the green wasn't a fluke.
Attachment #8487302 - Flags: review?(mark.finkle)
Attachment #8487302 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/731c6ccfc19c
https://hg.mozilla.org/mozilla-central/rev/49ae569b8536
Status: NEW → RESOLVED
Closed: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 35
You need to log in before you can comment on or make changes to this bug.