Bug 56607 - RequestAnimationFrame callbacks prevent Document from being released on detach
Summary: RequestAnimationFrame callbacks prevent Document from being released on detach
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Zhenyao Mo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-17 16:01 PDT by Zhenyao Mo
Modified: 2011-03-17 17:02 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.52 KB, patch)
2011-03-17 16:04 PDT, Zhenyao Mo
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zhenyao Mo 2011-03-17 16:01:13 PDT
This is also reported in crbug: http://code.google.com/p/chromium/issues/detail?id=74636

After a discussion with Adam, it seems like using ActiveDOMObject for RequestAnimationFrameCallback is the proper way, however, delete callbacks on Document::detach also fixes this memory holding.

Let's get the quick/simple fix in now and merge back to chrome M10 and M11, then we can do the proper ActiveDOMObject thing on the top of the tree.
Comment 1 Zhenyao Mo 2011-03-17 16:04:48 PDT
Created attachment 86107 [details]
Patch
Comment 2 Adam Barth 2011-03-17 16:14:15 PDT
Comment on attachment 86107 [details]
Patch

Can you add a FIXME comment to both these locations saying that we should consider using ActiveDOMObject in the future?
Comment 3 Zhenyao Mo 2011-03-17 16:15:24 PDT
Will do upon landing.
Comment 4 Zhenyao Mo 2011-03-17 16:26:52 PDT
Committed r81407: <http://trac.webkit.org/changeset/81407>
Comment 5 James Robinson 2011-03-17 16:39:01 PDT
As a nit, I personally like .clear() instead of = 0 to null out an OwnPtr<>'s reference.

As for ActiveDOMObject you are all welcome to debate ap@ on that point but I'm not inclined to jump on that grenade again.
Comment 6 Zhenyao Mo 2011-03-17 17:02:33 PDT
(In reply to comment #5)
> As a nit, I personally like .clear() instead of = 0 to null out an OwnPtr<>'s reference.
> 
> As for ActiveDOMObject you are all welcome to debate ap@ on that point but I'm not inclined to jump on that grenade again.

Feel free to change it, and thanks for the warning of the grenade.  :)