| 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 #include "wtf/PtrUtil.h" | 8 #include "wtf/PtrUtil.h" |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 } else { | 188 } else { |
| 189 m_offset += size; | 189 m_offset += size; |
| 190 } | 190 } |
| 191 } | 191 } |
| 192 | 192 |
| 193 void DataConsumerHandleTestUtil::ReplayingHandle::Context::notify() | 193 void DataConsumerHandleTestUtil::ReplayingHandle::Context::notify() |
| 194 { | 194 { |
| 195 if (!m_client) | 195 if (!m_client) |
| 196 return; | 196 return; |
| 197 ASSERT(m_readerThread); | 197 ASSERT(m_readerThread); |
| 198 m_readerThread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind
(&Context::notifyInternal, this)); | 198 m_readerThread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind
(&Context::notifyInternal, wrapPassRefPtr(this))); |
| 199 } | 199 } |
| 200 | 200 |
| 201 void DataConsumerHandleTestUtil::ReplayingHandle::Context::notifyInternal() | 201 void DataConsumerHandleTestUtil::ReplayingHandle::Context::notifyInternal() |
| 202 { | 202 { |
| 203 { | 203 { |
| 204 MutexLocker locker(m_mutex); | 204 MutexLocker locker(m_mutex); |
| 205 if (!m_client || !m_readerThread->isCurrentThread()) { | 205 if (!m_client || !m_readerThread->isCurrentThread()) { |
| 206 // There is no client, or a new reader is attached. | 206 // There is no client, or a new reader is attached. |
| 207 return; | 207 return; |
| 208 } | 208 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } | 292 } |
| 293 | 293 |
| 294 void DataConsumerHandleTestUtil::HandleTwoPhaseReader::runOnFinishedReading(std:
:unique_ptr<HandleReadResult> result) | 294 void DataConsumerHandleTestUtil::HandleTwoPhaseReader::runOnFinishedReading(std:
:unique_ptr<HandleReadResult> result) |
| 295 { | 295 { |
| 296 ASSERT(m_onFinishedReading); | 296 ASSERT(m_onFinishedReading); |
| 297 std::unique_ptr<OnFinishedReading> onFinishedReading(std::move(m_onFinishedR
eading)); | 297 std::unique_ptr<OnFinishedReading> onFinishedReading(std::move(m_onFinishedR
eading)); |
| 298 (*onFinishedReading)(std::move(result)); | 298 (*onFinishedReading)(std::move(result)); |
| 299 } | 299 } |
| 300 | 300 |
| 301 } // namespace blink | 301 } // namespace blink |
| OLD | NEW |