Chromium Code Reviews| Index: Source/modules/mediasource/TrackDefault.h |
| diff --git a/Source/modules/mediasource/TrackDefault.h b/Source/modules/mediasource/TrackDefault.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..34614e0e24d5689e813a2dc13725721fdfc1113f |
| --- /dev/null |
| +++ b/Source/modules/mediasource/TrackDefault.h |
| @@ -0,0 +1,56 @@ |
| +// 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 TrackDefault_h |
| +#define TrackDefault_h |
| + |
| +#include "bindings/core/v8/ScriptWrappable.h" |
| +#include "wtf/text/WTFString.h" |
| + |
| +namespace blink { |
| + |
| +class ExceptionState; |
| + |
| +class TrackDefault final : public GarbageCollectedFinalized<TrackDefault>, public ScriptWrappable { |
| + DEFINE_WRAPPERTYPEINFO(); |
| +public: |
| + enum TrackDefaultTypeCode { |
| + TrackDefaultTypeAudio, |
| + TrackDefaultTypeVideo, |
| + TrackDefaultTypeText |
| + }; |
| + |
| + static TrackDefault* create(const AtomicString& type, const String& language, const String& label, const Vector<String>& kinds, const String& byteStreamTrackID, ExceptionState& exceptionState) |
| + { |
| + return new TrackDefault(type, language, label, kinds, byteStreamTrackID, exceptionState); |
| + } |
| + |
| + static const AtomicString& audioKeyword(); |
|
philipj_slow
2014/11/14 12:03:37
Unlike some keywords on TextTrack and VideoTrack,
wolenetz
2014/11/17 21:51:07
Done.
|
| + static const AtomicString& videoKeyword(); |
| + static const AtomicString& textKeyword(); |
| + |
| + virtual ~TrackDefault(); |
| + |
| + // Implement the IDL |
| + String type() const { return m_type; } |
|
philipj_slow
2014/11/14 12:03:37
This is AtomicString internally, so return AtomicS
wolenetz
2014/11/17 21:51:07
Done.
|
| + String byteStreamTrackID() const { return m_byteStreamTrackID; } |
| + String language() const { return m_language; } |
| + String label() const { return m_label; } |
| + Vector<String> kinds() const { return m_kinds; } |
|
philipj_slow
2014/11/14 12:03:37
const Vector<String>&, or the vector will be copie
wolenetz
2014/11/17 21:51:07
I'm not quite sure myself how the default v8 bindi
philipj_slow
2014/11/18 10:47:31
Lifetime isn't a concern here, because the binding
wolenetz
2014/11/20 23:10:54
Done as ref-to-const Vector<String>, and leaving t
|
| + |
| + void trace(Visitor*) { } |
| + |
| +private: |
| + TrackDefault(const AtomicString& type, const String& language, const String& label, const Vector<String>& kinds, const String& byteStreamTrackID, ExceptionState&); |
| + |
| + AtomicString m_type; |
| + String m_byteStreamTrackID; |
| + String m_language; |
| + String m_label; |
| + Vector<String> m_kinds; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // TrackDefault_h |