Closed Bug 961793 Opened 10 years ago Closed 10 years ago

BrowserElementChildPreload/BrowserElementPanning need to unregister observers

Categories

(Core :: DOM: Core & HTML, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla29
blocking-b2g 1.3+
Tracking Status
firefox27 --- wontfix
firefox28 --- fixed
firefox29 --- fixed
b2g-v1.3 --- fixed
b2g-v1.3T --- fixed
b2g-v1.4 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

References

(Blocks 1 open bug)

Details

(Keywords: memory-leak, perf, Whiteboard: [caf priority: p3][c=memory p= s=2014.01.31 u=1.3][qa-][cr 606932])

Attachments

(2 files)

The observers added here:

http://mxr.mozilla.org/mozilla-central/source/dom/browser-element/BrowserElementChildPreload.js#256
http://mxr.mozilla.org/mozilla-central/source/dom/browser-element/BrowserElementPanning.js#61

never get removed and build up over the course of mochitest runs.

Please note that the correct solution here is not to make the BrowserElementPanning observers weak observers; we should instead make the BrowserElementChildPreload observers strong observers and then properly manage the lifetime of all the observers.
Turns out we can just remove the observers at unload.

I'm less sure of how to address BrowserElementPanning's observers, as
BrowserElementChildPreload can't (I don't think) see the ContentPanning
variable defined therein.  Registering an unload handler for ContentPanning
would work, I suppose.  Do you have any preferred course of action here?
Attachment #8362677 - Flags: review?(fabrice)
Comment on attachment 8362677 [details] [diff] [review]
don't register weak observers in BrowserElementChildPreload.js

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

I'm fine with trying to use an unload handler for BEPanning too.

::: dom/browser-element/BrowserElementChildPreload.js
@@ +100,5 @@
>  
>    return null;
>  }
>  
> +const OBSERVED_EVENTS = [

I would prefer kObservedEvents, but no big deal if you want to stick with UPPER_CASE
Attachment #8362677 - Flags: review?(fabrice) → review+
(In reply to Fabrice Desré [:fabrice] from comment #2)
> I'm fine with trying to use an unload handler for BEPanning too.

OK, great, I'll just add that in a separate patch.

> ::: dom/browser-element/BrowserElementChildPreload.js
> > +const OBSERVED_EVENTS = [
> 
> I would prefer kObservedEvents, but no big deal if you want to stick with
> UPPER_CASE

I went with UPPER_CASE because that seemed to be the prevailing style in that file.
https://hg.mozilla.org/integration/mozilla-inbound/rev/70967d2e42ba
Flags: in-testsuite-
Whiteboard: [leave open]
...and here's the equivalent patch for BrowserElementPanning.js.
Attachment #8363968 - Flags: review?(fabrice)
Attachment #8363968 - Flags: review?(fabrice) → review+
https://hg.mozilla.org/mozilla-central/rev/b10b085ab73c
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Blocks: 964386
Blocks a blocker. Let's uplift this to 1.3.
blocking-b2g: --- → 1.3+
No longer blocks: 964386
Keywords: mlk, perf
Priority: -- → P1
Whiteboard: [c=memory p= s= u=1.3]
Whiteboard: [c=memory p= s= u=1.3] → [c=memory p= s=2014.01.31 u=1.3]
Whiteboard: [c=memory p= s=2014.01.31 u=1.3] → [c=memory p= s=2014.01.31 u=1.3][qa-]
Whiteboard: [c=memory p= s=2014.01.31 u=1.3][qa-] → [c=memory p= s=2014.01.31 u=1.3][qa-][cr 606932]
Whiteboard: [c=memory p= s=2014.01.31 u=1.3][qa-][cr 606932] → [caf priority: p3][c=memory p= s=2014.01.31 u=1.3][qa-][cr 606932]
Assignee: nobody → nfroyd
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: