OLD | NEW |
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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
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 "core/dom/ActiveDOMObject.h" | 35 #include "core/dom/ActiveDOMObject.h" |
35 #include "core/events/EventTarget.h" | 36 #include "core/events/EventTarget.h" |
36 #include "core/html/HTMLMediaSource.h" | 37 #include "core/html/HTMLMediaSource.h" |
37 #include "core/html/URLRegistry.h" | 38 #include "core/html/URLRegistry.h" |
38 #include "modules/mediasource/SourceBuffer.h" | 39 #include "modules/mediasource/SourceBuffer.h" |
39 #include "modules/mediasource/SourceBufferList.h" | 40 #include "modules/mediasource/SourceBufferList.h" |
40 #include "public/platform/WebMediaSource.h" | 41 #include "public/platform/WebMediaSource.h" |
41 #include "wtf/PassOwnPtr.h" | 42 #include "wtf/PassOwnPtr.h" |
42 #include "wtf/Vector.h" | 43 #include "wtf/Vector.h" |
43 | 44 |
44 namespace blink { | 45 namespace blink { |
45 | 46 |
46 class ExceptionState; | 47 class ExceptionState; |
47 class GenericEventQueue; | 48 class GenericEventQueue; |
48 class WebSourceBuffer; | 49 class WebSourceBuffer; |
49 | 50 |
50 class MediaSource final | 51 class MediaSource final |
51 : public RefCountedGarbageCollectedEventTargetWithInlineData<MediaSource> | 52 : public RefCountedGarbageCollectedEventTargetWithInlineData<MediaSource> |
52 , public HTMLMediaSource | 53 , public HTMLMediaSource |
| 54 , public ActiveScriptWrappable |
53 , public ActiveDOMObject { | 55 , public ActiveDOMObject { |
54 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaSource); | 56 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaSource); |
55 DEFINE_WRAPPERTYPEINFO(); | 57 DEFINE_WRAPPERTYPEINFO(); |
56 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaSource); | 58 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaSource); |
57 public: | 59 public: |
58 static const AtomicString& openKeyword(); | 60 static const AtomicString& openKeyword(); |
59 static const AtomicString& closedKeyword(); | 61 static const AtomicString& closedKeyword(); |
60 static const AtomicString& endedKeyword(); | 62 static const AtomicString& endedKeyword(); |
61 | 63 |
62 static MediaSource* create(ExecutionContext*); | 64 static MediaSource* create(ExecutionContext*); |
(...skipping 22 matching lines...) Expand all Loading... |
85 TimeRanges* seekable() const override; | 87 TimeRanges* seekable() const override; |
86 #if !ENABLE(OILPAN) | 88 #if !ENABLE(OILPAN) |
87 void refHTMLMediaSource() override { ref(); } | 89 void refHTMLMediaSource() override { ref(); } |
88 void derefHTMLMediaSource() override { deref(); } | 90 void derefHTMLMediaSource() override { deref(); } |
89 #endif | 91 #endif |
90 | 92 |
91 // EventTarget interface | 93 // EventTarget interface |
92 const AtomicString& interfaceName() const override; | 94 const AtomicString& interfaceName() const override; |
93 ExecutionContext* getExecutionContext() const override; | 95 ExecutionContext* getExecutionContext() const override; |
94 | 96 |
| 97 // ActiveScriptWrappable |
| 98 bool hasPendingActivity() const final; |
| 99 |
95 // ActiveDOMObject interface | 100 // ActiveDOMObject interface |
96 bool hasPendingActivity() const override; | |
97 void stop() override; | 101 void stop() override; |
98 | 102 |
99 // URLRegistrable interface | 103 // URLRegistrable interface |
100 URLRegistry& registry() const override; | 104 URLRegistry& registry() const override; |
101 | 105 |
102 // Used by SourceBuffer. | 106 // Used by SourceBuffer. |
103 void openIfInEndedState(); | 107 void openIfInEndedState(); |
104 bool isOpen() const; | 108 bool isOpen() const; |
105 void setSourceBufferActive(SourceBuffer*); | 109 void setSourceBufferActive(SourceBuffer*); |
106 HTMLMediaElement* mediaElement() const; | 110 HTMLMediaElement* mediaElement() const; |
(...skipping 27 matching lines...) Expand all Loading... |
134 | 138 |
135 Member<SourceBufferList> m_sourceBuffers; | 139 Member<SourceBufferList> m_sourceBuffers; |
136 Member<SourceBufferList> m_activeSourceBuffers; | 140 Member<SourceBufferList> m_activeSourceBuffers; |
137 | 141 |
138 bool m_isAddedToRegistry; | 142 bool m_isAddedToRegistry; |
139 }; | 143 }; |
140 | 144 |
141 } // namespace blink | 145 } // namespace blink |
142 | 146 |
143 #endif // MediaSource_h | 147 #endif // MediaSource_h |
OLD | NEW |