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

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

Issue 1851293002: Remove BLINK_ASSERT() and BLINK_ASSERT_NOT_REACHED() macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check the |callbacks| for nullptr and use explicit delete. 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // No need to do any sorting for the first entry. 119 // No need to do any sorting for the first entry.
120 if (m_entries.size() == 1) 120 if (m_entries.size() == 1)
121 return; 121 return;
122 122
123 // Sort the entries. 123 // Sort the entries.
124 std::sort(m_entries.begin(), m_entries.end(), MapEntry::compareLessThan); 124 std::sort(m_entries.begin(), m_entries.end(), MapEntry::compareLessThan);
125 } 125 }
126 126
127 const MediaKeyStatusMap::MapEntry& MediaKeyStatusMap::at(size_t index) const 127 const MediaKeyStatusMap::MapEntry& MediaKeyStatusMap::at(size_t index) const
128 { 128 {
129 BLINK_ASSERT(index < m_entries.size()); 129 DCHECK_LT(index, m_entries.size());
130 return *m_entries.at(index); 130 return *m_entries.at(index);
131 } 131 }
132 132
133 size_t MediaKeyStatusMap::indexOf(const DOMArrayPiece& key) const 133 size_t MediaKeyStatusMap::indexOf(const DOMArrayPiece& key) const
134 { 134 {
135 for (size_t index = 0; index < m_entries.size(); ++index) { 135 for (size_t index = 0; index < m_entries.size(); ++index) {
136 const auto& current = m_entries.at(index)->keyId(); 136 const auto& current = m_entries.at(index)->keyId();
137 if (key == *current) 137 if (key == *current)
138 return index; 138 return index;
139 } 139 }
(...skipping 16 matching lines...) Expand all
156 } 156 }
157 return false; 157 return false;
158 } 158 }
159 159
160 DEFINE_TRACE(MediaKeyStatusMap) 160 DEFINE_TRACE(MediaKeyStatusMap)
161 { 161 {
162 visitor->trace(m_entries); 162 visitor->trace(m_entries);
163 } 163 }
164 164
165 } // namespace blink 165 } // namespace blink
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl_unittest.cc ('k') | third_party/WebKit/Source/platform/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698