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/ReadableStreamBytesConsumer.h" | 5 #include "modules/fetch/ReadableStreamBytesConsumer.h" |
6 | 6 |
| 7 #include <string.h> |
| 8 #include <v8.h> |
| 9 #include <algorithm> |
7 #include "bindings/core/v8/ScopedPersistent.h" | 10 #include "bindings/core/v8/ScopedPersistent.h" |
8 #include "bindings/core/v8/ScriptFunction.h" | 11 #include "bindings/core/v8/ScriptFunction.h" |
9 #include "bindings/core/v8/ScriptState.h" | 12 #include "bindings/core/v8/ScriptState.h" |
10 #include "bindings/core/v8/ScriptValue.h" | 13 #include "bindings/core/v8/ScriptValue.h" |
11 #include "bindings/core/v8/V8BindingMacros.h" | 14 #include "bindings/core/v8/V8BindingMacros.h" |
12 #include "bindings/core/v8/V8IteratorResultValue.h" | 15 #include "bindings/core/v8/V8IteratorResultValue.h" |
13 #include "bindings/core/v8/V8Uint8Array.h" | 16 #include "bindings/core/v8/V8Uint8Array.h" |
14 #include "core/streams/ReadableStreamOperations.h" | 17 #include "core/streams/ReadableStreamOperations.h" |
15 #include "wtf/Assertions.h" | 18 #include "wtf/Assertions.h" |
16 #include "wtf/text/WTFString.h" | 19 #include "wtf/text/WTFString.h" |
17 #include <algorithm> | |
18 #include <string.h> | |
19 #include <v8.h> | |
20 | 20 |
21 namespace blink { | 21 namespace blink { |
22 | 22 |
23 class ReadableStreamBytesConsumer::OnFulfilled final : public ScriptFunction { | 23 class ReadableStreamBytesConsumer::OnFulfilled final : public ScriptFunction { |
24 public: | 24 public: |
25 static v8::Local<v8::Function> createFunction( | 25 static v8::Local<v8::Function> createFunction( |
26 ScriptState* scriptState, | 26 ScriptState* scriptState, |
27 ReadableStreamBytesConsumer* consumer) { | 27 ReadableStreamBytesConsumer* consumer) { |
28 return (new OnFulfilled(scriptState, consumer))->bindToV8Function(); | 28 return (new OnFulfilled(scriptState, consumer))->bindToV8Function(); |
29 } | 29 } |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 DCHECK_EQ(m_state, PublicState::ReadableOrWaiting); | 210 DCHECK_EQ(m_state, PublicState::ReadableOrWaiting); |
211 m_state = PublicState::Errored; | 211 m_state = PublicState::Errored; |
212 m_reader.clear(); | 212 m_reader.clear(); |
213 Client* client = m_client; | 213 Client* client = m_client; |
214 clearClient(); | 214 clearClient(); |
215 if (client) | 215 if (client) |
216 client->onStateChange(); | 216 client->onStateChange(); |
217 } | 217 } |
218 | 218 |
219 } // namespace blink | 219 } // namespace blink |
OLD | NEW |