| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 class SourceBuffer final | 59 class SourceBuffer final |
| 60 : public RefCountedGarbageCollectedEventTargetWithInlineData<SourceBuffer> | 60 : public RefCountedGarbageCollectedEventTargetWithInlineData<SourceBuffer> |
| 61 , public ActiveScriptWrappable | 61 , public ActiveScriptWrappable |
| 62 , public ActiveDOMObject | 62 , public ActiveDOMObject |
| 63 , public FileReaderLoaderClient | 63 , public FileReaderLoaderClient |
| 64 , public WebSourceBufferClient { | 64 , public WebSourceBufferClient { |
| 65 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SourceBuffer); | 65 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SourceBuffer); |
| 66 USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); | 66 USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); |
| 67 DEFINE_WRAPPERTYPEINFO(); | 67 DEFINE_WRAPPERTYPEINFO(); |
| 68 USING_PRE_FINALIZER(SourceBuffer, dispose); |
| 68 public: | 69 public: |
| 69 static SourceBuffer* create(PassOwnPtr<WebSourceBuffer>, MediaSource*, Gener
icEventQueue*); | 70 static SourceBuffer* create(PassOwnPtr<WebSourceBuffer>, MediaSource*, Gener
icEventQueue*); |
| 70 static const AtomicString& segmentsKeyword(); | 71 static const AtomicString& segmentsKeyword(); |
| 71 static const AtomicString& sequenceKeyword(); | 72 static const AtomicString& sequenceKeyword(); |
| 72 | 73 |
| 73 ~SourceBuffer() override; | 74 ~SourceBuffer() override; |
| 74 | 75 |
| 75 // SourceBuffer.idl methods | 76 // SourceBuffer.idl methods |
| 76 const AtomicString& mode() const { return m_mode; } | 77 const AtomicString& mode() const { return m_mode; } |
| 77 void setMode(const AtomicString&, ExceptionState&); | 78 void setMode(const AtomicString&, ExceptionState&); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 106 void resume() override; | 107 void resume() override; |
| 107 void stop() override; | 108 void stop() override; |
| 108 | 109 |
| 109 // EventTarget interface | 110 // EventTarget interface |
| 110 ExecutionContext* getExecutionContext() const override; | 111 ExecutionContext* getExecutionContext() const override; |
| 111 const AtomicString& interfaceName() const override; | 112 const AtomicString& interfaceName() const override; |
| 112 | 113 |
| 113 // WebSourceBufferClient interface | 114 // WebSourceBufferClient interface |
| 114 std::vector<WebMediaPlayer::TrackId> initializationSegmentReceived(const std
::vector<MediaTrackInfo>&) override; | 115 std::vector<WebMediaPlayer::TrackId> initializationSegmentReceived(const std
::vector<MediaTrackInfo>&) override; |
| 115 | 116 |
| 116 // Oilpan: eagerly release owned m_webSourceBuffer | |
| 117 EAGERLY_FINALIZE(); | |
| 118 DECLARE_VIRTUAL_TRACE(); | 117 DECLARE_VIRTUAL_TRACE(); |
| 119 | 118 |
| 120 private: | 119 private: |
| 121 SourceBuffer(PassOwnPtr<WebSourceBuffer>, MediaSource*, GenericEventQueue*); | 120 SourceBuffer(PassOwnPtr<WebSourceBuffer>, MediaSource*, GenericEventQueue*); |
| 121 void dispose(); |
| 122 | 122 |
| 123 bool isRemoved() const; | 123 bool isRemoved() const; |
| 124 void scheduleEvent(const AtomicString& eventName); | 124 void scheduleEvent(const AtomicString& eventName); |
| 125 | 125 |
| 126 bool prepareAppend(size_t newDataSize, ExceptionState&); | 126 bool prepareAppend(size_t newDataSize, ExceptionState&); |
| 127 bool evictCodedFrames(size_t newDataSize); | 127 bool evictCodedFrames(size_t newDataSize); |
| 128 void appendBufferInternal(const unsigned char*, unsigned, ExceptionState&); | 128 void appendBufferInternal(const unsigned char*, unsigned, ExceptionState&); |
| 129 void appendBufferAsyncPart(); | 129 void appendBufferAsyncPart(); |
| 130 void appendError(bool decodeError); | 130 void appendError(bool decodeError); |
| 131 | 131 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 bool m_streamMaxSizeValid; | 167 bool m_streamMaxSizeValid; |
| 168 unsigned long long m_streamMaxSize; | 168 unsigned long long m_streamMaxSize; |
| 169 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; | 169 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; |
| 170 Member<Stream> m_stream; | 170 Member<Stream> m_stream; |
| 171 OwnPtr<FileReaderLoader> m_loader; | 171 OwnPtr<FileReaderLoader> m_loader; |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 } // namespace blink | 174 } // namespace blink |
| 175 | 175 |
| 176 #endif // SourceBuffer_h | 176 #endif // SourceBuffer_h |
| OLD | NEW |