| 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/BodyStreamBuffer.h" | 5 #include "modules/fetch/BodyStreamBuffer.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptState.h" | 7 #include "bindings/core/v8/ScriptState.h" |
| 8 #include "bindings/core/v8/V8HiddenValue.h" | 8 #include "bindings/core/v8/V8HiddenValue.h" |
| 9 #include "core/dom/DOMArrayBuffer.h" | 9 #include "core/dom/DOMArrayBuffer.h" |
| 10 #include "core/dom/DOMTypedArray.h" | 10 #include "core/dom/DOMTypedArray.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 if (isStreamReadable()) { | 300 if (isStreamReadable()) { |
| 301 // Note that the stream cannot be "draining", because it doesn't have | 301 // Note that the stream cannot be "draining", because it doesn't have |
| 302 // the internal buffer. | 302 // the internal buffer. |
| 303 close(); | 303 close(); |
| 304 } | 304 } |
| 305 | 305 |
| 306 if (RuntimeEnabledFeatures::responseBodyWithV8ExtraStreamEnabled()) { | 306 if (RuntimeEnabledFeatures::responseBodyWithV8ExtraStreamEnabled()) { |
| 307 ScriptState::Scope scope(m_scriptState.get()); | 307 ScriptState::Scope scope(m_scriptState.get()); |
| 308 NonThrowableExceptionState exceptionState; | 308 NonThrowableExceptionState exceptionState; |
| 309 ScriptValue reader = ReadableStreamOperations::getReader(m_scriptState.g
et(), stream(), exceptionState); | 309 ScriptValue reader = ReadableStreamOperations::getReader(m_scriptState.g
et(), stream(), exceptionState); |
| 310 ReadableStreamOperations::read(m_scriptState.get(), reader); | 310 ReadableStreamOperations::defaultReaderRead(m_scriptState.get(), reader)
; |
| 311 } else { | 311 } else { |
| 312 NonThrowableExceptionState exceptionState; | 312 NonThrowableExceptionState exceptionState; |
| 313 m_stream->getBytesReader(m_scriptState->getExecutionContext(), exception
State); | 313 m_stream->getBytesReader(m_scriptState->getExecutionContext(), exception
State); |
| 314 m_stream->setIsDisturbed(); | 314 m_stream->setIsDisturbed(); |
| 315 } | 315 } |
| 316 } | 316 } |
| 317 | 317 |
| 318 void BodyStreamBuffer::close() | 318 void BodyStreamBuffer::close() |
| 319 { | 319 { |
| 320 if (RuntimeEnabledFeatures::responseBodyWithV8ExtraStreamEnabled()) | 320 if (RuntimeEnabledFeatures::responseBodyWithV8ExtraStreamEnabled()) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 378 |
| 379 void BodyStreamBuffer::stopLoading() | 379 void BodyStreamBuffer::stopLoading() |
| 380 { | 380 { |
| 381 if (!m_loader) | 381 if (!m_loader) |
| 382 return; | 382 return; |
| 383 m_loader->cancel(); | 383 m_loader->cancel(); |
| 384 m_loader = nullptr; | 384 m_loader = nullptr; |
| 385 } | 385 } |
| 386 | 386 |
| 387 } // namespace blink | 387 } // namespace blink |
| OLD | NEW |