| 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..2b0e1108bdacddc5f30b77ccc43f33cfbdc5536e
|
| --- /dev/null
|
| +++ b/Source/core/html/track/TrackBaseList.h
|
| @@ -0,0 +1,58 @@
|
| +// 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/dom/ActiveDOMObject.h"
|
| +#include "core/events/EventTarget.h"
|
| +#include "core/html/HTMLMediaElement.h"
|
| +
|
| +namespace WebCore {
|
| +
|
| +class GenericEventQueue;
|
| +class TrackBase;
|
| +
|
| +class TrackBaseList : public RefCounted<TrackBaseList>, public EventTargetWithInlineData, public ActiveDOMObject {
|
| + REFCOUNTED_EVENT_TARGET(TrackBaseList);
|
| +
|
| +public:
|
| + explicit TrackBaseList(HTMLMediaElement*);
|
| + virtual ~TrackBaseList();
|
| +
|
| + unsigned length() const { return m_tracks.size(); }
|
| + TrackBase* getByIndex(unsigned index) const;
|
| + TrackBase* getById(const AtomicString& id) const;
|
| + unsigned getIndex(const AtomicString& id) const;
|
| +
|
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(change);
|
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack);
|
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack);
|
| +
|
| + // EventTarget interface
|
| + virtual ExecutionContext* executionContext() const OVERRIDE;
|
| +
|
| + // ActiveDOMObject interface
|
| + virtual bool hasPendingActivity() const OVERRIDE;
|
| + virtual void stop() OVERRIDE;
|
| +
|
| + void shutdown();
|
| +
|
| + void add(TrackBase*);
|
| + void remove(const String& id);
|
| + void removeAll();
|
| +
|
| + void scheduleChangeEvent();
|
| +
|
| +private:
|
| + void scheduleTrackEvent(const AtomicString& eventName, PassRefPtr<TrackBase>);
|
| +
|
| + bool m_shutdown;
|
| + Vector<RefPtr<TrackBase> > m_tracks;
|
| + OwnPtr<GenericEventQueue> m_asyncEventQueue;
|
| +};
|
| +
|
| +}
|
| +
|
| +#endif
|
|
|