Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Unified Diff: Source/core/html/track/DataCue.cpp

Issue 224833002: Implement DataCue interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove text attribute Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/track/DataCue.h ('k') | Source/core/html/track/DataCue.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/html/track/DataCue.h ('k') | Source/core/html/track/DataCue.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698