OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/encryptedmedia/MediaKeyStatusMap.h" | 5 #include "modules/encryptedmedia/MediaKeyStatusMap.h" |
6 | 6 |
7 #include "core/dom/DOMArrayBuffer.h" | 7 #include "core/dom/DOMArrayBuffer.h" |
8 #include "core/dom/DOMArrayPiece.h" | 8 #include "core/dom/DOMArrayPiece.h" |
9 #include "public/platform/WebData.h" | 9 #include "public/platform/WebData.h" |
10 #include "wtf/text/WTFString.h" | 10 #include "wtf/text/WTFString.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 std::min(a->keyId()->byteLength(), b->keyId()->byteLength())); | 52 std::min(a->keyId()->byteLength(), b->keyId()->byteLength())); |
53 if (result != 0) | 53 if (result != 0) |
54 return result < 0; | 54 return result < 0; |
55 | 55 |
56 // KeyIds are equal to the shared length, so the shorter string is <. | 56 // KeyIds are equal to the shared length, so the shorter string is <. |
57 return a->keyId()->byteLength() <= b->keyId()->byteLength(); | 57 return a->keyId()->byteLength() <= b->keyId()->byteLength(); |
58 } | 58 } |
59 | 59 |
60 DEFINE_INLINE_VIRTUAL_TRACE() | 60 DEFINE_INLINE_VIRTUAL_TRACE() |
61 { | 61 { |
62 visitor->trace(m_keyId); | |
63 } | 62 } |
64 | 63 |
65 private: | 64 private: |
66 MapEntry(WebData keyId, const String& status) | 65 MapEntry(WebData keyId, const String& status) |
67 : m_keyId(DOMArrayBuffer::create(keyId.data(), keyId.size())) | 66 : m_keyId(DOMArrayBuffer::create(keyId.data(), keyId.size())) |
68 , m_status(status) | 67 , m_status(status) |
69 { | 68 { |
70 } | 69 } |
71 | 70 |
72 const Member<DOMArrayBuffer> m_keyId; | 71 RefPtr<DOMArrayBuffer> m_keyId; |
73 const String m_status; | 72 const String m_status; |
74 }; | 73 }; |
75 | 74 |
76 // Represents an Iterator that loops through the set of MapEntrys. | 75 // Represents an Iterator that loops through the set of MapEntrys. |
77 class MapIterationSource final : public PairIterable<ArrayBufferOrArrayBufferVie
w, String>::IterationSource { | 76 class MapIterationSource final : public PairIterable<ArrayBufferOrArrayBufferVie
w, String>::IterationSource { |
78 public: | 77 public: |
79 MapIterationSource(MediaKeyStatusMap* map) | 78 MapIterationSource(MediaKeyStatusMap* map) |
80 : m_map(map) | 79 : m_map(map) |
81 , m_current(0) | 80 , m_current(0) |
82 { | 81 { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 156 } |
158 return false; | 157 return false; |
159 } | 158 } |
160 | 159 |
161 DEFINE_TRACE(MediaKeyStatusMap) | 160 DEFINE_TRACE(MediaKeyStatusMap) |
162 { | 161 { |
163 visitor->trace(m_entries); | 162 visitor->trace(m_entries); |
164 } | 163 } |
165 | 164 |
166 } // namespace blink | 165 } // namespace blink |
OLD | NEW |