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 AudioTrackList::~AudioTrackList() | |
| 14 { | |
| 15 } | |
| 16 | |
| 17 AudioTrackList::AudioTrackList(HTMLMediaElement* owner) | |
| 18 : TrackBaseList(owner) | |
| 19 { | |
| 20 ScriptWrappable::init(this); | |
| 21 } | |
| 22 | |
| 23 AudioTrack* AudioTrackList::anonymousIndexedGetter(unsigned index) const | |
| 24 { | |
| 25 return static_cast<AudioTrack*>(getByIndex(index)); | |
| 26 } | |
| 27 | |
| 28 AudioTrack* AudioTrackList::getTrackById(const AtomicString& id) const | |
| 29 { | |
| 30 return static_cast<AudioTrack*>(getById(id)); | |
| 31 } | |
| 32 | |
| 33 bool AudioTrackList::hasEnabledTrack() const | |
| 34 { | |
| 35 for (unsigned i = 0; i < length(); ++i) { | |
| 36 if (anonymousIndexedGetter(i)->enabled()) | |
| 37 return true; | |
| 38 } | |
| 39 | |
| 40 return false; | |
| 41 } | |
| 42 | |
| 43 const AtomicString& AudioTrackList::interfaceName() const | |
| 44 { | |
| 45 return EventTargetNames::AudioTrackList; | |
| 46 } | |
| 47 | |
| 48 ExecutionContext* AudioTrackList::executionContext() const | |
| 49 { | |
| 50 return owner()->executionContext(); | |
|
fs
2014/02/24 10:32:36
I think owner() can end up being NULL here. I imag
acolwell GONE FROM CHROMIUM
2014/03/07 22:08:43
Fixed. ActiveDOMObject takes care of this now.
| |
| 51 } | |
| 52 | |
| 53 void AudioTrackList::trackEnabled(const AtomicString& id, bool enabled) | |
| 54 { | |
| 55 if (owner()) | |
| 56 owner()->didEnabledAudioTrackChange(id, enabled); | |
| 57 | |
| 58 scheduleChangeEvent(); | |
| 59 } | |
| 60 | |
| 61 } | |
| OLD | NEW |