Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 } | |
| OLD | NEW |