| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/BytesConsumerForDataConsumerHandle.h" | 5 #include "modules/fetch/BytesConsumerForDataConsumerHandle.h" |
| 6 | 6 |
| 7 #include "core/dom/ExecutionContext.h" | 7 #include "core/dom/ExecutionContext.h" |
| 8 #include "core/dom/TaskRunnerHelper.h" | 8 #include "core/dom/TaskRunnerHelper.h" |
| 9 #include "platform/WebTaskRunner.h" | 9 #include "platform/WebTaskRunner.h" |
| 10 #include "platform/wtf/Functional.h" | 10 #include "platform/wtf/Functional.h" |
| 11 #include "public/platform/WebTraceLocation.h" | 11 #include "public/platform/WebTraceLocation.h" |
| 12 | 12 |
| 13 #include <string.h> |
| 13 #include <algorithm> | 14 #include <algorithm> |
| 14 #include <string.h> | |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 BytesConsumerForDataConsumerHandle::BytesConsumerForDataConsumerHandle( | 18 BytesConsumerForDataConsumerHandle::BytesConsumerForDataConsumerHandle( |
| 19 ExecutionContext* execution_context, | 19 ExecutionContext* execution_context, |
| 20 std::unique_ptr<WebDataConsumerHandle> handle) | 20 std::unique_ptr<WebDataConsumerHandle> handle) |
| 21 : execution_context_(execution_context), | 21 : execution_context_(execution_context), |
| 22 reader_(handle->ObtainReader(this)) {} | 22 reader_(handle->ObtainReader(this)) {} |
| 23 | 23 |
| 24 BytesConsumerForDataConsumerHandle::~BytesConsumerForDataConsumerHandle() {} | 24 BytesConsumerForDataConsumerHandle::~BytesConsumerForDataConsumerHandle() {} |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 ClearClient(); | 168 ClearClient(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void BytesConsumerForDataConsumerHandle::Notify() { | 171 void BytesConsumerForDataConsumerHandle::Notify() { |
| 172 if (state_ == InternalState::kClosed || state_ == InternalState::kErrored) | 172 if (state_ == InternalState::kClosed || state_ == InternalState::kErrored) |
| 173 return; | 173 return; |
| 174 DidGetReadable(); | 174 DidGetReadable(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 } // namespace blink | 177 } // namespace blink |
| OLD | NEW |