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

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

Issue 1844053003: CREDENTIAL: Rework the integration with Fetch (1/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clear attachedcredentials 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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 request.setRequestContext(m_request->context()); 558 request.setRequestContext(m_request->context());
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());
570 } 570 if (m_request->attachedCredential())
571 request.setAttachedCredential(m_request->attachedCredential());
571 } 572 }
572 request.setFetchRedirectMode(m_request->redirect()); 573 request.setFetchRedirectMode(m_request->redirect());
573 request.setUseStreamOnResponse(true); 574 request.setUseStreamOnResponse(true);
574 request.setExternalRequestStateFromRequestorAddressSpace(m_executionContext- >securityContext().addressSpace()); 575 request.setExternalRequestStateFromRequestorAddressSpace(m_executionContext- >securityContext().addressSpace());
575 576
576 // "2. Append `Referer`/empty byte sequence, if |HTTPRequest|'s |referrer| 577 // "2. Append `Referer`/empty byte sequence, if |HTTPRequest|'s |referrer|
577 // is none, and `Referer`/|HTTPRequest|'s referrer, serialized and utf-8 578 // is none, and `Referer`/|HTTPRequest|'s referrer, serialized and utf-8
578 // encoded, otherwise, to HTTPRequest's header list. 579 // encoded, otherwise, to HTTPRequest's header list.
579 // 580 //
580 // The following code also invokes "determine request's referrer" which is 581 // The following code also invokes "determine request's referrer" which is
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 loader->dispose(); 736 loader->dispose();
736 } 737 }
737 738
738 DEFINE_TRACE(FetchManager) 739 DEFINE_TRACE(FetchManager)
739 { 740 {
740 visitor->trace(m_loaders); 741 visitor->trace(m_loaders);
741 ContextLifecycleObserver::trace(visitor); 742 ContextLifecycleObserver::trace(visitor);
742 } 743 }
743 744
744 } // namespace blink 745 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/Body.cpp ('k') | third_party/WebKit/Source/modules/fetch/FetchRequestData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698