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

Side by Side Diff: Source/core/html/track/TextTrackList.h

Issue 83073006: Add "change" and "removetrack" events to TextTrackList. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@add-track-id-again
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 TextTrack* item(unsigned index); 57 TextTrack* item(unsigned index);
58 void append(PassRefPtr<TextTrack>); 58 void append(PassRefPtr<TextTrack>);
59 void remove(TextTrack*); 59 void remove(TextTrack*);
60 60
61 // EventTarget 61 // EventTarget
62 virtual const AtomicString& interfaceName() const OVERRIDE; 62 virtual const AtomicString& interfaceName() const OVERRIDE;
63 virtual ExecutionContext* executionContext() const OVERRIDE; 63 virtual ExecutionContext* executionContext() const OVERRIDE;
64 64
65 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); 65 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack);
66 DEFINE_ATTRIBUTE_EVENT_LISTENER(change);
67 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack);
66 68
67 void clearOwner() { m_owner = 0; } 69 void clearOwner() { m_owner = 0; }
68 Node* owner() const; 70 Node* owner() const;
69 71
70 bool isFiringEventListeners() { return m_dispatchingEvents; } 72 bool isFiringEventListeners() { return m_dispatchingEvents; }
71 73
74 void scheduleChangeEvent();
75
72 private: 76 private:
73 explicit TextTrackList(HTMLMediaElement*); 77 explicit TextTrackList(HTMLMediaElement*);
74 78
75 void scheduleAddTrackEvent(PassRefPtr<TextTrack>); 79 void scheduleAddTrackEvent(PassRefPtr<TextTrack>);
80 void scheduleRemoveTrackEvent(PassRefPtr<TextTrack>);
76 void asyncEventTimerFired(Timer<TextTrackList>*); 81 void asyncEventTimerFired(Timer<TextTrackList>*);
77 82
78 void invalidateTrackIndexesAfterTrack(TextTrack*); 83 void invalidateTrackIndexesAfterTrack(TextTrack*);
79 84
80 HTMLMediaElement* m_owner; 85 HTMLMediaElement* m_owner;
81 86
82 Vector<RefPtr<Event> > m_pendingEvents; 87 Vector<RefPtr<Event> > m_pendingEvents;
83 Timer<TextTrackList> m_pendingEventTimer; 88 Timer<TextTrackList> m_pendingEventTimer;
84 89
85 Vector<RefPtr<TextTrack> > m_addTrackTracks; 90 Vector<RefPtr<TextTrack> > m_addTrackTracks;
86 Vector<RefPtr<TextTrack> > m_elementTracks; 91 Vector<RefPtr<TextTrack> > m_elementTracks;
87 Vector<RefPtr<TextTrack> > m_inbandTracks; 92 Vector<RefPtr<TextTrack> > m_inbandTracks;
88 93
89 int m_dispatchingEvents; 94 int m_dispatchingEvents;
90 }; 95 };
91 96
92 } // namespace WebCore 97 } // namespace WebCore
93 98
94 #endif 99 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698