| 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 "config.h" | 5 #include "config.h" |
| 6 #include "modules/fetch/CompositeDataConsumerHandle.h" | 6 #include "modules/fetch/CompositeDataConsumerHandle.h" |
| 7 | 7 |
| 8 #include "platform/Task.h" | 8 #include "platform/Task.h" |
| 9 #include "platform/ThreadSafeFunctional.h" | 9 #include "platform/ThreadSafeFunctional.h" |
| 10 #include "public/platform/Platform.h" | 10 #include "public/platform/Platform.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // We are waiting for the two-phase read completion. | 134 // We are waiting for the two-phase read completion. |
| 135 m_isUpdateWaitingForEndRead = true; | 135 m_isUpdateWaitingForEndRead = true; |
| 136 return; | 136 return; |
| 137 } | 137 } |
| 138 // Unregister the old one, then register the new one. | 138 // Unregister the old one, then register the new one. |
| 139 m_reader = nullptr; | 139 m_reader = nullptr; |
| 140 m_reader = m_handle->obtainReader(m_client); | 140 m_reader = m_handle->obtainReader(m_client); |
| 141 return; | 141 return; |
| 142 } | 142 } |
| 143 ++m_token; | 143 ++m_token; |
| 144 m_readerThread->postTask(FROM_HERE, new Task(threadSafeBind(&Context::up
dateReader, this, m_token))); | 144 m_readerThread->taskRunner()->postTask(FROM_HERE, new Task(threadSafeBin
d(&Context::updateReader, this, m_token))); |
| 145 } | 145 } |
| 146 | 146 |
| 147 OwnPtr<Reader> m_reader; | 147 OwnPtr<Reader> m_reader; |
| 148 OwnPtr<WebDataConsumerHandle> m_handle; | 148 OwnPtr<WebDataConsumerHandle> m_handle; |
| 149 // Note: Holding a WebThread raw pointer is not generally safe, but we can | 149 // Note: Holding a WebThread raw pointer is not generally safe, but we can |
| 150 // do that in this case because: | 150 // do that in this case because: |
| 151 // 1. Destructing a ReaderImpl when the bound thread ends is a user's | 151 // 1. Destructing a ReaderImpl when the bound thread ends is a user's |
| 152 // responsibility. | 152 // responsibility. |
| 153 // 2. |m_readerThread| will never be used after the associated reader is | 153 // 2. |m_readerThread| will never be used after the associated reader is |
| 154 // detached. | 154 // detached. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 } | 207 } |
| 208 | 208 |
| 209 CompositeDataConsumerHandle::~CompositeDataConsumerHandle() { } | 209 CompositeDataConsumerHandle::~CompositeDataConsumerHandle() { } |
| 210 | 210 |
| 211 WebDataConsumerHandle::Reader* CompositeDataConsumerHandle::obtainReaderInternal
(Client* client) | 211 WebDataConsumerHandle::Reader* CompositeDataConsumerHandle::obtainReaderInternal
(Client* client) |
| 212 { | 212 { |
| 213 return m_context->obtainReader(client).leakPtr(); | 213 return m_context->obtainReader(client).leakPtr(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 } // namespace blink | 216 } // namespace blink |
| OLD | NEW |