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

Side by Side Diff: Source/core/html/MediaController.h

Issue 314113008: Oilpan: have MediaController weakly refer to its media elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use add() Created 6 years, 6 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
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/core/html/MediaController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 11 matching lines...) Expand all
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef MediaController_h 26 #ifndef MediaController_h
27 #define MediaController_h 27 #define MediaController_h
28 28
29 #include "bindings/v8/ScriptWrappable.h" 29 #include "bindings/v8/ScriptWrappable.h"
30 #include "core/events/EventTarget.h" 30 #include "core/events/EventTarget.h"
31 #include "core/html/HTMLMediaElement.h" 31 #include "core/html/HTMLMediaElement.h"
32 #include "wtf/LinkedHashSet.h"
32 #include "wtf/PassRefPtr.h" 33 #include "wtf/PassRefPtr.h"
33 #include "wtf/RefCounted.h" 34 #include "wtf/RefCounted.h"
34 #include "wtf/Vector.h"
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 class Clock; 38 class Clock;
39 class ExceptionState; 39 class ExceptionState;
40 class ExecutionContext; 40 class ExecutionContext;
41 class GenericEventQueue; 41 class GenericEventQueue;
42 42
43 class MediaController FINAL : public RefCountedWillBeRefCountedGarbageCollected< MediaController>, public ScriptWrappable, public EventTargetWithInlineData { 43 class MediaController FINAL : public RefCountedWillBeRefCountedGarbageCollected< MediaController>, public ScriptWrappable, public EventTargetWithInlineData {
44 REFCOUNTED_EVENT_TARGET(MediaController); 44 REFCOUNTED_EVENT_TARGET(MediaController);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 ReadyState readyState() const { return m_readyState; } 79 ReadyState readyState() const { return m_readyState; }
80 80
81 enum PlaybackState { WAITING, PLAYING, ENDED }; 81 enum PlaybackState { WAITING, PLAYING, ENDED };
82 const AtomicString& playbackState() const; 82 const AtomicString& playbackState() const;
83 83
84 bool isRestrained() const; 84 bool isRestrained() const;
85 bool isBlocked() const; 85 bool isBlocked() const;
86 86
87 void clearExecutionContext() { m_executionContext = 0; } 87 void clearExecutionContext() { m_executionContext = 0; }
88 88
89 virtual void trace(Visitor*) OVERRIDE;
90
89 private: 91 private:
90 MediaController(ExecutionContext*); 92 MediaController(ExecutionContext*);
91 void reportControllerState(); 93 void reportControllerState();
92 void updateReadyState(); 94 void updateReadyState();
93 void updatePlaybackState(); 95 void updatePlaybackState();
94 void updateMediaElements(); 96 void updateMediaElements();
95 void bringElementUpToSpeed(HTMLMediaElement*); 97 void bringElementUpToSpeed(HTMLMediaElement*);
96 void scheduleEvent(const AtomicString& eventName); 98 void scheduleEvent(const AtomicString& eventName);
97 void clearPositionTimerFired(Timer<MediaController>*); 99 void clearPositionTimerFired(Timer<MediaController>*);
98 bool hasEnded() const; 100 bool hasEnded() const;
99 void scheduleTimeupdateEvent(); 101 void scheduleTimeupdateEvent();
100 void timeupdateTimerFired(Timer<MediaController>*); 102 void timeupdateTimerFired(Timer<MediaController>*);
101 void startTimeupdateTimer(); 103 void startTimeupdateTimer();
102 104
103 // EventTarget 105 // EventTarget
104 virtual const AtomicString& interfaceName() const OVERRIDE; 106 virtual const AtomicString& interfaceName() const OVERRIDE;
105 virtual ExecutionContext* executionContext() const OVERRIDE { return m_execu tionContext; } 107 virtual ExecutionContext* executionContext() const OVERRIDE { return m_execu tionContext; }
106 108
107 friend class HTMLMediaElement; 109 friend class HTMLMediaElement;
108 friend class MediaControllerEventListener; 110 friend class MediaControllerEventListener;
109 Vector<HTMLMediaElement*> m_mediaElements; 111 typedef WillBeHeapLinkedHashSet<RawPtrWillBeWeakMember<HTMLMediaElement> > M ediaElementSequence;
acolwell GONE FROM CHROMIUM 2014/06/07 00:04:50 I'm a little fuzzy on these Oilpan types. If you u
haraken 2014/06/07 03:59:00 Your understanding is correct. If you want to kee
sof 2014/06/07 05:33:30 Comments #5 and #6 touch on what the spec promises
112 MediaElementSequence m_mediaElements;
110 bool m_paused; 113 bool m_paused;
111 double m_defaultPlaybackRate; 114 double m_defaultPlaybackRate;
112 double m_volume; 115 double m_volume;
113 mutable double m_position; 116 mutable double m_position;
114 bool m_muted; 117 bool m_muted;
115 ReadyState m_readyState; 118 ReadyState m_readyState;
116 PlaybackState m_playbackState; 119 PlaybackState m_playbackState;
117 OwnPtr<GenericEventQueue> m_pendingEventsQueue; 120 OwnPtr<GenericEventQueue> m_pendingEventsQueue;
118 mutable Timer<MediaController> m_clearPositionTimer; 121 mutable Timer<MediaController> m_clearPositionTimer;
119 OwnPtr<Clock> m_clock; 122 OwnPtr<Clock> m_clock;
120 ExecutionContext* m_executionContext; 123 ExecutionContext* m_executionContext;
121 Timer<MediaController> m_timeupdateTimer; 124 Timer<MediaController> m_timeupdateTimer;
122 double m_previousTimeupdateTime; 125 double m_previousTimeupdateTime;
123 }; 126 };
124 127
125 } // namespace WebCore 128 } // namespace WebCore
126 129
127 #endif 130 #endif
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/core/html/MediaController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698