Synchronous initialization of search service when handling open search tag

RESOLVED FIXED in Firefox 35

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: Margaret, Assigned: Margaret)

Tracking

Trunk
Firefox 35
All
Android
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(fennec34+)

Details

Attachments

(2 attachments)

(Assignee)

Description

4 years ago
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
(Assignee)

Updated

4 years ago
tracking-fennec: --- → ?
(Assignee)

Comment 2

4 years ago
Created attachment 8483842 [details] [diff] [review]
Remove synchronous search service initialization

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+
Backed this out for a robocop test failure: https://hg.mozilla.org/integration/fx-team/rev/ad3f52e2f336

https://tbpl.mozilla.org/php/getParsedLog.php?id=47516182&tree=Fx-Team
Flags: needinfo?(margaret.leibovic)
(Assignee)

Comment 6

4 years ago
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)
(Assignee)

Comment 7

4 years ago
Created attachment 8487302 [details] [diff] [review]
Load the search service before running open search discovery tests

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
Last Resolved: 4 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.