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

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

Issue 1738753002: Revert of Set the request mode and the credentials mode of FetchEvent in the service worker correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 ASSERT(SchemeRegistry::shouldTreatURLSchemeAsSupportingFetchAPI(m_request->u rl().protocol()) || (m_request->url().protocolIs("blob") && !corsFlag && !corsPr eflightFlag)); 519 ASSERT(SchemeRegistry::shouldTreatURLSchemeAsSupportingFetchAPI(m_request->u rl().protocol()) || (m_request->url().protocolIs("blob") && !corsFlag && !corsPr eflightFlag));
520 // CORS preflight fetch procedure is implemented inside DocumentThreadableLo ader. 520 // CORS preflight fetch procedure is implemented inside DocumentThreadableLo ader.
521 521
522 // "1. Let |HTTPRequest| be a copy of |request|, except that |HTTPRequest|'s 522 // "1. Let |HTTPRequest| be a copy of |request|, except that |HTTPRequest|'s
523 // body is a tee of |request|'s body." 523 // body is a tee of |request|'s body."
524 // We use ResourceRequest class for HTTPRequest. 524 // We use ResourceRequest class for HTTPRequest.
525 // FIXME: Support body. 525 // FIXME: Support body.
526 ResourceRequest request(m_request->url()); 526 ResourceRequest request(m_request->url());
527 request.setRequestContext(m_request->context()); 527 request.setRequestContext(m_request->context());
528 request.setHTTPMethod(m_request->method()); 528 request.setHTTPMethod(m_request->method());
529 request.setFetchRequestMode(m_request->mode());
530 request.setFetchCredentialsMode(m_request->credentials());
531 const Vector<OwnPtr<FetchHeaderList::Header>>& list = m_request->headerList( )->list(); 529 const Vector<OwnPtr<FetchHeaderList::Header>>& list = m_request->headerList( )->list();
532 for (size_t i = 0; i < list.size(); ++i) { 530 for (size_t i = 0; i < list.size(); ++i) {
533 request.addHTTPHeaderField(AtomicString(list[i]->first), AtomicString(li st[i]->second)); 531 request.addHTTPHeaderField(AtomicString(list[i]->first), AtomicString(li st[i]->second));
534 } 532 }
535 533
536 if (m_request->method() != HTTPNames::GET && m_request->method() != HTTPName s::HEAD) { 534 if (m_request->method() != HTTPNames::GET && m_request->method() != HTTPName s::HEAD) {
537 if (m_request->buffer()) { 535 if (m_request->buffer()) {
538 request.setHTTPBody(m_request->buffer()->drainAsFormData()); 536 request.setHTTPBody(m_request->buffer()->drainAsFormData());
539 } 537 }
540 } 538 }
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 loader->dispose(); 712 loader->dispose();
715 } 713 }
716 714
717 DEFINE_TRACE(FetchManager) 715 DEFINE_TRACE(FetchManager)
718 { 716 {
719 visitor->trace(m_executionContext); 717 visitor->trace(m_executionContext);
720 visitor->trace(m_loaders); 718 visitor->trace(m_loaders);
721 } 719 }
722 720
723 } // namespace blink 721 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/ImageLoader.cpp ('k') | third_party/WebKit/Source/platform/network/ResourceRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698