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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void endOfStream(ExceptionState&); | 80 void endOfStream(ExceptionState&); |
81 static bool isTypeSupported(const String& type); | 81 static bool isTypeSupported(const String& type); |
82 | 82 |
83 // HTMLMediaSource | 83 // HTMLMediaSource |
84 virtual bool attachToElement(HTMLMediaElement*) OVERRIDE; | 84 virtual bool attachToElement(HTMLMediaElement*) OVERRIDE; |
85 virtual void setWebMediaSourceAndOpen(PassOwnPtr<blink::WebMediaSource>) OVE
RRIDE; | 85 virtual void setWebMediaSourceAndOpen(PassOwnPtr<blink::WebMediaSource>) OVE
RRIDE; |
86 virtual void close() OVERRIDE; | 86 virtual void close() OVERRIDE; |
87 virtual bool isClosed() const OVERRIDE; | 87 virtual bool isClosed() const OVERRIDE; |
88 virtual double duration() const OVERRIDE; | 88 virtual double duration() const OVERRIDE; |
89 virtual PassRefPtr<TimeRanges> buffered() const OVERRIDE; | 89 virtual PassRefPtr<TimeRanges> buffered() const OVERRIDE; |
| 90 #if !ENABLE(OILPAN) |
90 virtual void refHTMLMediaSource() OVERRIDE { ref(); } | 91 virtual void refHTMLMediaSource() OVERRIDE { ref(); } |
91 virtual void derefHTMLMediaSource() OVERRIDE { deref(); } | 92 virtual void derefHTMLMediaSource() OVERRIDE { deref(); } |
| 93 #endif |
92 | 94 |
93 // EventTarget interface | 95 // EventTarget interface |
94 virtual const AtomicString& interfaceName() const OVERRIDE; | 96 virtual const AtomicString& interfaceName() const OVERRIDE; |
95 virtual ExecutionContext* executionContext() const OVERRIDE; | 97 virtual ExecutionContext* executionContext() const OVERRIDE; |
96 | 98 |
97 // ActiveDOMObject interface | 99 // ActiveDOMObject interface |
98 virtual bool hasPendingActivity() const OVERRIDE; | 100 virtual bool hasPendingActivity() const OVERRIDE; |
99 virtual void stop() OVERRIDE; | 101 virtual void stop() OVERRIDE; |
100 | 102 |
101 // URLRegistrable interface | 103 // URLRegistrable interface |
102 virtual URLRegistry& registry() const OVERRIDE; | 104 virtual URLRegistry& registry() const OVERRIDE; |
103 | 105 |
104 // Used by SourceBuffer. | 106 // Used by SourceBuffer. |
105 void openIfInEndedState(); | 107 void openIfInEndedState(); |
106 bool isOpen() const; | 108 bool isOpen() const; |
107 | 109 |
108 // Used by MediaSourceRegistry. | 110 // Used by MediaSourceRegistry. |
109 void addedToRegistry(); | 111 void addedToRegistry(); |
110 void removedFromRegistry(); | 112 void removedFromRegistry(); |
111 | 113 |
112 void trace(Visitor*); | 114 void trace(Visitor*); |
| 115 void clearWeakMembers(Visitor*); |
113 | 116 |
114 private: | 117 private: |
115 explicit MediaSource(ExecutionContext*); | 118 explicit MediaSource(ExecutionContext*); |
116 | 119 |
117 void setReadyState(const AtomicString&); | 120 void setReadyState(const AtomicString&); |
118 void onReadyStateChange(const AtomicString&, const AtomicString&); | 121 void onReadyStateChange(const AtomicString&, const AtomicString&); |
119 | 122 |
120 bool isUpdating() const; | 123 bool isUpdating() const; |
121 | 124 |
122 PassOwnPtr<blink::WebSourceBuffer> createWebSourceBuffer(const String& type,
const Vector<String>& codecs, ExceptionState&); | 125 PassOwnPtr<blink::WebSourceBuffer> createWebSourceBuffer(const String& type,
const Vector<String>& codecs, ExceptionState&); |
123 void scheduleEvent(const AtomicString& eventName); | 126 void scheduleEvent(const AtomicString& eventName); |
124 void endOfStreamInternal(const blink::WebMediaSource::EndOfStreamStatus, Exc
eptionState&); | 127 void endOfStreamInternal(const blink::WebMediaSource::EndOfStreamStatus, Exc
eptionState&); |
125 | 128 |
126 // Implements the duration change algorithm. | 129 // Implements the duration change algorithm. |
127 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#duration-change-algorithm | 130 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#duration-change-algorithm |
128 void durationChangeAlgorithm(double newDuration); | 131 void durationChangeAlgorithm(double newDuration); |
129 | 132 |
130 OwnPtr<blink::WebMediaSource> m_webMediaSource; | 133 OwnPtr<blink::WebMediaSource> m_webMediaSource; |
131 AtomicString m_readyState; | 134 AtomicString m_readyState; |
132 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; | 135 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; |
133 // FIXME: oilpan: This should become a Member. For now, m_attachedElement wi
ll be cleared by the HTMLMediaElement destructor. | 136 RawPtrWillBeWeakMember<HTMLMediaElement> m_attachedElement; |
134 HTMLMediaElement* m_attachedElement; | |
135 | 137 |
136 Member<SourceBufferList> m_sourceBuffers; | 138 Member<SourceBufferList> m_sourceBuffers; |
137 Member<SourceBufferList> m_activeSourceBuffers; | 139 Member<SourceBufferList> m_activeSourceBuffers; |
138 }; | 140 }; |
139 | 141 |
140 } // namespace WebCore | 142 } // namespace WebCore |
141 | 143 |
142 #endif | 144 #endif |
OLD | NEW |