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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 #include "bindings/v8/ScriptWrappable.h" | 34 #include "bindings/v8/ScriptWrappable.h" |
35 #include "core/dom/ActiveDOMObject.h" | 35 #include "core/dom/ActiveDOMObject.h" |
36 #include "core/events/EventTarget.h" | 36 #include "core/events/EventTarget.h" |
37 #include "core/html/HTMLMediaSource.h" | 37 #include "core/html/HTMLMediaSource.h" |
38 #include "core/html/URLRegistry.h" | 38 #include "core/html/URLRegistry.h" |
39 #include "modules/mediasource/SourceBuffer.h" | 39 #include "modules/mediasource/SourceBuffer.h" |
40 #include "modules/mediasource/SourceBufferList.h" | 40 #include "modules/mediasource/SourceBufferList.h" |
41 #include "public/platform/WebMediaSource.h" | 41 #include "public/platform/WebMediaSource.h" |
42 #include "wtf/PassOwnPtr.h" | 42 #include "wtf/PassOwnPtr.h" |
43 #include "wtf/RefCounted.h" | |
44 #include "wtf/Vector.h" | 43 #include "wtf/Vector.h" |
45 | 44 |
46 namespace blink { | 45 namespace blink { |
47 class WebSourceBuffer; | 46 class WebSourceBuffer; |
48 } | 47 } |
49 | 48 |
50 namespace WebCore { | 49 namespace WebCore { |
51 | 50 |
52 class ExceptionState; | 51 class ExceptionState; |
53 class GenericEventQueue; | 52 class GenericEventQueue; |
54 | 53 |
55 class MediaSource FINAL | 54 class MediaSource FINAL |
56 : public RefCountedWillBeRefCountedGarbageCollected<MediaSource> | 55 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<MediaSour
ce> |
57 , public HTMLMediaSource | 56 , public HTMLMediaSource |
58 , public ActiveDOMObject | 57 , public ActiveDOMObject |
59 , public EventTargetWithInlineData | 58 , public EventTargetWithInlineData |
60 , public ScriptWrappable { | 59 , public ScriptWrappable { |
61 REFCOUNTED_EVENT_TARGET(MediaSource); | 60 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<M
ediaSource>); |
62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaSource); | 61 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaSource); |
63 public: | 62 public: |
64 static const AtomicString& openKeyword(); | 63 static const AtomicString& openKeyword(); |
65 static const AtomicString& closedKeyword(); | 64 static const AtomicString& closedKeyword(); |
66 static const AtomicString& endedKeyword(); | 65 static const AtomicString& endedKeyword(); |
67 | 66 |
68 static PassRefPtrWillBeRawPtr<MediaSource> create(ExecutionContext*); | 67 static MediaSource* create(ExecutionContext*); |
69 virtual ~MediaSource(); | 68 virtual ~MediaSource(); |
70 | 69 |
71 // MediaSource.idl methods | 70 // MediaSource.idl methods |
72 SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); } | 71 SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); } |
73 SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get()
; } | 72 SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get()
; } |
74 SourceBuffer* addSourceBuffer(const String& type, ExceptionState&); | 73 SourceBuffer* addSourceBuffer(const String& type, ExceptionState&); |
75 void removeSourceBuffer(SourceBuffer*, ExceptionState&); | 74 void removeSourceBuffer(SourceBuffer*, ExceptionState&); |
76 void setDuration(double, ExceptionState&); | 75 void setDuration(double, ExceptionState&); |
77 const AtomicString& readyState() const { return m_readyState; } | 76 const AtomicString& readyState() const { return m_readyState; } |
78 void endOfStream(const AtomicString& error, ExceptionState&); | 77 void endOfStream(const AtomicString& error, ExceptionState&); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // Implements the duration change algorithm. | 124 // Implements the duration change algorithm. |
126 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#duration-change-algorithm | 125 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#duration-change-algorithm |
127 void durationChangeAlgorithm(double newDuration); | 126 void durationChangeAlgorithm(double newDuration); |
128 | 127 |
129 OwnPtr<blink::WebMediaSource> m_webMediaSource; | 128 OwnPtr<blink::WebMediaSource> m_webMediaSource; |
130 AtomicString m_readyState; | 129 AtomicString m_readyState; |
131 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; | 130 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; |
132 // FIXME: oilpan: This should become a Member. For now, m_attachedElement wi
ll be cleared by the HTMLMediaElement destructor. | 131 // FIXME: oilpan: This should become a Member. For now, m_attachedElement wi
ll be cleared by the HTMLMediaElement destructor. |
133 HTMLMediaElement* m_attachedElement; | 132 HTMLMediaElement* m_attachedElement; |
134 | 133 |
135 RefPtrWillBeMember<SourceBufferList> m_sourceBuffers; | 134 Member<SourceBufferList> m_sourceBuffers; |
136 RefPtrWillBeMember<SourceBufferList> m_activeSourceBuffers; | 135 Member<SourceBufferList> m_activeSourceBuffers; |
137 }; | 136 }; |
138 | 137 |
139 } // namespace WebCore | 138 } // namespace WebCore |
140 | 139 |
141 #endif | 140 #endif |
OLD | NEW |