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

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

Issue 1467563002: Use ResourceRequestInfo::GetWebContents in DownloadRequestLimiter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-contents-callback
Patch Set: Addressed davidben's comments Created 5 years 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/frame_host/frame_tree_node.h" 8 #include "content/browser/frame_host/frame_tree_node.h"
9 #include "content/browser/loader/global_routing_id.h" 9 #include "content/browser/loader/global_routing_id.h"
10 #include "content/browser/loader/resource_message_filter.h" 10 #include "content/browser/loader/resource_message_filter.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 context_(context), 180 context_(context),
181 filter_(filter), 181 filter_(filter),
182 report_raw_headers_(report_raw_headers), 182 report_raw_headers_(report_raw_headers),
183 is_async_(is_async), 183 is_async_(is_async),
184 is_using_lofi_(is_using_lofi) { 184 is_using_lofi_(is_using_lofi) {
185 } 185 }
186 186
187 ResourceRequestInfoImpl::~ResourceRequestInfoImpl() { 187 ResourceRequestInfoImpl::~ResourceRequestInfoImpl() {
188 } 188 }
189 189
190 base::Callback<WebContents*(void)> 190 ResourceRequestInfo::WebContentsGetter
191 ResourceRequestInfoImpl::GetWebContentsForRequest() const { 191 ResourceRequestInfoImpl::GetWebContentsGetterForRequest() const {
192 // PlzNavigate: navigation requests are created with a valid FrameTreeNode ID 192 // PlzNavigate: navigation requests are created with a valid FrameTreeNode ID
193 // and invalid RenderProcessHost and RenderFrameHost IDs. The FrameTreeNode 193 // and invalid RenderProcessHost and RenderFrameHost IDs. The FrameTreeNode
194 // ID should be used to access the WebContents. 194 // ID should be used to access the WebContents.
195 if (frame_tree_node_id_ != -1) { 195 if (frame_tree_node_id_ != -1) {
196 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( 196 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
197 switches::kEnableBrowserSideNavigation)); 197 switches::kEnableBrowserSideNavigation));
198 return base::Bind(&GetWebContentsFromFTNID, frame_tree_node_id_); 198 return base::Bind(&GetWebContentsFromFTNID, frame_tree_node_id_);
199 } 199 }
200 200
201 // In other cases, use the RenderProcessHost ID + RenderFrameHost ID to get 201 // In other cases, use the RenderProcessHost ID + RenderFrameHost ID to get
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 base::WeakPtr<ResourceMessageFilter> filter) { 333 base::WeakPtr<ResourceMessageFilter> filter) {
334 child_id_ = child_id; 334 child_id_ = child_id;
335 route_id_ = route_id; 335 route_id_ = route_id;
336 origin_pid_ = origin_pid; 336 origin_pid_ = origin_pid;
337 request_id_ = request_id; 337 request_id_ = request_id;
338 parent_render_frame_id_ = parent_render_frame_id; 338 parent_render_frame_id_ = parent_render_frame_id;
339 filter_ = filter; 339 filter_ = filter;
340 } 340 }
341 341
342 } // namespace content 342 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_request_info_impl.h ('k') | content/public/browser/android/download_controller_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698