v8binding: Fixes wrapper tracing to follow: LocalDOMWindow => Document.
The root cause of https://crbug.com/745771 is that a listener object, stored in V8AbstractEventListener::listener_, is wrongly collected by V8 GC. Listener objects are expected to be wrapper-traced at DEFINE_TRACE_WRAPPERS(EventTarget) through DEFINE_TRACE_WRAPPERS(Node) and DEFINE_TRACE_WRAPPERS(ContainerNode), however, there seems no root object which kicks this path of wrapper- tracing. This CL adds a new path of wrapper-tracing from LocalDOMWindow to Document. Since LocalDOMWindow is a root object and Document is a ContainerNode which wrapper-traces all child nodes, this CL makes sure that all event listeners registered at any part of the document tree alive. (If an EventTarget is not attached to the DOM, such a case is not covered by this CL.) The fix was confirmed manually with using a test Chrome extension. Bug: 745771 Change-Id: I7c0d1fb766b78fd4d32ce813662c947ce5f7e819 Reviewed-on: https://chromium-review.googlesource.com/591728Reviewed-by:Kentaro Hara <haraken@chromium.org> Reviewed-by:
Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Cr-Commit-Position: refs/heads/master@{#490742}
Showing
Please register or sign in to comment