| 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 29 matching lines...) Expand all Loading... |
| 40 #include "public/platform/WebMediaSource.h" | 40 #include "public/platform/WebMediaSource.h" |
| 41 #include "wtf/PassOwnPtr.h" | 41 #include "wtf/PassOwnPtr.h" |
| 42 #include "wtf/Vector.h" | 42 #include "wtf/Vector.h" |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 class ExceptionState; | 46 class ExceptionState; |
| 47 class GenericEventQueue; | 47 class GenericEventQueue; |
| 48 class WebSourceBuffer; | 48 class WebSourceBuffer; |
| 49 | 49 |
| 50 class MediaSource FINAL | 50 class MediaSource final |
| 51 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<MediaSour
ce> | 51 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<MediaSour
ce> |
| 52 , public HTMLMediaSource | 52 , public HTMLMediaSource |
| 53 , public ActiveDOMObject | 53 , public ActiveDOMObject |
| 54 , public EventTargetWithInlineData { | 54 , public EventTargetWithInlineData { |
| 55 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<M
ediaSource>); | 55 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<M
ediaSource>); |
| 56 DEFINE_WRAPPERTYPEINFO(); | 56 DEFINE_WRAPPERTYPEINFO(); |
| 57 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaSource); | 57 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaSource); |
| 58 public: | 58 public: |
| 59 static const AtomicString& openKeyword(); | 59 static const AtomicString& openKeyword(); |
| 60 static const AtomicString& closedKeyword(); | 60 static const AtomicString& closedKeyword(); |
| 61 static const AtomicString& endedKeyword(); | 61 static const AtomicString& endedKeyword(); |
| 62 | 62 |
| 63 static MediaSource* create(ExecutionContext*); | 63 static MediaSource* create(ExecutionContext*); |
| 64 virtual ~MediaSource(); | 64 virtual ~MediaSource(); |
| 65 | 65 |
| 66 // MediaSource.idl methods | 66 // MediaSource.idl methods |
| 67 SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); } | 67 SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); } |
| 68 SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get()
; } | 68 SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get()
; } |
| 69 SourceBuffer* addSourceBuffer(const String& type, ExceptionState&); | 69 SourceBuffer* addSourceBuffer(const String& type, ExceptionState&); |
| 70 void removeSourceBuffer(SourceBuffer*, ExceptionState&); | 70 void removeSourceBuffer(SourceBuffer*, ExceptionState&); |
| 71 void setDuration(double, ExceptionState&); | 71 void setDuration(double, ExceptionState&); |
| 72 const AtomicString& readyState() const { return m_readyState; } | 72 const AtomicString& readyState() const { return m_readyState; } |
| 73 void endOfStream(const AtomicString& error, ExceptionState&); | 73 void endOfStream(const AtomicString& error, ExceptionState&); |
| 74 void endOfStream(ExceptionState&); | 74 void endOfStream(ExceptionState&); |
| 75 static bool isTypeSupported(const String& type); | 75 static bool isTypeSupported(const String& type); |
| 76 | 76 |
| 77 // HTMLMediaSource | 77 // HTMLMediaSource |
| 78 virtual bool attachToElement(HTMLMediaElement*) OVERRIDE; | 78 virtual bool attachToElement(HTMLMediaElement*) override; |
| 79 virtual void setWebMediaSourceAndOpen(PassOwnPtr<WebMediaSource>) OVERRIDE; | 79 virtual void setWebMediaSourceAndOpen(PassOwnPtr<WebMediaSource>) override; |
| 80 virtual void close() OVERRIDE; | 80 virtual void close() override; |
| 81 virtual bool isClosed() const OVERRIDE; | 81 virtual bool isClosed() const override; |
| 82 virtual double duration() const OVERRIDE; | 82 virtual double duration() const override; |
| 83 virtual PassRefPtrWillBeRawPtr<TimeRanges> buffered() const OVERRIDE; | 83 virtual PassRefPtrWillBeRawPtr<TimeRanges> buffered() const override; |
| 84 #if !ENABLE(OILPAN) | 84 #if !ENABLE(OILPAN) |
| 85 virtual void refHTMLMediaSource() OVERRIDE { ref(); } | 85 virtual void refHTMLMediaSource() override { ref(); } |
| 86 virtual void derefHTMLMediaSource() OVERRIDE { deref(); } | 86 virtual void derefHTMLMediaSource() override { deref(); } |
| 87 #endif | 87 #endif |
| 88 | 88 |
| 89 // EventTarget interface | 89 // EventTarget interface |
| 90 virtual const AtomicString& interfaceName() const OVERRIDE; | 90 virtual const AtomicString& interfaceName() const override; |
| 91 virtual ExecutionContext* executionContext() const OVERRIDE; | 91 virtual ExecutionContext* executionContext() const override; |
| 92 | 92 |
| 93 // ActiveDOMObject interface | 93 // ActiveDOMObject interface |
| 94 virtual bool hasPendingActivity() const OVERRIDE; | 94 virtual bool hasPendingActivity() const override; |
| 95 virtual void stop() OVERRIDE; | 95 virtual void stop() override; |
| 96 | 96 |
| 97 // URLRegistrable interface | 97 // URLRegistrable interface |
| 98 virtual URLRegistry& registry() const OVERRIDE; | 98 virtual URLRegistry& registry() const override; |
| 99 | 99 |
| 100 // Used by SourceBuffer. | 100 // Used by SourceBuffer. |
| 101 void openIfInEndedState(); | 101 void openIfInEndedState(); |
| 102 bool isOpen() const; | 102 bool isOpen() const; |
| 103 void setSourceBufferActive(SourceBuffer*); | 103 void setSourceBufferActive(SourceBuffer*); |
| 104 | 104 |
| 105 // Used by MediaSourceRegistry. | 105 // Used by MediaSourceRegistry. |
| 106 void addedToRegistry(); | 106 void addedToRegistry(); |
| 107 void removedFromRegistry(); | 107 void removedFromRegistry(); |
| 108 | 108 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 132 | 132 |
| 133 Member<SourceBufferList> m_sourceBuffers; | 133 Member<SourceBufferList> m_sourceBuffers; |
| 134 Member<SourceBufferList> m_activeSourceBuffers; | 134 Member<SourceBufferList> m_activeSourceBuffers; |
| 135 | 135 |
| 136 bool m_isAddedToRegistry; | 136 bool m_isAddedToRegistry; |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 } // namespace blink | 139 } // namespace blink |
| 140 | 140 |
| 141 #endif // MediaSource_h | 141 #endif // MediaSource_h |
| OLD | NEW |