Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1218)

Unified Diff: Source/modules/mediasource/TrackDefaultList.h

Issue 702583002: MSE: Implement TrackDefaultList object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@WIP_blink_trackdefaults_and_add_tracks_to_init_segment_processing
Patch Set: Implementation for realz Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/mediasource/TrackDefaultList.h
diff --git a/Source/modules/mediasource/TrackDefaultList.h b/Source/modules/mediasource/TrackDefaultList.h
new file mode 100644
index 0000000000000000000000000000000000000000..fe2d636a534c3f2225213cf878476b879c549ed4
--- /dev/null
+++ b/Source/modules/mediasource/TrackDefaultList.h
@@ -0,0 +1,48 @@
+// 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 TrackDefaultList_h
+#define TrackDefaultList_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "modules/mediasource/TrackDefault.h"
+#include "platform/heap/Handle.h"
+#include "wtf/text/AtomicStringHash.h"
+#include "wtf/text/StringHash.h"
+
+namespace blink {
+
+class ExceptionState;
+
+class TrackDefaultList final : public GarbageCollectedFinalized<TrackDefaultList>, public ScriptWrappable {
sof 2014/12/03 19:15:40 This can be a non-finalized class; have it derive
wolenetz 2014/12/11 23:52:39 Done.
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static TrackDefaultList* create(const HeapVector<Member<TrackDefault>>& trackDefaults, ExceptionState& exceptionState)
+ {
+ return new TrackDefaultList(trackDefaults, exceptionState);
+ }
+
+ virtual ~TrackDefaultList() { }
+
+ // Implement the IDL
+ unsigned length() const { return m_trackDefaults.size(); }
+ TrackDefault* item(unsigned) const;
+
+ void trace(Visitor*);
+
+private:
+ TrackDefaultList(const HeapVector<Member<TrackDefault>>&, ExceptionState&);
+
+ HeapVector<Member<TrackDefault>> m_trackDefaults;
+
+ // HashMapped index of |m_trackDefaults| for lookup by unique <type,
+ // byteStreamTrackID>.
+ typedef std::pair<AtomicString, String> TypeAndID;
+ typedef HeapHashMap<TypeAndID, Member<TrackDefault>> TypeAndIDToTrackDefaultMap;
+ TypeAndIDToTrackDefaultMap m_typeAndIDToTrackDefaultMap;
+};
+
+} // namespace blink
+
+#endif // TrackDefaultList_h

Powered by Google App Engine
This is Rietveld 408576698