| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 , public FileReaderLoaderClient | 59 , public FileReaderLoaderClient |
| 60 , public WebSourceBufferClient { | 60 , public WebSourceBufferClient { |
| 61 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SourceBuffer); | 61 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SourceBuffer); |
| 62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); | 62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); |
| 63 DEFINE_WRAPPERTYPEINFO(); | 63 DEFINE_WRAPPERTYPEINFO(); |
| 64 public: | 64 public: |
| 65 static SourceBuffer* create(PassOwnPtr<WebSourceBuffer>, MediaSource*, Gener
icEventQueue*); | 65 static SourceBuffer* create(PassOwnPtr<WebSourceBuffer>, MediaSource*, Gener
icEventQueue*); |
| 66 static const AtomicString& segmentsKeyword(); | 66 static const AtomicString& segmentsKeyword(); |
| 67 static const AtomicString& sequenceKeyword(); | 67 static const AtomicString& sequenceKeyword(); |
| 68 | 68 |
| 69 virtual ~SourceBuffer(); | 69 ~SourceBuffer() override; |
| 70 | 70 |
| 71 // SourceBuffer.idl methods | 71 // SourceBuffer.idl methods |
| 72 const AtomicString& mode() const { return m_mode; } | 72 const AtomicString& mode() const { return m_mode; } |
| 73 void setMode(const AtomicString&, ExceptionState&); | 73 void setMode(const AtomicString&, ExceptionState&); |
| 74 bool updating() const { return m_updating; } | 74 bool updating() const { return m_updating; } |
| 75 PassRefPtrWillBeRawPtr<TimeRanges> buffered(ExceptionState&) const; | 75 PassRefPtrWillBeRawPtr<TimeRanges> buffered(ExceptionState&) const; |
| 76 double timestampOffset() const; | 76 double timestampOffset() const; |
| 77 void setTimestampOffset(double, ExceptionState&); | 77 void setTimestampOffset(double, ExceptionState&); |
| 78 void appendBuffer(PassRefPtr<DOMArrayBuffer> data, ExceptionState&); | 78 void appendBuffer(PassRefPtr<DOMArrayBuffer> data, ExceptionState&); |
| 79 void appendBuffer(PassRefPtr<DOMArrayBufferView> data, ExceptionState&); | 79 void appendBuffer(PassRefPtr<DOMArrayBufferView> data, ExceptionState&); |
| 80 void appendStream(Stream*, ExceptionState&); | 80 void appendStream(Stream*, ExceptionState&); |
| 81 void appendStream(Stream*, unsigned long long maxSize, ExceptionState&); | 81 void appendStream(Stream*, unsigned long long maxSize, ExceptionState&); |
| 82 void abort(ExceptionState&); | 82 void abort(ExceptionState&); |
| 83 void remove(double start, double end, ExceptionState&); | 83 void remove(double start, double end, ExceptionState&); |
| 84 double appendWindowStart() const; | 84 double appendWindowStart() const; |
| 85 void setAppendWindowStart(double, ExceptionState&); | 85 void setAppendWindowStart(double, ExceptionState&); |
| 86 double appendWindowEnd() const; | 86 double appendWindowEnd() const; |
| 87 void setAppendWindowEnd(double, ExceptionState&); | 87 void setAppendWindowEnd(double, ExceptionState&); |
| 88 TrackDefaultList* trackDefaults() const { return m_trackDefaults.get(); } | 88 TrackDefaultList* trackDefaults() const { return m_trackDefaults.get(); } |
| 89 void setTrackDefaults(TrackDefaultList*, ExceptionState&); | 89 void setTrackDefaults(TrackDefaultList*, ExceptionState&); |
| 90 | 90 |
| 91 void abortIfUpdating(); | 91 void abortIfUpdating(); |
| 92 void removedFromMediaSource(); | 92 void removedFromMediaSource(); |
| 93 | 93 |
| 94 // ActiveDOMObject interface | 94 // ActiveDOMObject interface |
| 95 virtual bool hasPendingActivity() const override; | 95 bool hasPendingActivity() const override; |
| 96 virtual void suspend() override; | 96 void suspend() override; |
| 97 virtual void resume() override; | 97 void resume() override; |
| 98 virtual void stop() override; | 98 void stop() override; |
| 99 | 99 |
| 100 // EventTarget interface | 100 // EventTarget interface |
| 101 virtual ExecutionContext* executionContext() const override; | 101 ExecutionContext* executionContext() const override; |
| 102 virtual const AtomicString& interfaceName() const override; | 102 const AtomicString& interfaceName() const override; |
| 103 | 103 |
| 104 // WebSourceBufferClient interface | 104 // WebSourceBufferClient interface |
| 105 virtual void initializationSegmentReceived() override; | 105 void initializationSegmentReceived() override; |
| 106 | 106 |
| 107 // Oilpan: eagerly release owned m_webSourceBuffer | 107 // Oilpan: eagerly release owned m_webSourceBuffer |
| 108 EAGERLY_FINALIZE(); | 108 EAGERLY_FINALIZE(); |
| 109 DECLARE_VIRTUAL_TRACE(); | 109 DECLARE_VIRTUAL_TRACE(); |
| 110 | 110 |
| 111 private: | 111 private: |
| 112 SourceBuffer(PassOwnPtr<WebSourceBuffer>, MediaSource*, GenericEventQueue*); | 112 SourceBuffer(PassOwnPtr<WebSourceBuffer>, MediaSource*, GenericEventQueue*); |
| 113 | 113 |
| 114 bool isRemoved() const; | 114 bool isRemoved() const; |
| 115 void scheduleEvent(const AtomicString& eventName); | 115 void scheduleEvent(const AtomicString& eventName); |
| 116 | 116 |
| 117 void appendBufferInternal(const unsigned char*, unsigned, ExceptionState&); | 117 void appendBufferInternal(const unsigned char*, unsigned, ExceptionState&); |
| 118 void appendBufferAsyncPart(); | 118 void appendBufferAsyncPart(); |
| 119 | 119 |
| 120 void removeAsyncPart(); | 120 void removeAsyncPart(); |
| 121 | 121 |
| 122 void appendStreamInternal(Stream*, ExceptionState&); | 122 void appendStreamInternal(Stream*, ExceptionState&); |
| 123 void appendStreamAsyncPart(); | 123 void appendStreamAsyncPart(); |
| 124 void appendStreamDone(bool success); | 124 void appendStreamDone(bool success); |
| 125 void clearAppendStreamState(); | 125 void clearAppendStreamState(); |
| 126 | 126 |
| 127 // FileReaderLoaderClient interface | 127 // FileReaderLoaderClient interface |
| 128 virtual void didStartLoading() override; | 128 void didStartLoading() override; |
| 129 virtual void didReceiveDataForClient(const char* data, unsigned dataLength)
override; | 129 void didReceiveDataForClient(const char* data, unsigned dataLength) override
; |
| 130 virtual void didFinishLoading() override; | 130 void didFinishLoading() override; |
| 131 virtual void didFail(FileError::ErrorCode) override; | 131 void didFail(FileError::ErrorCode) override; |
| 132 | 132 |
| 133 OwnPtr<WebSourceBuffer> m_webSourceBuffer; | 133 OwnPtr<WebSourceBuffer> m_webSourceBuffer; |
| 134 Member<MediaSource> m_source; | 134 Member<MediaSource> m_source; |
| 135 Member<TrackDefaultList> m_trackDefaults; | 135 Member<TrackDefaultList> m_trackDefaults; |
| 136 RawPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; | 136 RawPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; |
| 137 | 137 |
| 138 AtomicString m_mode; | 138 AtomicString m_mode; |
| 139 bool m_updating; | 139 bool m_updating; |
| 140 double m_timestampOffset; | 140 double m_timestampOffset; |
| 141 double m_appendWindowStart; | 141 double m_appendWindowStart; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 153 bool m_streamMaxSizeValid; | 153 bool m_streamMaxSizeValid; |
| 154 unsigned long long m_streamMaxSize; | 154 unsigned long long m_streamMaxSize; |
| 155 AsyncMethodRunner<SourceBuffer> m_appendStreamAsyncPartRunner; | 155 AsyncMethodRunner<SourceBuffer> m_appendStreamAsyncPartRunner; |
| 156 Member<Stream> m_stream; | 156 Member<Stream> m_stream; |
| 157 OwnPtr<FileReaderLoader> m_loader; | 157 OwnPtr<FileReaderLoader> m_loader; |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 } // namespace blink | 160 } // namespace blink |
| 161 | 161 |
| 162 #endif // SourceBuffer_h | 162 #endif // SourceBuffer_h |
| OLD | NEW |