OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
34 #include "wtf/PassRefPtr.h" | 34 #include "wtf/PassRefPtr.h" |
35 #include "wtf/RefCounted.h" | 35 #include "wtf/RefCounted.h" |
36 #include "wtf/Vector.h" | 36 #include "wtf/Vector.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 class GenericEventQueue; | 40 class GenericEventQueue; |
41 class TextTrack; | 41 class TextTrack; |
42 | 42 |
43 class TextTrackList FINAL : public RefCountedWillBeGarbageCollectedFinalized<Tex
tTrackList>, public EventTargetWithInlineData { | 43 class TextTrackList final : public RefCountedWillBeGarbageCollectedFinalized<Tex
tTrackList>, public EventTargetWithInlineData { |
44 DEFINE_WRAPPERTYPEINFO(); | 44 DEFINE_WRAPPERTYPEINFO(); |
45 REFCOUNTED_EVENT_TARGET(TextTrackList); | 45 REFCOUNTED_EVENT_TARGET(TextTrackList); |
46 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TextTrackList); | 46 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TextTrackList); |
47 public: | 47 public: |
48 static PassRefPtrWillBeRawPtr<TextTrackList> create(HTMLMediaElement* owner) | 48 static PassRefPtrWillBeRawPtr<TextTrackList> create(HTMLMediaElement* owner) |
49 { | 49 { |
50 return adoptRefWillBeNoop(new TextTrackList(owner)); | 50 return adoptRefWillBeNoop(new TextTrackList(owner)); |
51 } | 51 } |
52 virtual ~TextTrackList(); | 52 virtual ~TextTrackList(); |
53 | 53 |
54 unsigned length() const; | 54 unsigned length() const; |
55 int getTrackIndex(TextTrack*); | 55 int getTrackIndex(TextTrack*); |
56 int getTrackIndexRelativeToRenderedTracks(TextTrack*); | 56 int getTrackIndexRelativeToRenderedTracks(TextTrack*); |
57 bool contains(TextTrack*) const; | 57 bool contains(TextTrack*) const; |
58 | 58 |
59 TextTrack* item(unsigned index); | 59 TextTrack* item(unsigned index); |
60 TextTrack* getTrackById(const AtomicString& id); | 60 TextTrack* getTrackById(const AtomicString& id); |
61 void append(PassRefPtrWillBeRawPtr<TextTrack>); | 61 void append(PassRefPtrWillBeRawPtr<TextTrack>); |
62 void remove(TextTrack*); | 62 void remove(TextTrack*); |
63 | 63 |
64 // EventTarget | 64 // EventTarget |
65 virtual const AtomicString& interfaceName() const OVERRIDE; | 65 virtual const AtomicString& interfaceName() const override; |
66 virtual ExecutionContext* executionContext() const OVERRIDE; | 66 virtual ExecutionContext* executionContext() const override; |
67 | 67 |
68 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); | 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); |
69 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); | 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); |
70 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); | 70 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); |
71 | 71 |
72 #if !ENABLE(OILPAN) | 72 #if !ENABLE(OILPAN) |
73 void clearOwner(); | 73 void clearOwner(); |
74 #endif | 74 #endif |
75 HTMLMediaElement* owner() const; | 75 HTMLMediaElement* owner() const; |
76 | 76 |
77 void scheduleChangeEvent(); | 77 void scheduleChangeEvent(); |
78 void removeAllInbandTracks(); | 78 void removeAllInbandTracks(); |
79 | 79 |
80 virtual void trace(Visitor*) OVERRIDE; | 80 virtual void trace(Visitor*) override; |
81 | 81 |
82 private: | 82 private: |
83 explicit TextTrackList(HTMLMediaElement*); | 83 explicit TextTrackList(HTMLMediaElement*); |
84 | 84 |
85 void scheduleTrackEvent(const AtomicString& eventName, PassRefPtrWillBeRawPt
r<TextTrack>); | 85 void scheduleTrackEvent(const AtomicString& eventName, PassRefPtrWillBeRawPt
r<TextTrack>); |
86 | 86 |
87 void scheduleAddTrackEvent(PassRefPtrWillBeRawPtr<TextTrack>); | 87 void scheduleAddTrackEvent(PassRefPtrWillBeRawPtr<TextTrack>); |
88 void scheduleRemoveTrackEvent(PassRefPtrWillBeRawPtr<TextTrack>); | 88 void scheduleRemoveTrackEvent(PassRefPtrWillBeRawPtr<TextTrack>); |
89 | 89 |
90 void invalidateTrackIndexesAfterTrack(TextTrack*); | 90 void invalidateTrackIndexesAfterTrack(TextTrack*); |
91 | 91 |
92 RawPtrWillBeMember<HTMLMediaElement> m_owner; | 92 RawPtrWillBeMember<HTMLMediaElement> m_owner; |
93 | 93 |
94 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; | 94 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; |
95 | 95 |
96 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_addTrackTracks; | 96 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_addTrackTracks; |
97 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_elementTracks; | 97 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_elementTracks; |
98 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_inbandTracks; | 98 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_inbandTracks; |
99 }; | 99 }; |
100 | 100 |
101 } // namespace blink | 101 } // namespace blink |
102 | 102 |
103 #endif // TextTrackList_h | 103 #endif // TextTrackList_h |
OLD | NEW |