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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp

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/MediaControlsOrientationLockDelegate.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp
index 624bb9d699665c15f24c9a04de2425fe35b4b8a1..187db61dd904b784347e8b686212c1cc918411c2 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp
@@ -75,6 +75,10 @@ bool MediaControlsOrientationLockDelegate::operator==(
return this == &other;
}
+void MediaControlsOrientationLockDelegate::detach() {
+ document().removeEventListener(EventTypeNames::fullscreenchange, this, true);
Zhiqiang Zhang (Slow) 2017/03/01 16:22:36 Should we also remove the listeners from the video
mlamouri (slow - plz ping) 2017/03/01 20:22:33 Good point :) Though, the approach the first itera
+}
+
void MediaControlsOrientationLockDelegate::maybeLockOrientation() {
DCHECK(m_state != State::MaybeLockedFullscreen);

Powered by Google App Engine
This is Rietveld 408576698