Closed Bug 828347 Opened 9 years ago Closed 9 years ago

Warn if session restore is initialized with deprecated synchronous initialization

Categories

(Firefox :: Session Restore, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 21

People

(Reporter: Yoric, Assigned: darkowlzz)

References

Details

(Whiteboard: [mentor=Yoric][lang=js])

Attachments

(1 file, 1 obsolete file)

Since bug 532150, session storage have a snappy asynchronous initialization and a blocking synchronous initialization, for backwards compatibility with add-ons.

Bug 812859 introduces a mechanism for marking an API as deprecated. We should make use of this mechanism to warn in case of synchronous initializations.
Whiteboard: [mentor=Yoric][lang=js]
Hi,
I would like to work on this bug.
I need help and guidance to fix the bug.

Thanks
Great :)

The objective is to add a deprecation warning to method syncInit of nsSearchService: http://dxr.mozilla.org/mozilla-central/toolkit/components/search/nsSearchService.js.html#l3782

Deprecation warnings are implemented with module Deprecated.jsm, as per http://dxr.mozilla.org/mozilla-central/toolkit/content/Deprecated.jsm.html?string=Deprecated.jsm#l60
Assignee: nobody → indiasuny000
Check if this is correct and can you suggest some warning text and required URL.
Attachment #706461 - Flags: feedback?(dteller)
Comment on attachment 706461 [details] [diff] [review]
Added deprecation warning to syncInit

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

Looks good, thanks.

::: toolkit/components/search/nsSearchService.js
@@ +3780,5 @@
>     * if it detects that the synchronous initializer has completed
>     * initialization.
>     */
>    syncInit: function epsSyncInit() {
> +    Deprecated.warning("Oops. This is deprecated. :(", "https://bugzilla.mozilla.org/show_bug.cgi?id=828347");

I'd go for:
-"Search service falling back to deprecated synchronous initializer."
- "https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIBrowserSearchService#async_warning"
Attachment #706461 - Flags: feedback?(dteller) → feedback+
Changed the response string and info link.
Attachment #706461 - Attachment is obsolete: true
Attachment #707598 - Flags: review?(dteller)
Comment on attachment 707598 [details] [diff] [review]
Mechanism for warning session restore initialized with deprecated synchronous initialization added

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

Looks good to me.
Attachment #707598 - Flags: review?(dteller) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/009b00bcce30
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
You need to log in before you can comment on or make changes to this bug.