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

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

Issue 170233009: Initial implementation of AudioTrack, AudioTrackList, VideoTrack, and VideoTrackList. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@blink-master
Patch Set: Rebase Created 6 years, 9 months 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
(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 TrackBaseList_h
6 #define TrackBaseList_h
7
8 #include "core/dom/ActiveDOMObject.h"
9 #include "core/events/EventTarget.h"
10 #include "core/html/HTMLMediaElement.h"
11
12 namespace WebCore {
13
14 class GenericEventQueue;
15 class TrackBase;
16
17 class TrackBaseList : public RefCounted<TrackBaseList>, public EventTargetWithIn lineData, public ActiveDOMObject {
philipj_slow 2014/03/13 10:00:04 As per the other comment, it doesn't seem like thi
acolwell GONE FROM CHROMIUM 2014/03/18 22:02:15 Agreed. I plan on changing the code to use the eve
18 REFCOUNTED_EVENT_TARGET(TrackBaseList);
19
20 public:
21 explicit TrackBaseList(HTMLMediaElement*);
22 virtual ~TrackBaseList();
23
24 unsigned length() const { return m_tracks.size(); }
25 TrackBase* getByIndex(unsigned index) const;
26 TrackBase* getById(const AtomicString& id) const;
27 unsigned getIndex(const AtomicString& id) const;
28
29 DEFINE_ATTRIBUTE_EVENT_LISTENER(change);
30 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack);
31 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack);
32
33 // EventTarget interface
34 virtual ExecutionContext* executionContext() const OVERRIDE;
35
36 // ActiveDOMObject interface
37 virtual bool hasPendingActivity() const OVERRIDE;
38 virtual void stop() OVERRIDE;
39
40 void shutdown();
41
42 void add(TrackBase*);
43 void remove(const String& id);
philipj_slow 2014/03/13 10:00:04 Should be AtomicString as in the getters? Request
acolwell GONE FROM CHROMIUM 2014/03/18 22:02:15 You are probably right. There appeared to be a tre
44 void removeAll();
45
46 void scheduleChangeEvent();
47
48 private:
49 void scheduleTrackEvent(const AtomicString& eventName, PassRefPtr<TrackBase> );
50
51 bool m_shutdown;
52 Vector<RefPtr<TrackBase> > m_tracks;
53 OwnPtr<GenericEventQueue> m_asyncEventQueue;
54 };
55
56 }
57
58 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698