| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 , m_pendingRemoveStart(-1) | 121 , m_pendingRemoveStart(-1) |
| 122 , m_pendingRemoveEnd(-1) | 122 , m_pendingRemoveEnd(-1) |
| 123 , m_removeAsyncPartRunner(AsyncMethodRunner<SourceBuffer>::create(this, &Sou
rceBuffer::removeAsyncPart)) | 123 , m_removeAsyncPartRunner(AsyncMethodRunner<SourceBuffer>::create(this, &Sou
rceBuffer::removeAsyncPart)) |
| 124 , m_streamMaxSizeValid(false) | 124 , m_streamMaxSizeValid(false) |
| 125 , m_streamMaxSize(0) | 125 , m_streamMaxSize(0) |
| 126 , m_appendStreamAsyncPartRunner(AsyncMethodRunner<SourceBuffer>::create(this
, &SourceBuffer::appendStreamAsyncPart)) | 126 , m_appendStreamAsyncPartRunner(AsyncMethodRunner<SourceBuffer>::create(this
, &SourceBuffer::appendStreamAsyncPart)) |
| 127 { | 127 { |
| 128 ASSERT(m_webSourceBuffer); | 128 ASSERT(m_webSourceBuffer); |
| 129 ASSERT(m_source); | 129 ASSERT(m_source); |
| 130 ASSERT(m_source->mediaElement()); | 130 ASSERT(m_source->mediaElement()); |
| 131 ThreadState::current()->registerPreFinalizer(this); |
| 131 m_audioTracks = AudioTrackList::create(*m_source->mediaElement()); | 132 m_audioTracks = AudioTrackList::create(*m_source->mediaElement()); |
| 132 m_videoTracks = VideoTrackList::create(*m_source->mediaElement()); | 133 m_videoTracks = VideoTrackList::create(*m_source->mediaElement()); |
| 133 m_webSourceBuffer->setClient(this); | 134 m_webSourceBuffer->setClient(this); |
| 134 } | 135 } |
| 135 | 136 |
| 136 SourceBuffer::~SourceBuffer() | 137 SourceBuffer::~SourceBuffer() |
| 137 { | 138 { |
| 138 // Oilpan: a SourceBuffer might be finalized without having been | |
| 139 // explicitly removed first, hence the asserts below will not | |
| 140 // hold. | |
| 141 #if !ENABLE(OILPAN) | |
| 142 m_audioTracks->shutdown(); | |
| 143 m_videoTracks->shutdown(); | |
| 144 ASSERT(isRemoved()); | |
| 145 ASSERT(!m_loader); | |
| 146 ASSERT(!m_stream); | |
| 147 ASSERT(!m_webSourceBuffer); | |
| 148 #endif | |
| 149 WTF_LOG(Media, "SourceBuffer(%p)::~SourceBuffer", this); | 139 WTF_LOG(Media, "SourceBuffer(%p)::~SourceBuffer", this); |
| 150 } | 140 } |
| 151 | 141 |
| 142 void SourceBuffer::dispose() |
| 143 { |
| 144 // Promptly clears a raw reference from content/ to an on-heap object |
| 145 // so that content/ doesn't access it in a lazy sweeping phase. |
| 146 m_webSourceBuffer.clear(); |
| 147 } |
| 148 |
| 152 const AtomicString& SourceBuffer::segmentsKeyword() | 149 const AtomicString& SourceBuffer::segmentsKeyword() |
| 153 { | 150 { |
| 154 DEFINE_STATIC_LOCAL(const AtomicString, segments, ("segments")); | 151 DEFINE_STATIC_LOCAL(const AtomicString, segments, ("segments")); |
| 155 return segments; | 152 return segments; |
| 156 } | 153 } |
| 157 | 154 |
| 158 const AtomicString& SourceBuffer::sequenceKeyword() | 155 const AtomicString& SourceBuffer::sequenceKeyword() |
| 159 { | 156 { |
| 160 DEFINE_STATIC_LOCAL(const AtomicString, sequence, ("sequence")); | 157 DEFINE_STATIC_LOCAL(const AtomicString, sequence, ("sequence")); |
| 161 return sequence; | 158 return sequence; |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 visitor->trace(m_removeAsyncPartRunner); | 955 visitor->trace(m_removeAsyncPartRunner); |
| 959 visitor->trace(m_appendStreamAsyncPartRunner); | 956 visitor->trace(m_appendStreamAsyncPartRunner); |
| 960 visitor->trace(m_stream); | 957 visitor->trace(m_stream); |
| 961 visitor->trace(m_audioTracks); | 958 visitor->trace(m_audioTracks); |
| 962 visitor->trace(m_videoTracks); | 959 visitor->trace(m_videoTracks); |
| 963 RefCountedGarbageCollectedEventTargetWithInlineData<SourceBuffer>::trace(vis
itor); | 960 RefCountedGarbageCollectedEventTargetWithInlineData<SourceBuffer>::trace(vis
itor); |
| 964 ActiveDOMObject::trace(visitor); | 961 ActiveDOMObject::trace(visitor); |
| 965 } | 962 } |
| 966 | 963 |
| 967 } // namespace blink | 964 } // namespace blink |
| OLD | NEW |