| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/Body.h" | 5 #include "modules/fetch/Body.h" |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 8 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
| 9 #include "bindings/core/v8/V8ArrayBuffer.h" | 10 #include "bindings/core/v8/V8ArrayBuffer.h" |
| 10 #include "bindings/core/v8/V8ThrowException.h" | 11 #include "bindings/core/v8/V8ThrowException.h" |
| 11 #include "core/dom/DOMArrayBuffer.h" | 12 #include "core/dom/DOMArrayBuffer.h" |
| 12 #include "core/dom/DOMTypedArray.h" | 13 #include "core/dom/DOMTypedArray.h" |
| 13 #include "core/fileapi/Blob.h" | 14 #include "core/fileapi/Blob.h" |
| 14 #include "modules/fetch/BodyStreamBuffer.h" | 15 #include "modules/fetch/BodyStreamBuffer.h" |
| 15 #include "modules/fetch/FetchDataLoader.h" | 16 #include "modules/fetch/FetchDataLoader.h" |
| 17 #include "platform/wtf/PassRefPtr.h" |
| 18 #include "platform/wtf/RefPtr.h" |
| 16 #include "public/platform/WebDataConsumerHandle.h" | 19 #include "public/platform/WebDataConsumerHandle.h" |
| 17 #include "wtf/PassRefPtr.h" | |
| 18 #include "wtf/RefPtr.h" | |
| 19 #include <memory> | |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 class BodyConsumerBase : public GarbageCollectedFinalized<BodyConsumerBase>, | 25 class BodyConsumerBase : public GarbageCollectedFinalized<BodyConsumerBase>, |
| 26 public FetchDataLoader::Client { | 26 public FetchDataLoader::Client { |
| 27 WTF_MAKE_NONCOPYABLE(BodyConsumerBase); | 27 WTF_MAKE_NONCOPYABLE(BodyConsumerBase); |
| 28 USING_GARBAGE_COLLECTED_MIXIN(BodyConsumerBase); | 28 USING_GARBAGE_COLLECTED_MIXIN(BodyConsumerBase); |
| 29 | 29 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 ScriptPromise Body::RejectInvalidConsumption(ScriptState* script_state) { | 227 ScriptPromise Body::RejectInvalidConsumption(ScriptState* script_state) { |
| 228 if (IsBodyLocked() || bodyUsed()) | 228 if (IsBodyLocked() || bodyUsed()) |
| 229 return ScriptPromise::Reject( | 229 return ScriptPromise::Reject( |
| 230 script_state, V8ThrowException::CreateTypeError( | 230 script_state, V8ThrowException::CreateTypeError( |
| 231 script_state->GetIsolate(), "Already read")); | 231 script_state->GetIsolate(), "Already read")); |
| 232 return ScriptPromise(); | 232 return ScriptPromise(); |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace blink | 235 } // namespace blink |
| OLD | NEW |