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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.cpp

Issue 2749753002: Migrate WTF::Deque::removeFirst() to ::pop_front() (Closed)
Patch Set: Created 3 years, 9 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/fetch/DataConsumerHandleTestUtil.h" 5 #include "modules/fetch/DataConsumerHandleTestUtil.h"
6 6
7 #include "bindings/core/v8/DOMWrapperWorld.h" 7 #include "bindings/core/v8/DOMWrapperWorld.h"
8 #include "public/platform/WebScheduler.h" 8 #include "public/platform/WebScheduler.h"
9 #include "wtf/PtrUtil.h" 9 #include "wtf/PtrUtil.h"
10 #include <memory> 10 #include <memory>
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 return m_commands.first(); 210 return m_commands.first();
211 } 211 }
212 212
213 void DataConsumerHandleTestUtil::ReplayingHandle::Context::consume( 213 void DataConsumerHandleTestUtil::ReplayingHandle::Context::consume(
214 size_t size) { 214 size_t size) {
215 DCHECK(!isEmpty()); 215 DCHECK(!isEmpty());
216 DCHECK(size + m_offset <= top().body().size()); 216 DCHECK(size + m_offset <= top().body().size());
217 bool fullyConsumed = (size + m_offset >= top().body().size()); 217 bool fullyConsumed = (size + m_offset >= top().body().size());
218 if (fullyConsumed) { 218 if (fullyConsumed) {
219 m_offset = 0; 219 m_offset = 0;
220 m_commands.removeFirst(); 220 m_commands.pop_front();
221 } else { 221 } else {
222 m_offset += size; 222 m_offset += size;
223 } 223 }
224 } 224 }
225 225
226 void DataConsumerHandleTestUtil::ReplayingHandle::Context::notify() { 226 void DataConsumerHandleTestUtil::ReplayingHandle::Context::notify() {
227 if (!m_client) 227 if (!m_client)
228 return; 228 return;
229 DCHECK(m_readerThread); 229 DCHECK(m_readerThread);
230 m_readerThread->getWebTaskRunner()->postTask( 230 m_readerThread->getWebTaskRunner()->postTask(
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 std::move(m_onFinishedReading)); 336 std::move(m_onFinishedReading));
337 (*onFinishedReading)(std::move(result)); 337 (*onFinishedReading)(std::move(result));
338 } 338 }
339 339
340 std::unique_ptr<WebDataConsumerHandle> 340 std::unique_ptr<WebDataConsumerHandle>
341 DataConsumerHandleTestUtil::createWaitingDataConsumerHandle() { 341 DataConsumerHandleTestUtil::createWaitingDataConsumerHandle() {
342 return WTF::wrapUnique(new WaitingHandle); 342 return WTF::wrapUnique(new WaitingHandle);
343 } 343 }
344 344
345 } // namespace blink 345 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698