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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #ifndef SourceBuffer_h | 31 #ifndef SourceBuffer_h |
32 #define SourceBuffer_h | 32 #define SourceBuffer_h |
33 | 33 |
34 #include "core/dom/ActiveDOMObject.h" | 34 #include "core/dom/ActiveDOMObject.h" |
35 #include "core/fileapi/FileReaderLoaderClient.h" | 35 #include "core/fileapi/FileReaderLoaderClient.h" |
36 #include "modules/EventTargetModules.h" | 36 #include "modules/EventTargetModules.h" |
37 #include "platform/AsyncMethodRunner.h" | 37 #include "platform/AsyncMethodRunner.h" |
38 #include "platform/weborigin/KURL.h" | 38 #include "platform/weborigin/KURL.h" |
39 #include "public/platform/WebSourceBufferClient.h" | 39 #include "public/platform/WebSourceBufferClient.h" |
40 #include "wtf/Forward.h" | |
41 #include "wtf/RefCounted.h" | 40 #include "wtf/RefCounted.h" |
42 #include "wtf/text/WTFString.h" | 41 #include "wtf/text/WTFString.h" |
43 | 42 |
44 namespace blink { | 43 namespace blink { |
45 | 44 |
| 45 class DOMArrayBuffer; |
| 46 class DOMArrayBufferView; |
46 class ExceptionState; | 47 class ExceptionState; |
47 class FileReaderLoader; | 48 class FileReaderLoader; |
48 class GenericEventQueue; | 49 class GenericEventQueue; |
49 class MediaSource; | 50 class MediaSource; |
50 class Stream; | 51 class Stream; |
51 class TimeRanges; | 52 class TimeRanges; |
52 class WebSourceBuffer; | 53 class WebSourceBuffer; |
53 | 54 |
54 class SourceBuffer final : public RefCountedGarbageCollectedWillBeGarbageCollect
edFinalized<SourceBuffer>, public ActiveDOMObject, public EventTargetWithInlineD
ata, public FileReaderLoaderClient, public WebSourceBufferClient { | 55 class SourceBuffer final : public RefCountedGarbageCollectedWillBeGarbageCollect
edFinalized<SourceBuffer>, public ActiveDOMObject, public EventTargetWithInlineD
ata, public FileReaderLoaderClient, public WebSourceBufferClient { |
55 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<S
ourceBuffer>); | 56 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<S
ourceBuffer>); |
56 DEFINE_WRAPPERTYPEINFO(); | 57 DEFINE_WRAPPERTYPEINFO(); |
57 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); | 58 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); |
58 public: | 59 public: |
59 static SourceBuffer* create(PassOwnPtr<WebSourceBuffer>, MediaSource*, Gener
icEventQueue*); | 60 static SourceBuffer* create(PassOwnPtr<WebSourceBuffer>, MediaSource*, Gener
icEventQueue*); |
60 static const AtomicString& segmentsKeyword(); | 61 static const AtomicString& segmentsKeyword(); |
61 static const AtomicString& sequenceKeyword(); | 62 static const AtomicString& sequenceKeyword(); |
62 | 63 |
63 virtual ~SourceBuffer(); | 64 virtual ~SourceBuffer(); |
64 | 65 |
65 // SourceBuffer.idl methods | 66 // SourceBuffer.idl methods |
66 const AtomicString& mode() const { return m_mode; } | 67 const AtomicString& mode() const { return m_mode; } |
67 void setMode(const AtomicString&, ExceptionState&); | 68 void setMode(const AtomicString&, ExceptionState&); |
68 bool updating() const { return m_updating; } | 69 bool updating() const { return m_updating; } |
69 PassRefPtrWillBeRawPtr<TimeRanges> buffered(ExceptionState&) const; | 70 PassRefPtrWillBeRawPtr<TimeRanges> buffered(ExceptionState&) const; |
70 double timestampOffset() const; | 71 double timestampOffset() const; |
71 void setTimestampOffset(double, ExceptionState&); | 72 void setTimestampOffset(double, ExceptionState&); |
72 void appendBuffer(PassRefPtr<ArrayBuffer> data, ExceptionState&); | 73 void appendBuffer(PassRefPtr<DOMArrayBuffer> data, ExceptionState&); |
73 void appendBuffer(PassRefPtr<ArrayBufferView> data, ExceptionState&); | 74 void appendBuffer(PassRefPtr<DOMArrayBufferView> data, ExceptionState&); |
74 void appendStream(PassRefPtrWillBeRawPtr<Stream>, ExceptionState&); | 75 void appendStream(PassRefPtrWillBeRawPtr<Stream>, ExceptionState&); |
75 void appendStream(PassRefPtrWillBeRawPtr<Stream>, unsigned long long maxSize
, ExceptionState&); | 76 void appendStream(PassRefPtrWillBeRawPtr<Stream>, unsigned long long maxSize
, ExceptionState&); |
76 void abort(ExceptionState&); | 77 void abort(ExceptionState&); |
77 void remove(double start, double end, ExceptionState&); | 78 void remove(double start, double end, ExceptionState&); |
78 double appendWindowStart() const; | 79 double appendWindowStart() const; |
79 void setAppendWindowStart(double, ExceptionState&); | 80 void setAppendWindowStart(double, ExceptionState&); |
80 double appendWindowEnd() const; | 81 double appendWindowEnd() const; |
81 void setAppendWindowEnd(double, ExceptionState&); | 82 void setAppendWindowEnd(double, ExceptionState&); |
82 | 83 |
83 void abortIfUpdating(); | 84 void abortIfUpdating(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 bool m_streamMaxSizeValid; | 143 bool m_streamMaxSizeValid; |
143 unsigned long long m_streamMaxSize; | 144 unsigned long long m_streamMaxSize; |
144 AsyncMethodRunner<SourceBuffer> m_appendStreamAsyncPartRunner; | 145 AsyncMethodRunner<SourceBuffer> m_appendStreamAsyncPartRunner; |
145 RefPtrWillBeMember<Stream> m_stream; | 146 RefPtrWillBeMember<Stream> m_stream; |
146 OwnPtr<FileReaderLoader> m_loader; | 147 OwnPtr<FileReaderLoader> m_loader; |
147 }; | 148 }; |
148 | 149 |
149 } // namespace blink | 150 } // namespace blink |
150 | 151 |
151 #endif // SourceBuffer_h | 152 #endif // SourceBuffer_h |
OLD | NEW |