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

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

Issue 2752593003: Migrate WTF::Deque::first() to ::front() (Closed)
Patch Set: one more platform specific reference 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 : m_offset(0), 200 : m_offset(0),
201 m_readerThread(nullptr), 201 m_readerThread(nullptr),
202 m_client(nullptr), 202 m_client(nullptr),
203 m_result(ShouldWait), 203 m_result(ShouldWait),
204 m_isHandleAttached(true), 204 m_isHandleAttached(true),
205 m_detached(WTF::makeUnique<WaitableEvent>()) {} 205 m_detached(WTF::makeUnique<WaitableEvent>()) {}
206 206
207 const DataConsumerHandleTestUtil::Command& 207 const DataConsumerHandleTestUtil::Command&
208 DataConsumerHandleTestUtil::ReplayingHandle::Context::top() { 208 DataConsumerHandleTestUtil::ReplayingHandle::Context::top() {
209 DCHECK(!isEmpty()); 209 DCHECK(!isEmpty());
210 return m_commands.first(); 210 return m_commands.front();
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.pop_front(); 220 m_commands.pop_front();
(...skipping 115 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