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

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

Issue 26878003: Reduce repetitive EventTarget subclassing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/fileapi/FileReader.h ('k') | Source/core/html/track/TextTrackCue.h » ('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 25 matching lines...) Expand all
36 #include "wtf/Vector.h" 36 #include "wtf/Vector.h"
37 37
38 namespace WebCore { 38 namespace WebCore {
39 39
40 class Clock; 40 class Clock;
41 class Event; 41 class Event;
42 class ExceptionState; 42 class ExceptionState;
43 class HTMLMediaElement; 43 class HTMLMediaElement;
44 class ScriptExecutionContext; 44 class ScriptExecutionContext;
45 45
46 class MediaController : public RefCounted<MediaController>, public ScriptWrappab le, public MediaControllerInterface, public EventTarget { 46 class MediaController : public RefCounted<MediaController>, public ScriptWrappab le, public MediaControllerInterface, public EventTargetWithInlineData {
47 public: 47 public:
48 static PassRefPtr<MediaController> create(ScriptExecutionContext*); 48 static PassRefPtr<MediaController> create(ScriptExecutionContext*);
49 virtual ~MediaController(); 49 virtual ~MediaController();
50 50
51 void addMediaElement(HTMLMediaElement*); 51 void addMediaElement(HTMLMediaElement*);
52 void removeMediaElement(HTMLMediaElement*); 52 void removeMediaElement(HTMLMediaElement*);
53 bool containsMediaElement(HTMLMediaElement*) const; 53 bool containsMediaElement(HTMLMediaElement*) const;
54 54
55 const String& mediaGroup() const { return m_mediaGroup; } 55 const String& mediaGroup() const { return m_mediaGroup; }
56 56
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 void bringElementUpToSpeed(HTMLMediaElement*); 118 void bringElementUpToSpeed(HTMLMediaElement*);
119 void scheduleEvent(const AtomicString& eventName); 119 void scheduleEvent(const AtomicString& eventName);
120 void asyncEventTimerFired(Timer<MediaController>*); 120 void asyncEventTimerFired(Timer<MediaController>*);
121 void clearPositionTimerFired(Timer<MediaController>*); 121 void clearPositionTimerFired(Timer<MediaController>*);
122 bool hasEnded() const; 122 bool hasEnded() const;
123 void scheduleTimeupdateEvent(); 123 void scheduleTimeupdateEvent();
124 void timeupdateTimerFired(Timer<MediaController>*); 124 void timeupdateTimerFired(Timer<MediaController>*);
125 void startTimeupdateTimer(); 125 void startTimeupdateTimer();
126 126
127 // EventTarget 127 // EventTarget
128 virtual void refEventTarget() { ref(); } 128 virtual void refEventTarget() OVERRIDE { ref(); }
129 virtual void derefEventTarget() { deref(); } 129 virtual void derefEventTarget() OVERRIDE { deref(); }
130 virtual const AtomicString& interfaceName() const; 130 virtual const AtomicString& interfaceName() const OVERRIDE;
131 virtual ScriptExecutionContext* scriptExecutionContext() const { return m_sc riptExecutionContext; }; 131 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE { re turn m_scriptExecutionContext; }
132 virtual EventTargetData* eventTargetData() { return &m_eventTargetData; }
133 virtual EventTargetData* ensureEventTargetData() { return &m_eventTargetData ; }
134 EventTargetData m_eventTargetData;
135 132
136 friend class HTMLMediaElement; 133 friend class HTMLMediaElement;
137 friend class MediaControllerEventListener; 134 friend class MediaControllerEventListener;
138 Vector<HTMLMediaElement*> m_mediaElements; 135 Vector<HTMLMediaElement*> m_mediaElements;
139 bool m_paused; 136 bool m_paused;
140 double m_defaultPlaybackRate; 137 double m_defaultPlaybackRate;
141 double m_volume; 138 double m_volume;
142 mutable double m_position; 139 mutable double m_position;
143 bool m_muted; 140 bool m_muted;
144 ReadyState m_readyState; 141 ReadyState m_readyState;
145 PlaybackState m_playbackState; 142 PlaybackState m_playbackState;
146 Vector<RefPtr<Event> > m_pendingEvents; 143 Vector<RefPtr<Event> > m_pendingEvents;
147 Timer<MediaController> m_asyncEventTimer; 144 Timer<MediaController> m_asyncEventTimer;
148 mutable Timer<MediaController> m_clearPositionTimer; 145 mutable Timer<MediaController> m_clearPositionTimer;
149 String m_mediaGroup; 146 String m_mediaGroup;
150 bool m_closedCaptionsVisible; 147 bool m_closedCaptionsVisible;
151 OwnPtr<Clock> m_clock; 148 OwnPtr<Clock> m_clock;
152 ScriptExecutionContext* m_scriptExecutionContext; 149 ScriptExecutionContext* m_scriptExecutionContext;
153 Timer<MediaController> m_timeupdateTimer; 150 Timer<MediaController> m_timeupdateTimer;
154 double m_previousTimeupdateTime; 151 double m_previousTimeupdateTime;
155 }; 152 };
156 153
157 } // namespace WebCore 154 } // namespace WebCore
158 155
159 #endif 156 #endif
OLDNEW
« no previous file with comments | « Source/core/fileapi/FileReader.h ('k') | Source/core/html/track/TextTrackCue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698