| Index: Source/core/html/track/TrackBaseList.h
|
| diff --git a/Source/core/html/track/TrackBaseList.h b/Source/core/html/track/TrackBaseList.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f83fb293d8e9d6c9b7f14c7f4b2756d9f87695ff
|
| --- /dev/null
|
| +++ b/Source/core/html/track/TrackBaseList.h
|
| @@ -0,0 +1,51 @@
|
| +// 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.
|
| +
|
| +#ifndef TrackBaseList_h
|
| +#define TrackBaseList_h
|
| +
|
| +#include "core/events/EventTarget.h"
|
| +#include "core/html/HTMLMediaElement.h"
|
| +
|
| +namespace WebCore {
|
| +
|
| +class GenericEventQueue;
|
| +class TrackBase;
|
| +
|
| +class TrackBaseList : public RefCounted<TrackBaseList>, public EventTargetWithInlineData {
|
| + REFCOUNTED_EVENT_TARGET(TrackBaseList);
|
| +
|
| +public:
|
| + TrackBaseList(HTMLMediaElement* owner);
|
| + ~TrackBaseList();
|
| +
|
| + unsigned length() const { return m_tracks.size(); }
|
| + TrackBase* getByIndex(unsigned index) const;
|
| + TrackBase* getById(const AtomicString& id) const;
|
| + unsigned getIndex(TrackBase*) const;
|
| +
|
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(change);
|
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack);
|
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack);
|
| +
|
| + void clearOwner() { m_owner = 0; }
|
| + HTMLMediaElement* owner() const { return m_owner; }
|
| +
|
| + void add(TrackBase*);
|
| + void remove(const String& id);
|
| + void removeAll();
|
| +
|
| + void scheduleChangeEvent();
|
| +
|
| +private:
|
| + void scheduleTrackEvent(const AtomicString& eventName, PassRefPtr<TrackBase>);
|
| +
|
| + HTMLMediaElement* m_owner;
|
| + Vector<RefPtr<TrackBase> > m_tracks;
|
| + OwnPtr<GenericEventQueue> m_asyncEventQueue;
|
| +};
|
| +
|
| +}
|
| +
|
| +#endif
|
|
|