Bug 1472338: part 2) Change `clipboard.readText()` to read from the clipboard asynchr...
[gecko.git] / dom / media / VideoTrackList.h
blobb4e04deef057968097b8a1a41f996dcedcef5678
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 et tw=78: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_VideoTrackList_h
8 #define mozilla_dom_VideoTrackList_h
10 #include "MediaTrack.h"
11 #include "MediaTrackList.h"
13 namespace mozilla {
14 namespace dom {
16 class VideoTrack;
18 class VideoTrackList : public MediaTrackList {
19 public:
20 VideoTrackList(nsIGlobalObject* aOwnerObject, HTMLMediaElement* aMediaElement)
21 : MediaTrackList(aOwnerObject, aMediaElement), mSelectedIndex(-1) {}
23 JSObject* WrapObject(JSContext* aCx,
24 JS::Handle<JSObject*> aGivenProto) override;
26 VideoTrack* operator[](uint32_t aIndex);
28 void RemoveTrack(const RefPtr<MediaTrack>& aTrack) override;
30 void EmptyTracks() override;
32 VideoTrack* GetSelectedTrack();
34 // WebIDL
35 int32_t SelectedIndex() const { return mSelectedIndex; }
37 VideoTrack* IndexedGetter(uint32_t aIndex, bool& aFound);
39 VideoTrack* GetTrackById(const nsAString& aId);
41 friend class VideoTrack;
43 protected:
44 VideoTrackList* AsVideoTrackList() override { return this; }
46 private:
47 int32_t mSelectedIndex;
50 } // namespace dom
51 } // namespace mozilla
53 #endif // mozilla_dom_VideoTrackList_h