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

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

Issue 1682423002: Remove WebWaitableEvent and replace it with WaitableEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android build Created 4 years, 10 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 8
9 namespace blink { 9 namespace blink {
10 10
11 DataConsumerHandleTestUtil::Thread::Thread(const char* name, InitializationPolic y initializationPolicy) 11 DataConsumerHandleTestUtil::Thread::Thread(const char* name, InitializationPolic y initializationPolicy)
12 : m_thread(WebThreadSupportingGC::create(name)) 12 : m_thread(WebThreadSupportingGC::create(name))
13 , m_initializationPolicy(initializationPolicy) 13 , m_initializationPolicy(initializationPolicy)
14 , m_waitableEvent(adoptPtr(Platform::current()->createWaitableEvent())) 14 , m_waitableEvent(adoptPtr(new WaitableEvent()))
15 { 15 {
16 m_thread->postTask(BLINK_FROM_HERE, new Task(threadSafeBind(&Thread::initial ize, AllowCrossThreadAccess(this)))); 16 m_thread->postTask(BLINK_FROM_HERE, new Task(threadSafeBind(&Thread::initial ize, AllowCrossThreadAccess(this))));
17 m_waitableEvent->wait(); 17 m_waitableEvent->wait();
18 } 18 }
19 19
20 DataConsumerHandleTestUtil::Thread::~Thread() 20 DataConsumerHandleTestUtil::Thread::~Thread()
21 { 21 {
22 m_thread->postTask(BLINK_FROM_HERE, new Task(threadSafeBind(&Thread::shutdow n, AllowCrossThreadAccess(this)))); 22 m_thread->postTask(BLINK_FROM_HERE, new Task(threadSafeBind(&Thread::shutdow n, AllowCrossThreadAccess(this))));
23 m_waitableEvent->wait(); 23 m_waitableEvent->wait();
24 } 24 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 consume(readSize); 158 consume(readSize);
159 return Ok; 159 return Ok;
160 } 160 }
161 161
162 DataConsumerHandleTestUtil::ReplayingHandle::Context::Context() 162 DataConsumerHandleTestUtil::ReplayingHandle::Context::Context()
163 : m_offset(0) 163 : m_offset(0)
164 , m_readerThread(nullptr) 164 , m_readerThread(nullptr)
165 , m_client(nullptr) 165 , m_client(nullptr)
166 , m_result(ShouldWait) 166 , m_result(ShouldWait)
167 , m_isHandleAttached(true) 167 , m_isHandleAttached(true)
168 , m_detached(adoptPtr(Platform::current()->createWaitableEvent())) 168 , m_detached(adoptPtr(new WaitableEvent()))
169 { 169 {
170 } 170 }
171 171
172 const DataConsumerHandleTestUtil::Command& DataConsumerHandleTestUtil::Replaying Handle::Context::top() 172 const DataConsumerHandleTestUtil::Command& DataConsumerHandleTestUtil::Replaying Handle::Context::top()
173 { 173 {
174 ASSERT(!isEmpty()); 174 ASSERT(!isEmpty());
175 return m_commands.first(); 175 return m_commands.first();
176 } 176 }
177 177
178 void DataConsumerHandleTestUtil::ReplayingHandle::Context::consume(size_t size) 178 void DataConsumerHandleTestUtil::ReplayingHandle::Context::consume(size_t size)
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 m_reader = nullptr; 288 m_reader = nullptr;
289 } 289 }
290 290
291 void DataConsumerHandleTestUtil::HandleTwoPhaseReader::runOnFinishedReading(Pass OwnPtr<HandleReadResult> result) 291 void DataConsumerHandleTestUtil::HandleTwoPhaseReader::runOnFinishedReading(Pass OwnPtr<HandleReadResult> result)
292 { 292 {
293 ASSERT(m_onFinishedReading); 293 ASSERT(m_onFinishedReading);
294 (*m_onFinishedReading.release())(result); 294 (*m_onFinishedReading.release())(result);
295 } 295 }
296 296
297 } // namespace blink 297 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698