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

Side by Side Diff: third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp

Issue 2776203002: Migrate WTF::Vector::remove() to ::erase() (Closed)
Patch Set: rebase, repatch VectorTest Created 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/cachestorage/InspectorCacheStorageAgent.h" 5 #include "modules/cachestorage/InspectorCacheStorageAgent.h"
6 6
7 #include "platform/heap/Handle.h" 7 #include "platform/heap/Handle.h"
8 #include "platform/weborigin/KURL.h" 8 #include "platform/weborigin/KURL.h"
9 #include "platform/weborigin/SecurityOrigin.h" 9 #include "platform/weborigin/SecurityOrigin.h"
10 #include "public/platform/Platform.h" 10 #include "public/platform/Platform.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 requestResponse.response = response.statusText(); 188 requestResponse.response = response.statusText();
189 189
190 if (--m_numResponsesLeft != 0) 190 if (--m_numResponsesLeft != 0)
191 return; 191 return;
192 192
193 std::sort(m_responses.begin(), m_responses.end(), 193 std::sort(m_responses.begin(), m_responses.end(),
194 [](const RequestResponse& a, const RequestResponse& b) { 194 [](const RequestResponse& a, const RequestResponse& b) {
195 return WTF::codePointCompareLessThan(a.request, b.request); 195 return WTF::codePointCompareLessThan(a.request, b.request);
196 }); 196 });
197 if (m_params.skipCount > 0) 197 if (m_params.skipCount > 0)
198 m_responses.remove(0, m_params.skipCount); 198 m_responses.erase(0, m_params.skipCount);
199 bool hasMore = false; 199 bool hasMore = false;
200 if (static_cast<size_t>(m_params.pageSize) < m_responses.size()) { 200 if (static_cast<size_t>(m_params.pageSize) < m_responses.size()) {
201 m_responses.remove(m_params.pageSize, 201 m_responses.erase(m_params.pageSize,
202 m_responses.size() - m_params.pageSize); 202 m_responses.size() - m_params.pageSize);
203 hasMore = true; 203 hasMore = true;
204 } 204 }
205 std::unique_ptr<Array<DataEntry>> array = Array<DataEntry>::create(); 205 std::unique_ptr<Array<DataEntry>> array = Array<DataEntry>::create();
206 for (const auto& requestResponse : m_responses) { 206 for (const auto& requestResponse : m_responses) {
207 std::unique_ptr<DataEntry> entry = 207 std::unique_ptr<DataEntry> entry =
208 DataEntry::create() 208 DataEntry::create()
209 .setRequest(requestResponse.request) 209 .setRequest(requestResponse.request)
210 .setResponse(requestResponse.response) 210 .setResponse(requestResponse.response)
211 .build(); 211 .build();
212 array->addItem(std::move(entry)); 212 array->addItem(std::move(entry));
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 if (!response.isSuccess()) { 485 if (!response.isSuccess()) {
486 callback->sendFailure(response); 486 callback->sendFailure(response);
487 return; 487 return;
488 } 488 }
489 cache->dispatchOpen(WTF::makeUnique<GetCacheForDeleteEntry>( 489 cache->dispatchOpen(WTF::makeUnique<GetCacheForDeleteEntry>(
490 request, cacheName, std::move(callback)), 490 request, cacheName, std::move(callback)),
491 WebString(cacheName)); 491 WebString(cacheName));
492 } 492 }
493 493
494 } // namespace blink 494 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698