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

Side by Side Diff: Source/core/html/track/AudioTrackList.cpp

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 #include "config.h"
6 #include "core/html/track/AudioTrackList.h"
7
8 #include "core/html/HTMLMediaElement.h"
9 #include "core/html/track/AudioTrack.h"
10
11 namespace WebCore {
12
13 PassRefPtrWillBeRawPtr<AudioTrackList> AudioTrackList::create(HTMLMediaElement* mediaElement)
14 {
15 RefPtrWillBeRawPtr<AudioTrackList> trackList(adoptRefWillBeRefCountedGarbage Collected(new AudioTrackList(mediaElement)));
16 trackList->suspendIfNeeded();
philipj_slow 2014/03/09 09:04:14 Does TextTrackList::create need this as well? If t
acolwell GONE FROM CHROMIUM 2014/03/18 22:02:15 This is only needed because the XXTrackLists are A
philipj_slow 2014/03/20 16:17:39 Yep, it's gone now. (Commenting to tell which issu
17 return trackList.release();
18 }
19
20 AudioTrackList::~AudioTrackList()
21 {
22 }
23
24 AudioTrackList::AudioTrackList(HTMLMediaElement* mediaElement)
25 : TrackBaseList(mediaElement)
26 {
27 ScriptWrappable::init(this);
28 }
29
30 AudioTrack* AudioTrackList::anonymousIndexedGetter(unsigned index) const
31 {
32 return static_cast<AudioTrack*>(getByIndex(index));
33 }
34
35 AudioTrack* AudioTrackList::getTrackById(const AtomicString& id) const
36 {
37 return static_cast<AudioTrack*>(getById(id));
38 }
39
40 bool AudioTrackList::hasEnabledTrack() const
41 {
42 for (unsigned i = 0; i < length(); ++i) {
43 if (anonymousIndexedGetter(i)->enabled())
44 return true;
45 }
46
47 return false;
48 }
49
50 const AtomicString& AudioTrackList::interfaceName() const
51 {
52 return EventTargetNames::AudioTrackList;
53 }
54
55 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698