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

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/MediaKeyStatusMap.h

Issue 1237343004: Convert MediaKeyStatusMap to iterable<BufferSource,MediaKeyStatus> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: return any Created 4 years, 6 months 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: third_party/WebKit/Source/modules/encryptedmedia/MediaKeyStatusMap.h
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyStatusMap.h b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyStatusMap.h
index 0bedc3ea9f21f823a91643199c2ecbf10db7999b..a4ad6f5ca64927f8cfce18a3ea1fda84a36717de 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyStatusMap.h
+++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyStatusMap.h
@@ -5,7 +5,8 @@
#ifndef MediaKeyStatusMap_h
#define MediaKeyStatusMap_h
-#include "bindings/core/v8/Maplike.h"
+#include "bindings/core/v8/Iterable.h"
+#include "bindings/core/v8/ScriptValue.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/dom/DOMArrayPiece.h"
#include "platform/heap/Heap.h"
@@ -21,7 +22,7 @@ class WebData;
// status known to a particular session. Since it can be updated any time there
// is a keychange event, iteration order and completeness is not guaranteed
// if the event loop runs.
-class MediaKeyStatusMap final : public GarbageCollected<MediaKeyStatusMap>, public ScriptWrappable, public Maplike<ArrayBufferOrArrayBufferView, String> {
+class MediaKeyStatusMap final : public GarbageCollected<MediaKeyStatusMap>, public ScriptWrappable, public PairIterable<ArrayBufferOrArrayBufferView, String> {
DEFINE_WRAPPERTYPEINFO();
private:
// MapEntry holds the keyId (DOMArrayBuffer) and status (MediaKeyStatus as
@@ -41,14 +42,16 @@ public:
// IDL attributes / methods
size_t size() const { return m_entries.size(); }
+ bool has(const ArrayBufferOrArrayBufferView& keyId);
+ ScriptValue get(ScriptState*, const ArrayBufferOrArrayBufferView& keyId);
DECLARE_VIRTUAL_TRACE();
private:
+ // PairIterable<> implementation.
IterationSource* startIteration(ScriptState*, ExceptionState&) override;
- bool getMapEntry(ScriptState*, const ArrayBufferOrArrayBufferView&, String&, ExceptionState&) override;
- size_t indexOf(const DOMArrayPiece& key) const;
+ size_t indexOf(const DOMArrayPiece& keyId) const;
MediaKeyStatusMapType m_entries;
};

Powered by Google App Engine
This is Rietveld 408576698