Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Side by Side Diff: third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandle.cpp

Issue 1902673003: Reflect recent spec changes to V8 Extra ReadableStream impl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "modules/fetch/ReadableStreamDataConsumerHandle.h" 5 #include "modules/fetch/ReadableStreamDataConsumerHandle.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScopedPersistent.h" 8 #include "bindings/core/v8/ScopedPersistent.h"
9 #include "bindings/core/v8/ScriptFunction.h" 9 #include "bindings/core/v8/ScriptFunction.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (!m_isReading) { 152 if (!m_isReading) {
153 m_isReading = true; 153 m_isReading = true;
154 ScriptState::Scope scope(m_scriptState.get()); 154 ScriptState::Scope scope(m_scriptState.get());
155 ScriptValue reader(m_scriptState.get(), m_reader.newLocal(m_scriptSt ate->isolate())); 155 ScriptValue reader(m_scriptState.get(), m_reader.newLocal(m_scriptSt ate->isolate()));
156 if (reader.isEmpty()) { 156 if (reader.isEmpty()) {
157 // The reader was collected. 157 // The reader was collected.
158 m_hasError = true; 158 m_hasError = true;
159 m_isReading = false; 159 m_isReading = false;
160 return WebDataConsumerHandle::UnexpectedError; 160 return WebDataConsumerHandle::UnexpectedError;
161 } 161 }
162 ReadableStreamOperations::read(m_scriptState.get(), reader).then( 162 ReadableStreamOperations::defaultReaderRead(
163 OnFulfilled::createFunction(m_scriptState.get(), this), 163 m_scriptState.get(), reader).then(
164 OnRejected::createFunction(m_scriptState.get(), this)); 164 OnFulfilled::createFunction(m_scriptState.get(), this),
165 OnRejected::createFunction(m_scriptState.get(), this));
165 } 166 }
166 return WebDataConsumerHandle::ShouldWait; 167 return WebDataConsumerHandle::ShouldWait;
167 } 168 }
168 169
169 Result endRead(size_t readSize) 170 Result endRead(size_t readSize)
170 { 171 {
171 ASSERT(m_pendingBuffer); 172 ASSERT(m_pendingBuffer);
172 ASSERT(m_pendingOffset + readSize <= m_pendingBuffer->length()); 173 ASSERT(m_pendingOffset + readSize <= m_pendingBuffer->length());
173 m_pendingOffset += readSize; 174 m_pendingOffset += readSize;
174 if (m_pendingOffset == m_pendingBuffer->length()) { 175 if (m_pendingOffset == m_pendingBuffer->length()) {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 { 271 {
271 } 272 }
272 ReadableStreamDataConsumerHandle::~ReadableStreamDataConsumerHandle() = default; 273 ReadableStreamDataConsumerHandle::~ReadableStreamDataConsumerHandle() = default;
273 274
274 FetchDataConsumerHandle::Reader* ReadableStreamDataConsumerHandle::obtainReaderI nternal(Client* client) 275 FetchDataConsumerHandle::Reader* ReadableStreamDataConsumerHandle::obtainReaderI nternal(Client* client)
275 { 276 {
276 return new ReadingContext::ReaderImpl(m_readingContext, client); 277 return new ReadingContext::ReaderImpl(m_readingContext, client);
277 } 278 }
278 279
279 } // namespace blink 280 } // namespace blink
280
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698