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

Side by Side Diff: third_party/WebKit/Source/modules/mediasource/MediaSource.h

Issue 1945523003: MSE: Add EventHandler attributes to MSE objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef MediaSource_h 31 #ifndef MediaSource_h
32 #define MediaSource_h 32 #define MediaSource_h
33 33
34 #include "bindings/core/v8/ActiveScriptWrappable.h" 34 #include "bindings/core/v8/ActiveScriptWrappable.h"
35 #include "core/dom/ActiveDOMObject.h" 35 #include "core/dom/ActiveDOMObject.h"
36 #include "core/events/EventTarget.h"
37 #include "core/html/HTMLMediaSource.h" 36 #include "core/html/HTMLMediaSource.h"
38 #include "core/html/TimeRanges.h" 37 #include "core/html/TimeRanges.h"
39 #include "core/html/URLRegistry.h" 38 #include "core/html/URLRegistry.h"
39 #include "modules/EventTargetModules.h"
40 #include "modules/mediasource/SourceBuffer.h" 40 #include "modules/mediasource/SourceBuffer.h"
41 #include "modules/mediasource/SourceBufferList.h" 41 #include "modules/mediasource/SourceBufferList.h"
42 #include "public/platform/WebMediaSource.h" 42 #include "public/platform/WebMediaSource.h"
43 #include "wtf/Vector.h" 43 #include "wtf/Vector.h"
44 #include <memory> 44 #include <memory>
45 45
46 namespace blink { 46 namespace blink {
47 47
48 class ExceptionState; 48 class ExceptionState;
49 class GenericEventQueue; 49 class GenericEventQueue;
(...skipping 15 matching lines...) Expand all
65 ~MediaSource() override; 65 ~MediaSource() override;
66 66
67 static void logAndThrowDOMException(ExceptionState&, const ExceptionCode& er ror, const String& message); 67 static void logAndThrowDOMException(ExceptionState&, const ExceptionCode& er ror, const String& message);
68 68
69 // MediaSource.idl methods 69 // MediaSource.idl methods
70 SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); } 70 SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); }
71 SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get() ; } 71 SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get() ; }
72 SourceBuffer* addSourceBuffer(const String& type, ExceptionState&); 72 SourceBuffer* addSourceBuffer(const String& type, ExceptionState&);
73 void removeSourceBuffer(SourceBuffer*, ExceptionState&); 73 void removeSourceBuffer(SourceBuffer*, ExceptionState&);
74 void setDuration(double, ExceptionState&); 74 void setDuration(double, ExceptionState&);
75
76 DEFINE_ATTRIBUTE_EVENT_LISTENER(sourceopen);
77 DEFINE_ATTRIBUTE_EVENT_LISTENER(sourceended);
78 DEFINE_ATTRIBUTE_EVENT_LISTENER(sourceclose);
79
75 const AtomicString& readyState() const { return m_readyState; } 80 const AtomicString& readyState() const { return m_readyState; }
76 void endOfStream(const AtomicString& error, ExceptionState&); 81 void endOfStream(const AtomicString& error, ExceptionState&);
77 void endOfStream(ExceptionState&); 82 void endOfStream(ExceptionState&);
78 void setLiveSeekableRange(double start, double end, ExceptionState&); 83 void setLiveSeekableRange(double start, double end, ExceptionState&);
79 void clearLiveSeekableRange(ExceptionState&); 84 void clearLiveSeekableRange(ExceptionState&);
80 85
81 static bool isTypeSupported(const String& type); 86 static bool isTypeSupported(const String& type);
82 87
83 // HTMLMediaSource 88 // HTMLMediaSource
84 bool attachToElement(HTMLMediaElement*) override; 89 bool attachToElement(HTMLMediaElement*) override;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 Member<SourceBufferList> m_activeSourceBuffers; 144 Member<SourceBufferList> m_activeSourceBuffers;
140 145
141 Member<TimeRanges> m_liveSeekableRange; 146 Member<TimeRanges> m_liveSeekableRange;
142 147
143 bool m_isAddedToRegistry; 148 bool m_isAddedToRegistry;
144 }; 149 };
145 150
146 } // namespace blink 151 } // namespace blink
147 152
148 #endif // MediaSource_h 153 #endif // MediaSource_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698