Closed
Bug 860176
Opened 13 years ago
Closed 13 years ago
Frameworker's document-element-inserted not removed if worker is closed quickly
Categories
(Firefox Graveyard :: SocialAPI, defect)
Firefox Graveyard
SocialAPI
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 23
People
(Reporter: markh, Assigned: markh)
Details
(Whiteboard: [qa-])
Attachments
(1 file)
|
2.96 KB,
patch
|
jaws
:
review+
|
Details | Diff | Splinter Review |
Stumbled across this. Add the following patch to Frameworker:
Services.obs.addObserver(function injectController(doc, topic, data) {
+ dump("injectController fired for " + self.name + " - " + doc.location.href + "\n");
if (!doc.defaultView || doc.defaultView != self.frame.contentWindow) {
return;
}
+ dump("injectController is ours\n");
Services.obs.removeObserver(injectController, "document-element-inserted");
try {
self.createSandbox();
} catch (e) {
Cu.reportError("FrameWorker: failed to create sandbox for " + url + ". " + e);
}
}, "document-element-inserted", false);
+ dump("added injectController for " + this.name + " - " + this.url + "\n");
and run the frameworker tests. By the end of the tests you see:
added injectController for SocialProvider:http://example.com - http://example.com/browser/toolkit/components/social/test/browser/worker_social.js
injectController fired for SocialProvider:http://example.com - http://example.com/browser/toolkit/components/social/test/browser/worker_social.js
injectController is ours
injectController fired for testEarlyClose - http://example.com/browser/toolkit/components/social/test/browser/worker_social.js
injectController fired for SocialProvider:http://example.com - http://example.com/browser/toolkit/components/social/test/browser/worker_social.js
injectController fired for SocialProvider:http://example.com - http://example.com/browser/toolkit/components/social/test/browser/worker_social.js
Meaning there are a number of observers which were added but are never removed. I'm guessing this is a result of us closing the worker in some cases before it has fully initialized.
| Assignee | ||
Updated•13 years ago
|
Assignee: nobody → mhammond
OS: Windows 7 → All
Hardware: x86_64 → All
| Assignee | ||
Comment 1•13 years ago
|
||
This patch tracks if the observer has fired and removed itself, and if not, removes it in the terminate() method.
Attachment #737352 -
Flags: review?(jaws)
Comment 2•13 years ago
|
||
Comment on attachment 737352 [details] [diff] [review]
Check if we need to remove observer in terminate() method
Review of attachment 737352 [details] [diff] [review]:
-----------------------------------------------------------------
Nice fix!
Attachment #737352 -
Flags: review?(jaws) → review+
Updated•13 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•13 years ago
|
||
Comment 4•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
Updated•7 years ago
|
Product: Firefox → Firefox Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•