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

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

Issue 1506023003: Response construction with a ReadableStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
OLDNEW
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 "config.h" 5 #include "config.h"
6 #include "modules/fetch/BodyStreamBuffer.h" 6 #include "modules/fetch/BodyStreamBuffer.h"
7 7
8 #include "core/dom/DOMArrayBuffer.h" 8 #include "core/dom/DOMArrayBuffer.h"
9 #include "core/dom/DOMTypedArray.h" 9 #include "core/dom/DOMTypedArray.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 OwnPtr<FetchDataConsumerHandle> handle = releaseHandle(executionContext); 138 OwnPtr<FetchDataConsumerHandle> handle = releaseHandle(executionContext);
139 m_loader = loader; 139 m_loader = loader;
140 loader->start(handle.get(), new LoaderClient(executionContext, this, client) ); 140 loader->start(handle.get(), new LoaderClient(executionContext, this, client) );
141 } 141 }
142 142
143 bool BodyStreamBuffer::hasPendingActivity() const 143 bool BodyStreamBuffer::hasPendingActivity() const
144 { 144 {
145 return m_loader || (m_stream->isLocked() && m_stream->stateInternal() == Rea dableStream::Readable); 145 return m_loader || (m_stream->isLocked() && m_stream->stateInternal() == Rea dableStream::Readable);
146 } 146 }
147 147
148 void BodyStreamBuffer::stop()
149 {
150 m_reader = nullptr;
151 m_handle = nullptr;
152 }
153
148 void BodyStreamBuffer::pullSource() 154 void BodyStreamBuffer::pullSource()
149 { 155 {
150 ASSERT(!m_streamNeedsMore); 156 ASSERT(!m_streamNeedsMore);
151 m_streamNeedsMore = true; 157 m_streamNeedsMore = true;
152 processData(); 158 processData();
153 } 159 }
154 160
155 ScriptPromise BodyStreamBuffer::cancelSource(ScriptState* scriptState, ScriptVal ue) 161 ScriptPromise BodyStreamBuffer::cancelSource(ScriptState* scriptState, ScriptVal ue)
156 { 162 {
157 close(); 163 close();
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 242
237 void BodyStreamBuffer::stopLoading() 243 void BodyStreamBuffer::stopLoading()
238 { 244 {
239 if (!m_loader) 245 if (!m_loader)
240 return; 246 return;
241 m_loader->cancel(); 247 m_loader->cancel();
242 m_loader = nullptr; 248 m_loader = nullptr;
243 } 249 }
244 250
245 } // namespace blink 251 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698