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 #ifndef DataCue_h |
| 6 #define DataCue_h |
| 7 |
| 8 #include "bindings/v8/ScriptWrappable.h" |
| 9 #include "core/html/track/TextTrackCue.h" |
| 10 #include "wtf/ArrayBuffer.h" |
| 11 |
| 12 namespace WebCore { |
| 13 |
| 14 class ExecutionContext; |
| 15 |
| 16 class DataCue FINAL : public TextTrackCue, public ScriptWrappable, public Contex
tLifecycleObserver { |
| 17 public: |
| 18 static PassRefPtr<DataCue> create(ExecutionContext* context, double start, d
ouble end, ArrayBuffer* data) |
| 19 { |
| 20 return adoptRef(new DataCue(context, start, end, data)); |
| 21 } |
| 22 |
| 23 virtual ~DataCue(); |
| 24 |
| 25 PassRefPtr<ArrayBuffer> data() const; |
| 26 void setData(ArrayBuffer*); |
| 27 |
| 28 virtual CueType cueType() const OVERRIDE { return Data; } |
| 29 |
| 30 virtual ExecutionContext* executionContext() const OVERRIDE; |
| 31 |
| 32 #ifndef NDEBUG |
| 33 virtual String toString() const OVERRIDE; |
| 34 #endif |
| 35 |
| 36 protected: |
| 37 DataCue(ExecutionContext*, double start, double end, ArrayBuffer*); |
| 38 |
| 39 private: |
| 40 RefPtr<ArrayBuffer> m_data; |
| 41 }; |
| 42 |
| 43 DEFINE_TYPE_CASTS(DataCue, TextTrackCue, cue, cue->cueType() == TextTrackCue::Da
ta, cue.cueType() == TextTrackCue::Data); |
| 44 |
| 45 } // namespace WebCore |
| 46 |
| 47 #endif |
OLD | NEW |