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

Side by Side Diff: third_party/WebKit/Source/modules/encryptedmedia/MediaKeyStatusMap.cpp

Issue 1878463002: Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tidy Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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
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);
62 } 63 }
63 64
64 private: 65 private:
65 MapEntry(WebData keyId, const String& status) 66 MapEntry(WebData keyId, const String& status)
66 : m_keyId(DOMArrayBuffer::create(keyId.data(), keyId.size())) 67 : m_keyId(DOMArrayBuffer::create(keyId.data(), keyId.size()))
67 , m_status(status) 68 , m_status(status)
68 { 69 {
69 } 70 }
70 71
71 RefPtr<DOMArrayBuffer> m_keyId; 72 const Member<DOMArrayBuffer> m_keyId;
72 const String m_status; 73 const String m_status;
73 }; 74 };
74 75
75 // Represents an Iterator that loops through the set of MapEntrys. 76 // Represents an Iterator that loops through the set of MapEntrys.
76 class MapIterationSource final : public PairIterable<ArrayBufferOrArrayBufferVie w, String>::IterationSource { 77 class MapIterationSource final : public PairIterable<ArrayBufferOrArrayBufferVie w, String>::IterationSource {
77 public: 78 public:
78 MapIterationSource(MediaKeyStatusMap* map) 79 MapIterationSource(MediaKeyStatusMap* map)
79 : m_map(map) 80 : m_map(map)
80 , m_current(0) 81 , m_current(0)
81 { 82 {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 157 }
157 return false; 158 return false;
158 } 159 }
159 160
160 DEFINE_TRACE(MediaKeyStatusMap) 161 DEFINE_TRACE(MediaKeyStatusMap)
161 { 162 {
162 visitor->trace(m_entries); 163 visitor->trace(m_entries);
163 } 164 }
164 165
165 } // namespace blink 166 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698