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

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

Issue 2445993006: [WIP] Upgrade-insecure-request: upgrade insecurely-redirected requests.
Patch Set: bugfix 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 "content/browser/loader/resource_request_info_impl.h" 5 #include "content/browser/loader/resource_request_info_impl.h"
6 6
7 #include "content/browser/frame_host/frame_tree_node.h" 7 #include "content/browser/frame_host/frame_tree_node.h"
8 #include "content/browser/loader/global_routing_id.h" 8 #include "content/browser/loader/global_routing_id.h"
9 #include "content/browser/loader/resource_message_filter.h" 9 #include "content/browser/loader/resource_message_filter.h"
10 #include "content/browser/web_contents/web_contents_impl.h" 10 #include "content/browser/web_contents/web_contents_impl.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 false, // do_not_prompt_for_login 83 false, // do_not_prompt_for_login
84 blink::WebReferrerPolicyDefault, // referrer_policy 84 blink::WebReferrerPolicyDefault, // referrer_policy
85 blink::WebPageVisibilityStateVisible, // visibility_state 85 blink::WebPageVisibilityStateVisible, // visibility_state
86 context, // context 86 context, // context
87 base::WeakPtr<ResourceMessageFilter>(), // filter 87 base::WeakPtr<ResourceMessageFilter>(), // filter
88 false, // report_raw_headers 88 false, // report_raw_headers
89 is_async, // is_async 89 is_async, // is_async
90 is_using_lofi, // is_using_lofi 90 is_using_lofi, // is_using_lofi
91 std::string(), // original_headers 91 std::string(), // original_headers
92 nullptr, // body 92 nullptr, // body
93 false); // initiated_in_secure_context 93 false, // initiated_in_secure_context
94 blink::kUpgradeInsecureRequests); // insecure_request_policy
94 info->AssociateWithRequest(request); 95 info->AssociateWithRequest(request);
95 } 96 }
96 97
97 // static 98 // static
98 bool ResourceRequestInfo::GetRenderFrameForRequest( 99 bool ResourceRequestInfo::GetRenderFrameForRequest(
99 const net::URLRequest* request, 100 const net::URLRequest* request,
100 int* render_process_id, 101 int* render_process_id,
101 int* render_frame_id) { 102 int* render_frame_id) {
102 URLRequestUserData* user_data = static_cast<URLRequestUserData*>( 103 URLRequestUserData* user_data = static_cast<URLRequestUserData*>(
103 request->GetUserData(URLRequestUserData::kUserDataKey)); 104 request->GetUserData(URLRequestUserData::kUserDataKey));
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 bool do_not_prompt_for_login, 153 bool do_not_prompt_for_login,
153 blink::WebReferrerPolicy referrer_policy, 154 blink::WebReferrerPolicy referrer_policy,
154 blink::WebPageVisibilityState visibility_state, 155 blink::WebPageVisibilityState visibility_state,
155 ResourceContext* context, 156 ResourceContext* context,
156 base::WeakPtr<ResourceMessageFilter> filter, 157 base::WeakPtr<ResourceMessageFilter> filter,
157 bool report_raw_headers, 158 bool report_raw_headers,
158 bool is_async, 159 bool is_async,
159 bool is_using_lofi, 160 bool is_using_lofi,
160 const std::string& original_headers, 161 const std::string& original_headers,
161 const scoped_refptr<ResourceRequestBodyImpl> body, 162 const scoped_refptr<ResourceRequestBodyImpl> body,
162 bool initiated_in_secure_context) 163 bool initiated_in_secure_context,
164 blink::WebInsecureRequestPolicy insecure_request_policy)
163 : detachable_handler_(NULL), 165 : detachable_handler_(NULL),
164 process_type_(process_type), 166 process_type_(process_type),
165 child_id_(child_id), 167 child_id_(child_id),
166 route_id_(route_id), 168 route_id_(route_id),
167 frame_tree_node_id_(frame_tree_node_id), 169 frame_tree_node_id_(frame_tree_node_id),
168 origin_pid_(origin_pid), 170 origin_pid_(origin_pid),
169 request_id_(request_id), 171 request_id_(request_id),
170 render_frame_id_(render_frame_id), 172 render_frame_id_(render_frame_id),
171 is_main_frame_(is_main_frame), 173 is_main_frame_(is_main_frame),
172 parent_is_main_frame_(parent_is_main_frame), 174 parent_is_main_frame_(parent_is_main_frame),
(...skipping 12 matching lines...) Expand all
185 memory_cost_(0), 187 memory_cost_(0),
186 referrer_policy_(referrer_policy), 188 referrer_policy_(referrer_policy),
187 visibility_state_(visibility_state), 189 visibility_state_(visibility_state),
188 context_(context), 190 context_(context),
189 filter_(filter), 191 filter_(filter),
190 report_raw_headers_(report_raw_headers), 192 report_raw_headers_(report_raw_headers),
191 is_async_(is_async), 193 is_async_(is_async),
192 is_using_lofi_(is_using_lofi), 194 is_using_lofi_(is_using_lofi),
193 original_headers_(original_headers), 195 original_headers_(original_headers),
194 body_(body), 196 body_(body),
195 initiated_in_secure_context_(initiated_in_secure_context) {} 197 initiated_in_secure_context_(initiated_in_secure_context),
198 insecure_request_policy_(insecure_request_policy) {}
196 199
197 ResourceRequestInfoImpl::~ResourceRequestInfoImpl() { 200 ResourceRequestInfoImpl::~ResourceRequestInfoImpl() {
198 } 201 }
199 202
200 ResourceRequestInfo::WebContentsGetter 203 ResourceRequestInfo::WebContentsGetter
201 ResourceRequestInfoImpl::GetWebContentsGetterForRequest() const { 204 ResourceRequestInfoImpl::GetWebContentsGetterForRequest() const {
202 // PlzNavigate: navigation requests are created with a valid FrameTreeNode ID 205 // PlzNavigate: navigation requests are created with a valid FrameTreeNode ID
203 // and invalid RenderProcessHost and RenderFrameHost IDs. The FrameTreeNode 206 // and invalid RenderProcessHost and RenderFrameHost IDs. The FrameTreeNode
204 // ID should be used to access the WebContents. 207 // ID should be used to access the WebContents.
205 if (frame_tree_node_id_ != -1) { 208 if (frame_tree_node_id_ != -1) {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 origin_pid_ = origin_pid; 348 origin_pid_ = origin_pid;
346 request_id_ = request_id; 349 request_id_ = request_id;
347 filter_ = filter; 350 filter_ = filter;
348 } 351 }
349 352
350 void ResourceRequestInfoImpl::ResetBody() { 353 void ResourceRequestInfoImpl::ResetBody() {
351 body_ = nullptr; 354 body_ = nullptr;
352 } 355 }
353 356
354 } // namespace content 357 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_request_info_impl.h ('k') | content/browser/net/url_request_insecure_interceptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698