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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 23 matching lines...) Expand all
34 34
35 class Event; 35 class Event;
36 class MediaControlsMediaEventListener; 36 class MediaControlsMediaEventListener;
37 class MediaControlsOrientationLockDelegate; 37 class MediaControlsOrientationLockDelegate;
38 class MediaControlsWindowEventListener; 38 class MediaControlsWindowEventListener;
39 class ShadowRoot; 39 class ShadowRoot;
40 40
41 class CORE_EXPORT MediaControls final : public HTMLDivElement { 41 class CORE_EXPORT MediaControls final : public HTMLDivElement {
42 public: 42 public:
43 static MediaControls* create(HTMLMediaElement&, ShadowRoot&); 43 static MediaControls* create(HTMLMediaElement&, ShadowRoot&);
44 ~MediaControls() override;
44 45
45 HTMLMediaElement& mediaElement() const { return *m_mediaElement; } 46 HTMLMediaElement& mediaElement() const { return *m_mediaElement; }
46 47
47 void reset(); 48 void reset();
48 49
50 // Called when the HTMLMediaElement is no longer in the document to the
51 // MediaControls instance can be ready to be garbage collected by removing
52 // event listeners.
53 void detach();
54
49 void show(); 55 void show();
50 void hide(); 56 void hide();
51 bool isVisible() const; 57 bool isVisible() const;
52 58
53 void beginScrubbing(); 59 void beginScrubbing();
54 void endScrubbing(); 60 void endScrubbing();
55 61
56 void updateCurrentTimeDisplay(); 62 void updateCurrentTimeDisplay();
57 63
58 void toggleTextTrackList(); 64 void toggleTextTrackList();
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 int m_panelWidth; 227 int m_panelWidth;
222 228
223 bool m_keepShowingUntilTimerFires : 1; 229 bool m_keepShowingUntilTimerFires : 1;
224 }; 230 };
225 231
226 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); 232 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls());
227 233
228 } // namespace blink 234 } // namespace blink
229 235
230 #endif 236 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698