OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 17 matching lines...) Expand all Loading... |
28 #define TextTrack_h | 28 #define TextTrack_h |
29 | 29 |
30 #include "bindings/v8/ScriptWrappable.h" | 30 #include "bindings/v8/ScriptWrappable.h" |
31 #include "core/events/EventTarget.h" | 31 #include "core/events/EventTarget.h" |
32 #include "core/html/track/TrackBase.h" | 32 #include "core/html/track/TrackBase.h" |
33 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
34 #include "wtf/text/WTFString.h" | 34 #include "wtf/text/WTFString.h" |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 class Document; | |
39 class ExceptionState; | 38 class ExceptionState; |
40 class HTMLMediaElement; | 39 class HTMLMediaElement; |
41 class TextTrack; | 40 class TextTrack; |
42 class TextTrackCue; | 41 class TextTrackCue; |
43 class TextTrackCueList; | 42 class TextTrackCueList; |
44 class TextTrackList; | 43 class TextTrackList; |
45 class VTTRegion; | 44 class VTTRegion; |
46 class VTTRegionList; | 45 class VTTRegionList; |
47 | 46 |
48 class TextTrack : public TrackBase, public ScriptWrappable, public EventTargetWi
thInlineData { | 47 class TextTrack : public TrackBase, public ScriptWrappable, public EventTargetWi
thInlineData { |
49 REFCOUNTED_EVENT_TARGET(TrackBase); | 48 REFCOUNTED_EVENT_TARGET(TrackBase); |
50 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TextTrack); | 49 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TextTrack); |
51 public: | 50 public: |
52 static PassRefPtrWillBeRawPtr<TextTrack> create(Document& document, const At
omicString& kind, const AtomicString& label, const AtomicString& language) | 51 static PassRefPtrWillBeRawPtr<TextTrack> create(const AtomicString& kind, co
nst AtomicString& label, const AtomicString& language) |
53 { | 52 { |
54 return adoptRefWillBeRefCountedGarbageCollected(new TextTrack(document,
kind, label, language, emptyAtom, AddTrack)); | 53 return adoptRefWillBeRefCountedGarbageCollected(new TextTrack(kind, labe
l, language, emptyAtom, AddTrack)); |
55 } | 54 } |
56 virtual ~TextTrack(); | 55 virtual ~TextTrack(); |
57 | 56 |
58 virtual void setTrackList(TextTrackList*); | 57 virtual void setTrackList(TextTrackList*); |
59 TextTrackList* trackList() { return m_trackList; } | 58 TextTrackList* trackList() { return m_trackList; } |
60 | 59 |
61 virtual void setKind(const AtomicString&) OVERRIDE; | 60 virtual void setKind(const AtomicString&) OVERRIDE; |
62 | 61 |
63 static const AtomicString& subtitlesKeyword(); | 62 static const AtomicString& subtitlesKeyword(); |
64 static const AtomicString& captionsKeyword(); | 63 static const AtomicString& captionsKeyword(); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 112 |
114 void removeAllCues(); | 113 void removeAllCues(); |
115 | 114 |
116 // EventTarget methods | 115 // EventTarget methods |
117 virtual const AtomicString& interfaceName() const OVERRIDE; | 116 virtual const AtomicString& interfaceName() const OVERRIDE; |
118 virtual ExecutionContext* executionContext() const OVERRIDE; | 117 virtual ExecutionContext* executionContext() const OVERRIDE; |
119 | 118 |
120 virtual void trace(Visitor*) OVERRIDE; | 119 virtual void trace(Visitor*) OVERRIDE; |
121 | 120 |
122 protected: | 121 protected: |
123 TextTrack(Document&, const AtomicString& kind, const AtomicString& label, co
nst AtomicString& language, const AtomicString& id, TextTrackType); | 122 TextTrack(const AtomicString& kind, const AtomicString& label, const AtomicS
tring& language, const AtomicString& id, TextTrackType); |
124 | 123 |
125 virtual bool isValidKind(const AtomicString& kind) const OVERRIDE { return i
sValidKindKeyword(kind); } | 124 virtual bool isValidKind(const AtomicString& kind) const OVERRIDE { return i
sValidKindKeyword(kind); } |
126 virtual AtomicString defaultKind() const OVERRIDE { return subtitlesKeyword(
); } | 125 virtual AtomicString defaultKind() const OVERRIDE { return subtitlesKeyword(
); } |
127 | 126 |
128 RefPtrWillBeMember<TextTrackCueList> m_cues; | 127 RefPtrWillBeMember<TextTrackCueList> m_cues; |
129 | 128 |
130 private: | 129 private: |
131 VTTRegionList* ensureVTTRegionList(); | 130 VTTRegionList* ensureVTTRegionList(); |
132 RefPtrWillBeMember<VTTRegionList> m_regions; | 131 RefPtrWillBeMember<VTTRegionList> m_regions; |
133 | 132 |
134 TextTrackCueList* ensureTextTrackCueList(); | 133 TextTrackCueList* ensureTextTrackCueList(); |
135 | 134 |
136 RawPtrWillBeMember<TextTrackList> m_trackList; | 135 RawPtrWillBeMember<TextTrackList> m_trackList; |
137 AtomicString m_mode; | 136 AtomicString m_mode; |
138 TextTrackType m_trackType; | 137 TextTrackType m_trackType; |
139 ReadinessState m_readinessState; | 138 ReadinessState m_readinessState; |
140 int m_trackIndex; | 139 int m_trackIndex; |
141 int m_renderedTrackIndex; | 140 int m_renderedTrackIndex; |
142 bool m_hasBeenConfigured; | 141 bool m_hasBeenConfigured; |
143 }; | 142 }; |
144 | 143 |
145 } // namespace WebCore | 144 } // namespace WebCore |
146 | 145 |
147 #endif | 146 #endif |
OLD | NEW |