OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 "config.h" |
| 6 #include "core/html/track/DataCue.h" |
| 7 |
| 8 namespace WebCore { |
| 9 |
| 10 DataCue::DataCue(ExecutionContext* context, double startTime, double endTime, Ar
rayBuffer* data) |
| 11 : TextTrackCue(startTime, endTime) |
| 12 , ContextLifecycleObserver(context) |
| 13 { |
| 14 ScriptWrappable::init(this); |
| 15 setData(data); |
| 16 } |
| 17 |
| 18 DataCue::~DataCue() |
| 19 { |
| 20 } |
| 21 |
| 22 #ifndef NDEBUG |
| 23 String DataCue::toString() const |
| 24 { |
| 25 return String::format("%p id=%s interval=%f-->%f)", this, id().utf8().data()
, startTime(), endTime()); |
| 26 } |
| 27 #endif |
| 28 |
| 29 PassRefPtr<ArrayBuffer> DataCue::data() const |
| 30 { |
| 31 ASSERT(m_data); |
| 32 return ArrayBuffer::create(m_data.get()); |
| 33 } |
| 34 |
| 35 void DataCue::setData(ArrayBuffer* data) |
| 36 { |
| 37 m_data = ArrayBuffer::create(data); |
| 38 } |
| 39 |
| 40 ExecutionContext* DataCue::executionContext() const |
| 41 { |
| 42 return ContextLifecycleObserver::executionContext(); |
| 43 } |
| 44 |
| 45 } // namespace WebCore |
OLD | NEW |