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

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

Issue 2725873002: Media: fix memory leak because of the document holding on an EventListener. (Closed)
Patch Set: Created 3 years, 10 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/MediaControls.h
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControls.h b/third_party/WebKit/Source/core/html/shadow/MediaControls.h
index 74805310d50a486754080001c24d9494b9eecfb0..356742286a098a9f140a52e5bc02944f05f72396 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.h
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.h
@@ -41,11 +41,17 @@ class ShadowRoot;
class CORE_EXPORT MediaControls final : public HTMLDivElement {
public:
static MediaControls* create(HTMLMediaElement&, ShadowRoot&);
+ ~MediaControls() override;
HTMLMediaElement& mediaElement() const { return *m_mediaElement; }
void reset();
+ // Called when the HTMLMediaElement is no longer in the document to the
+ // MediaControls instance can be ready to be garbage collected by removing
+ // event listeners.
+ void detach();
+
void show();
void hide();
bool isVisible() const;

Powered by Google App Engine
This is Rietveld 408576698