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

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

Issue 2269953004: Implment BytesConsumer::tee (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 3 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
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 "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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 159 }
160 return nullptr; 160 return nullptr;
161 } 161 }
162 162
163 void BodyStreamBuffer::startLoading(FetchDataLoader* loader, FetchDataLoader::Cl ient* client) 163 void BodyStreamBuffer::startLoading(FetchDataLoader* loader, FetchDataLoader::Cl ient* client)
164 { 164 {
165 ASSERT(!m_loader); 165 ASSERT(!m_loader);
166 ASSERT(m_scriptState->contextIsValid()); 166 ASSERT(m_scriptState->contextIsValid());
167 std::unique_ptr<FetchDataConsumerHandle> handle = releaseHandle(); 167 std::unique_ptr<FetchDataConsumerHandle> handle = releaseHandle();
168 m_loader = loader; 168 m_loader = loader;
169 loader->start(new BytesConsumerForDataConsumerHandle(std::move(handle)), new LoaderClient(m_scriptState->getExecutionContext(), this, client)); 169 loader->start(new BytesConsumerForDataConsumerHandle(getExecutionContext(), std::move(handle)), new LoaderClient(m_scriptState->getExecutionContext(), this, client));
170 } 170 }
171 171
172 void BodyStreamBuffer::tee(BodyStreamBuffer** branch1, BodyStreamBuffer** branch 2) 172 void BodyStreamBuffer::tee(BodyStreamBuffer** branch1, BodyStreamBuffer** branch 2)
173 { 173 {
174 DCHECK(!isStreamLocked()); 174 DCHECK(!isStreamLocked());
175 DCHECK(!isStreamDisturbed()); 175 DCHECK(!isStreamDisturbed());
176 *branch1 = nullptr; 176 *branch1 = nullptr;
177 *branch2 = nullptr; 177 *branch2 = nullptr;
178 178
179 if (m_madeFromReadableStream) { 179 if (m_madeFromReadableStream) {
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 return createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumer Handle()); 387 return createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumer Handle());
388 } 388 }
389 if (isErrored) 389 if (isErrored)
390 return createFetchDataConsumerHandleFromWebHandle(createUnexpectedErrorD ataConsumerHandle()); 390 return createFetchDataConsumerHandleFromWebHandle(createUnexpectedErrorD ataConsumerHandle());
391 391
392 DCHECK(handle); 392 DCHECK(handle);
393 return handle; 393 return handle;
394 } 394 }
395 395
396 } // namespace blink 396 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/BUILD.gn ('k') | third_party/WebKit/Source/modules/fetch/BytesConsumer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698