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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_unittest.cc

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Addressed comments + rebase Created 4 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 return request_id; 152 return request_id;
153 } 153 }
154 154
155 static ResourceRequest CreateResourceRequest(const char* method, 155 static ResourceRequest CreateResourceRequest(const char* method,
156 ResourceType type, 156 ResourceType type,
157 const GURL& url) { 157 const GURL& url) {
158 ResourceRequest request; 158 ResourceRequest request;
159 request.method = std::string(method); 159 request.method = std::string(method);
160 request.url = url; 160 request.url = url;
161 request.first_party_for_cookies = url; // bypass third-party cookie blocking 161 request.first_party_for_cookies = url; // bypass third-party cookie blocking
162 request.request_initiator = url::Origin(url); // ensure initiator is set
162 request.referrer_policy = blink::WebReferrerPolicyDefault; 163 request.referrer_policy = blink::WebReferrerPolicyDefault;
163 request.load_flags = 0; 164 request.load_flags = 0;
164 request.origin_pid = 0; 165 request.origin_pid = 0;
165 request.resource_type = type; 166 request.resource_type = type;
166 request.request_context = 0; 167 request.request_context = 0;
167 request.appcache_host_id = kAppCacheNoHostId; 168 request.appcache_host_id = kAppCacheNoHostId;
168 request.download_to_file = false; 169 request.download_to_file = false;
169 request.should_reset_appcache = false; 170 request.should_reset_appcache = false;
170 request.is_main_frame = true; 171 request.is_main_frame = true;
171 request.parent_is_main_frame = false; 172 request.parent_is_main_frame = false;
(...skipping 3673 matching lines...) Expand 10 before | Expand all | Expand 10 after
3845 return nullptr; 3846 return nullptr;
3846 } 3847 }
3847 3848
3848 INSTANTIATE_TEST_CASE_P( 3849 INSTANTIATE_TEST_CASE_P(
3849 ResourceDispatcherHostTests, 3850 ResourceDispatcherHostTests,
3850 ResourceDispatcherHostTest, 3851 ResourceDispatcherHostTest,
3851 testing::Values(TestConfig::kDefault, 3852 testing::Values(TestConfig::kDefault,
3852 TestConfig::kOptimizeIPCForSmallResourceEnabled)); 3853 TestConfig::kOptimizeIPCForSmallResourceEnabled));
3853 3854
3854 } // namespace content 3855 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/browser/security_exploit_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698