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

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

Issue 1899163002: BodyStreamBuffer's drainAs* function should lock stream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@body-stream-buffer-test-refactoring
Patch Set: Created 4 years, 8 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/FetchManager.h" 5 #include "modules/fetch/FetchManager.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/V8ThrowException.h" 10 #include "bindings/core/v8/V8ThrowException.h"
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 request.setHTTPMethod(m_request->method()); 559 request.setHTTPMethod(m_request->method());
560 request.setFetchRequestMode(m_request->mode()); 560 request.setFetchRequestMode(m_request->mode());
561 request.setFetchCredentialsMode(m_request->credentials()); 561 request.setFetchCredentialsMode(m_request->credentials());
562 const Vector<OwnPtr<FetchHeaderList::Header>>& list = m_request->headerList( )->list(); 562 const Vector<OwnPtr<FetchHeaderList::Header>>& list = m_request->headerList( )->list();
563 for (size_t i = 0; i < list.size(); ++i) { 563 for (size_t i = 0; i < list.size(); ++i) {
564 request.addHTTPHeaderField(AtomicString(list[i]->first), AtomicString(li st[i]->second)); 564 request.addHTTPHeaderField(AtomicString(list[i]->first), AtomicString(li st[i]->second));
565 } 565 }
566 566
567 if (m_request->method() != HTTPNames::GET && m_request->method() != HTTPName s::HEAD) { 567 if (m_request->method() != HTTPNames::GET && m_request->method() != HTTPName s::HEAD) {
568 if (m_request->buffer()) 568 if (m_request->buffer())
569 request.setHTTPBody(m_request->buffer()->drainAsFormData()); 569 request.setHTTPBody(m_request->buffer()->drainAsFormData(m_execution Context));
570 if (m_request->attachedCredential()) 570 if (m_request->attachedCredential())
571 request.setAttachedCredential(m_request->attachedCredential()); 571 request.setAttachedCredential(m_request->attachedCredential());
572 } 572 }
573 request.setFetchRedirectMode(m_request->redirect()); 573 request.setFetchRedirectMode(m_request->redirect());
574 request.setUseStreamOnResponse(true); 574 request.setUseStreamOnResponse(true);
575 request.setExternalRequestStateFromRequestorAddressSpace(m_executionContext- >securityContext().addressSpace()); 575 request.setExternalRequestStateFromRequestorAddressSpace(m_executionContext- >securityContext().addressSpace());
576 576
577 // "2. Append `Referer`/empty byte sequence, if |HTTPRequest|'s |referrer| 577 // "2. Append `Referer`/empty byte sequence, if |HTTPRequest|'s |referrer|
578 // is none, and `Referer`/|HTTPRequest|'s referrer, serialized and utf-8 578 // is none, and `Referer`/|HTTPRequest|'s referrer, serialized and utf-8
579 // encoded, otherwise, to HTTPRequest's header list. 579 // encoded, otherwise, to HTTPRequest's header list.
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 loader->dispose(); 739 loader->dispose();
740 } 740 }
741 741
742 DEFINE_TRACE(FetchManager) 742 DEFINE_TRACE(FetchManager)
743 { 743 {
744 visitor->trace(m_loaders); 744 visitor->trace(m_loaders);
745 ContextLifecycleObserver::trace(visitor); 745 ContextLifecycleObserver::trace(visitor);
746 } 746 }
747 747
748 } // namespace blink 748 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698