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

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

Issue 2828293002: Copy the {credentials,cache,redirect,} modes for Fetch Requests (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/fetch/RequestTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/Request.h" 5 #include "modules/fetch/Request.h"
6 6
7 #include "bindings/core/v8/Dictionary.h" 7 #include "bindings/core/v8/Dictionary.h"
8 #include "bindings/core/v8/V8PrivateProperty.h" 8 #include "bindings/core/v8/V8PrivateProperty.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 return data; 715 return data;
716 } 716 }
717 717
718 bool Request::HasBody() const { 718 bool Request::HasBody() const {
719 return BodyBuffer(); 719 return BodyBuffer();
720 } 720 }
721 721
722 void Request::PopulateWebServiceWorkerRequest( 722 void Request::PopulateWebServiceWorkerRequest(
723 WebServiceWorkerRequest& web_request) const { 723 WebServiceWorkerRequest& web_request) const {
724 web_request.SetMethod(method()); 724 web_request.SetMethod(method());
725 web_request.SetMode(request_->Mode());
726 web_request.SetCredentialsMode(request_->Credentials());
727 web_request.SetCacheMode(request_->CacheMode());
728 web_request.SetRedirectMode(request_->Redirect());
725 web_request.SetRequestContext(request_->Context()); 729 web_request.SetRequestContext(request_->Context());
726 730
727 // Strip off the fragment part of URL. So far, all users of 731 // Strip off the fragment part of URL. So far, all users of
728 // WebServiceWorkerRequest expect the fragment to be excluded. 732 // WebServiceWorkerRequest expect the fragment to be excluded.
729 KURL url(request_->Url()); 733 KURL url(request_->Url());
730 if (request_->Url().HasFragmentIdentifier()) 734 if (request_->Url().HasFragmentIdentifier())
731 url.RemoveFragmentIdentifier(); 735 url.RemoveFragmentIdentifier();
732 web_request.SetURL(url); 736 web_request.SetURL(url);
733 737
734 const FetchHeaderList* header_list = headers_->HeaderList(); 738 const FetchHeaderList* header_list = headers_->HeaderList();
(...skipping 28 matching lines...) Expand all
763 .Set(request.As<v8::Object>(), body_buffer); 767 .Set(request.As<v8::Object>(), body_buffer);
764 } 768 }
765 769
766 DEFINE_TRACE(Request) { 770 DEFINE_TRACE(Request) {
767 Body::Trace(visitor); 771 Body::Trace(visitor);
768 visitor->Trace(request_); 772 visitor->Trace(request_);
769 visitor->Trace(headers_); 773 visitor->Trace(headers_);
770 } 774 }
771 775
772 } // namespace blink 776 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/fetch/RequestTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698