| Index: Source/modules/encryptedmedia/MediaKeyStatusMap.h
|
| diff --git a/Source/modules/encryptedmedia/MediaKeyStatusMap.h b/Source/modules/encryptedmedia/MediaKeyStatusMap.h
|
| index 2b2fbf1792ea1f8ae91e873cdf3cc28c06f48de3..486d6e5441acfa35746dd98a67bb9024461ef209 100644
|
| --- a/Source/modules/encryptedmedia/MediaKeyStatusMap.h
|
| +++ b/Source/modules/encryptedmedia/MediaKeyStatusMap.h
|
| @@ -5,7 +5,7 @@
|
| #ifndef MediaKeyStatusMap_h
|
| #define MediaKeyStatusMap_h
|
|
|
| -#include "bindings/core/v8/Maplike.h"
|
| +#include "bindings/core/v8/Iterable.h"
|
| #include "bindings/core/v8/ScriptWrappable.h"
|
| #include "bindings/core/v8/UnionTypesCore.h"
|
| #include "core/dom/DOMArrayPiece.h"
|
| @@ -22,36 +22,37 @@ 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
|
| // String) for each entry.
|
| class MapEntry;
|
|
|
| - // As the number of keys per session should be small, the key ids and
|
| - // their status are kept in a list rather than a proper map.
|
| - typedef HeapVector<Member<MapEntry>> MapType;
|
| + // The key ids and their status are kept in a list, as order is important.
|
| + typedef HeapVector<Member<MapEntry>> MediaKeyStatusMapType;
|
|
|
| public:
|
| MediaKeyStatusMap() { }
|
|
|
| void clear();
|
| - void addEntry(WebData source, const String& status);
|
| + void addEntry(WebData keyId, const String& status);
|
| const MapEntry& at(size_t) const;
|
|
|
| // IDL attributes / methods
|
| size_t size() const { return m_entries.size(); }
|
| + bool has(const ArrayBufferOrArrayBufferView& keyId);
|
| + String get(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;
|
|
|
| - MapType m_entries;
|
| + MediaKeyStatusMapType m_entries;
|
| };
|
|
|
| } // namespace blink
|
|
|