Closed Bug 765211 Opened 9 years ago Closed 9 years ago

[New Tab Page] AllPages.unregister() can possibly remove wrong pages

Categories

(Firefox :: Tabbed Browser, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 16

People

(Reporter: ttaubert, Assigned: ttaubert)

References

Details

Attachments

(1 file)

Attached patch trivial patchSplinter Review
When given a page that isn't in the list of registered pages, NewTabUtils.allPages.unregister() will still remove a page because it doesn't check if indexOf() > -1.
Attachment #633489 - Flags: review?(mak77)
Comment on attachment 633489 [details] [diff] [review]
trivial patch

How'd you find this? Presumably in practice unregister never gets called for pages that haven't been registered?
Attachment #633489 - Flags: review?(mak77) → review+
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #1)
> How'd you find this? Presumably in practice unregister never gets called for
> pages that haven't been registered?

Right, while working on bug 753448 I noticed that the preloaded about:newtab instances were out of sync because they weren't tracked anymore. This happens because of how we use registerCleanupFunction() here to make sure the dummy page gets removed when timing out:

http://mxr.mozilla.org/mozilla-central/source/browser/base/content/test/newtab/head.js#312
https://hg.mozilla.org/integration/fx-team/rev/78bae12834f6
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 16
https://hg.mozilla.org/mozilla-central/rev/78bae12834f6
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
You need to log in before you can comment on or make changes to this bug.