Index: Source/core/html/track/DataCue.cpp |
diff --git a/Source/core/html/track/DataCue.cpp b/Source/core/html/track/DataCue.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..abd705e85464ff3e0c897a0f262b686b915b7513 |
--- /dev/null |
+++ b/Source/core/html/track/DataCue.cpp |
@@ -0,0 +1,45 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "core/html/track/DataCue.h" |
+ |
+namespace WebCore { |
+ |
+DataCue::DataCue(ExecutionContext* context, double startTime, double endTime, ArrayBuffer* data) |
+ : TextTrackCue(startTime, endTime) |
+ , ContextLifecycleObserver(context) |
+{ |
+ ScriptWrappable::init(this); |
+ setData(data); |
+} |
+ |
+DataCue::~DataCue() |
+{ |
+} |
+ |
+#ifndef NDEBUG |
+String DataCue::toString() const |
+{ |
+ return String::format("%p id=%s interval=%f-->%f)", this, id().utf8().data(), startTime(), endTime()); |
+} |
+#endif |
+ |
+PassRefPtr<ArrayBuffer> DataCue::data() const |
+{ |
+ ASSERT(m_data); |
+ return ArrayBuffer::create(m_data.get()); |
+} |
+ |
+void DataCue::setData(ArrayBuffer* data) |
+{ |
+ m_data = ArrayBuffer::create(data); |
+} |
+ |
+ExecutionContext* DataCue::executionContext() const |
+{ |
+ return ContextLifecycleObserver::executionContext(); |
+} |
+ |
+} // namespace WebCore |