Chromium Code Reviews| Index: Source/core/html/track/AudioTrackList.cpp |
| diff --git a/Source/core/html/track/AudioTrackList.cpp b/Source/core/html/track/AudioTrackList.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..00225d03f4bf0492383b7ac65bff1c468ca8ba1c |
| --- /dev/null |
| +++ b/Source/core/html/track/AudioTrackList.cpp |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "config.h" |
| +#include "core/html/track/AudioTrackList.h" |
| + |
| +#include "core/html/HTMLMediaElement.h" |
| +#include "core/html/track/AudioTrack.h" |
| + |
| +namespace WebCore { |
| + |
| +PassRefPtrWillBeRawPtr<AudioTrackList> AudioTrackList::create(HTMLMediaElement* mediaElement) |
| +{ |
| + RefPtrWillBeRawPtr<AudioTrackList> trackList(adoptRefWillBeRefCountedGarbageCollected(new AudioTrackList(mediaElement))); |
|
sof
2014/03/13 12:19:20
RefPtr<> + adoptRef()
acolwell GONE FROM CHROMIUM
2014/03/18 22:02:15
Done.
|
| + trackList->suspendIfNeeded(); |
| + return trackList.release(); |
| +} |
| + |
| +AudioTrackList::~AudioTrackList() |
| +{ |
| +} |
| + |
| +AudioTrackList::AudioTrackList(HTMLMediaElement* mediaElement) |
| + : TrackBaseList(mediaElement) |
| +{ |
| + ScriptWrappable::init(this); |
| +} |
| + |
| +AudioTrack* AudioTrackList::anonymousIndexedGetter(unsigned index) const |
| +{ |
| + return static_cast<AudioTrack*>(getByIndex(index)); |
| +} |
| + |
| +AudioTrack* AudioTrackList::getTrackById(const AtomicString& id) const |
| +{ |
| + return static_cast<AudioTrack*>(getById(id)); |
| +} |
| + |
| +bool AudioTrackList::hasEnabledTrack() const |
| +{ |
| + for (unsigned i = 0; i < length(); ++i) { |
| + if (anonymousIndexedGetter(i)->enabled()) |
| + return true; |
| + } |
| + |
| + return false; |
| +} |
| + |
| +const AtomicString& AudioTrackList::interfaceName() const |
| +{ |
| + return EventTargetNames::AudioTrackList; |
| +} |
| + |
| +} |