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

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

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/core.gypi ('k') | Source/core/html/track/DataCue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/DataCue.h
diff --git a/Source/core/html/track/DataCue.h b/Source/core/html/track/DataCue.h
new file mode 100644
index 0000000000000000000000000000000000000000..2c0f4c4a1597cefc48494082841ff572ba77b96f
--- /dev/null
+++ b/Source/core/html/track/DataCue.h
@@ -0,0 +1,47 @@
+// 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.
+
+#ifndef DataCue_h
+#define DataCue_h
+
+#include "bindings/v8/ScriptWrappable.h"
+#include "core/html/track/TextTrackCue.h"
+#include "wtf/ArrayBuffer.h"
+
+namespace WebCore {
+
+class ExecutionContext;
+
+class DataCue FINAL : public TextTrackCue, public ScriptWrappable, public ContextLifecycleObserver {
+public:
+ static PassRefPtr<DataCue> create(ExecutionContext* context, double start, double end, ArrayBuffer* data)
+ {
+ return adoptRef(new DataCue(context, start, end, data));
+ }
+
+ virtual ~DataCue();
+
+ PassRefPtr<ArrayBuffer> data() const;
+ void setData(ArrayBuffer*);
+
+ virtual CueType cueType() const OVERRIDE { return Data; }
+
+ virtual ExecutionContext* executionContext() const OVERRIDE;
+
+#ifndef NDEBUG
+ virtual String toString() const OVERRIDE;
+#endif
+
+protected:
+ DataCue(ExecutionContext*, double start, double end, ArrayBuffer*);
+
+private:
+ RefPtr<ArrayBuffer> m_data;
+};
+
+DEFINE_TYPE_CASTS(DataCue, TextTrackCue, cue, cue->cueType() == TextTrackCue::Data, cue.cueType() == TextTrackCue::Data);
+
+} // namespace WebCore
+
+#endif
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/html/track/DataCue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698