Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.h

Issue 2736853003: Media: fix memory leak because of the document holding on an EventListener. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.h
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.h b/third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.h
index cd88cb44e0ed098afd5ae863da541460cb305169..a653202928a911fbff9c5a360805abacc5d87727 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.h
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.h
@@ -16,6 +16,15 @@ class MediaControlsMediaEventListener final : public EventListener {
public:
explicit MediaControlsMediaEventListener(MediaControls*);
+ // Called by MediaControls when the HTMLMediaElement is added to a document
+ // document. All event listeners should be added.
+ void attach();
+
+ // Called by MediaControls when the HTMLMediaElement is no longer in the
+ // document. All event listeners should be removed in order to prepare the
+ // object to be garbage collected.
+ void detach();
+
bool operator==(const EventListener&) const override;
DECLARE_VIRTUAL_TRACE();

Powered by Google App Engine
This is Rietveld 408576698