| OLD | NEW |
| 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, ThreadState::PerThreadHeapDis
abled)) |
| 13 , m_initializationPolicy(initializationPolicy) | 13 , m_initializationPolicy(initializationPolicy) |
| 14 , m_waitableEvent(adoptPtr(Platform::current()->createWaitableEvent())) | 14 , m_waitableEvent(adoptPtr(Platform::current()->createWaitableEvent())) |
| 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)))); |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 m_reader = nullptr; | 298 m_reader = nullptr; |
| 299 } | 299 } |
| 300 | 300 |
| 301 void DataConsumerHandleTestUtil::HandleTwoPhaseReader::runOnFinishedReading(Pass
OwnPtr<HandleReadResult> result) | 301 void DataConsumerHandleTestUtil::HandleTwoPhaseReader::runOnFinishedReading(Pass
OwnPtr<HandleReadResult> result) |
| 302 { | 302 { |
| 303 ASSERT(m_onFinishedReading); | 303 ASSERT(m_onFinishedReading); |
| 304 (*m_onFinishedReading.release())(result); | 304 (*m_onFinishedReading.release())(result); |
| 305 } | 305 } |
| 306 | 306 |
| 307 } // namespace blink | 307 } // namespace blink |
| OLD | NEW |