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

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

Issue 624073002: Add is_main_frame and parent_is_main_frame to ResourceRequestInfo::AllocateForTesting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge up to r302103 Created 6 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/loader/global_routing_id.h" 7 #include "content/browser/loader/global_routing_id.h"
8 #include "content/browser/loader/resource_message_filter.h" 8 #include "content/browser/loader/resource_message_filter.h"
9 #include "content/common/net/url_request_user_data.h" 9 #include "content/common/net/url_request_user_data.h"
10 #include "content/public/browser/global_request_id.h" 10 #include "content/public/browser/global_request_id.h"
(...skipping 11 matching lines...) Expand all
22 return ResourceRequestInfoImpl::ForRequest(request); 22 return ResourceRequestInfoImpl::ForRequest(request);
23 } 23 }
24 24
25 // static 25 // static
26 void ResourceRequestInfo::AllocateForTesting(net::URLRequest* request, 26 void ResourceRequestInfo::AllocateForTesting(net::URLRequest* request,
27 ResourceType resource_type, 27 ResourceType resource_type,
28 ResourceContext* context, 28 ResourceContext* context,
29 int render_process_id, 29 int render_process_id,
30 int render_view_id, 30 int render_view_id,
31 int render_frame_id, 31 int render_frame_id,
32 bool is_main_frame,
33 bool parent_is_main_frame,
32 bool is_async) { 34 bool is_async) {
35 // Make sure both |is_main_frame| and |parent_is_main_frame| aren't set at the
36 // same time.
37 DCHECK(!(is_main_frame && parent_is_main_frame));
38
39 // Make sure RESOURCE_TYPE_MAIN_FRAME is declared as being fetched as part of
40 // the main frame.
41 DCHECK(resource_type != RESOURCE_TYPE_MAIN_FRAME || is_main_frame);
mmenke 2014/11/12 21:17:49 Hrm...Is there any case where resource_type == RES
gab 2014/11/12 21:19:14 Yes, every resource loaded as part of the main fra
42
33 ResourceRequestInfoImpl* info = 43 ResourceRequestInfoImpl* info =
34 new ResourceRequestInfoImpl( 44 new ResourceRequestInfoImpl(
35 PROCESS_TYPE_RENDERER, // process_type 45 PROCESS_TYPE_RENDERER, // process_type
36 render_process_id, // child_id 46 render_process_id, // child_id
37 render_view_id, // route_id 47 render_view_id, // route_id
38 0, // origin_pid 48 0, // origin_pid
39 0, // request_id 49 0, // request_id
40 render_frame_id, // render_frame_id 50 render_frame_id, // render_frame_id
41 resource_type == RESOURCE_TYPE_MAIN_FRAME, // is_main_frame 51 is_main_frame, // is_main_frame
42 false, // parent_is_main_frame 52 parent_is_main_frame, // parent_is_main_frame
43 0, // parent_render_frame_id 53 0, // parent_render_frame_id
44 resource_type, // resource_type 54 resource_type, // resource_type
45 ui::PAGE_TRANSITION_LINK, // transition_type 55 ui::PAGE_TRANSITION_LINK, // transition_type
46 false, // should_replace_current_entry 56 false, // should_replace_current_entry
47 false, // is_download 57 false, // is_download
48 false, // is_stream 58 false, // is_stream
49 true, // allow_download 59 true, // allow_download
50 false, // has_user_gesture 60 false, // has_user_gesture
51 false, // enable load timing 61 false, // enable load timing
52 false, // enable upload progress 62 false, // enable upload progress
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 base::WeakPtr<ResourceMessageFilter> filter) { 268 base::WeakPtr<ResourceMessageFilter> filter) {
259 child_id_ = child_id; 269 child_id_ = child_id;
260 route_id_ = route_id; 270 route_id_ = route_id;
261 origin_pid_ = origin_pid; 271 origin_pid_ = origin_pid;
262 request_id_ = request_id; 272 request_id_ = request_id;
263 parent_render_frame_id_ = parent_render_frame_id; 273 parent_render_frame_id_ = parent_render_frame_id;
264 filter_ = filter; 274 filter_ = filter;
265 } 275 }
266 276
267 } // namespace content 277 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698