| 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 "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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 return m_context->endRead(readSize); | 113 return m_context->endRead(readSize); |
| 114 } | 114 } |
| 115 | 115 |
| 116 private: | 116 private: |
| 117 RefPtr<Context> m_context; | 117 RefPtr<Context> m_context; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 void DataConsumerHandleTestUtil::ReplayingHandle::Context::add( | 120 void DataConsumerHandleTestUtil::ReplayingHandle::Context::add( |
| 121 const Command& command) { | 121 const Command& command) { |
| 122 MutexLocker locker(m_mutex); | 122 MutexLocker locker(m_mutex); |
| 123 m_commands.append(command); | 123 m_commands.push_back(command); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void DataConsumerHandleTestUtil::ReplayingHandle::Context::attachReader( | 126 void DataConsumerHandleTestUtil::ReplayingHandle::Context::attachReader( |
| 127 WebDataConsumerHandle::Client* client) { | 127 WebDataConsumerHandle::Client* client) { |
| 128 MutexLocker locker(m_mutex); | 128 MutexLocker locker(m_mutex); |
| 129 DCHECK(!m_readerThread); | 129 DCHECK(!m_readerThread); |
| 130 DCHECK(!m_client); | 130 DCHECK(!m_client); |
| 131 m_readerThread = Platform::current()->currentThread(); | 131 m_readerThread = Platform::current()->currentThread(); |
| 132 m_client = client; | 132 m_client = client; |
| 133 | 133 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |