OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "modules/mediasource/SourceBufferTrackBaseSupplement.h" |
| 6 |
| 7 #include "core/html/track/TrackBase.h" |
| 8 #include "modules/mediasource/SourceBuffer.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 const char* SourceBufferTrackBaseSupplement::SupplementName = "SourceBufferTrack
BaseSupplement"; |
| 13 |
| 14 SourceBufferTrackBaseSupplement::SourceBufferTrackBaseSupplement(TrackBase& trac
kBase, SourceBuffer* sourceBuffer) |
| 15 : m_sourceBuffer(sourceBuffer) |
| 16 { |
| 17 provideTo(trackBase, SupplementName, this); |
| 18 } |
| 19 |
| 20 // static |
| 21 SourceBuffer* SourceBufferTrackBaseSupplement::sourceBuffer(TrackBase& track) |
| 22 { |
| 23 SourceBufferTrackBaseSupplement* supplement = static_cast<SourceBufferTrackB
aseSupplement*>(HeapSupplement<TrackBase>::from(track, SupplementName)); |
| 24 if (supplement) |
| 25 return supplement->m_sourceBuffer; |
| 26 return nullptr; |
| 27 } |
| 28 |
| 29 |
| 30 DEFINE_TRACE(SourceBufferTrackBaseSupplement) |
| 31 { |
| 32 visitor->trace(m_sourceBuffer); |
| 33 HeapSupplement<TrackBase>::trace(visitor); |
| 34 } |
| 35 |
| 36 } // namespace blink |
| 37 |
OLD | NEW |