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

Unified 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: fix compile extensions_unittests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/loader/resource_loader_unittest.cc ('k') | content/public/browser/resource_request_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_request_info_impl.cc
diff --git a/content/browser/loader/resource_request_info_impl.cc b/content/browser/loader/resource_request_info_impl.cc
index 8cae9a5c93bc3a0b6824558674256f30a5b2fe1b..3b227ea97bbe6e715d1e32dd99960e3b6f749076 100644
--- a/content/browser/loader/resource_request_info_impl.cc
+++ b/content/browser/loader/resource_request_info_impl.cc
@@ -29,7 +29,17 @@ void ResourceRequestInfo::AllocateForTesting(net::URLRequest* request,
int render_process_id,
int render_view_id,
int render_frame_id,
+ bool is_main_frame,
+ bool parent_is_main_frame,
bool is_async) {
+ // Make sure both |is_main_frame| and |parent_is_main_frame| aren't set at the
+ // same time.
+ DCHECK(!(is_main_frame && parent_is_main_frame));
+
+ // Make sure RESOURCE_TYPE_MAIN_FRAME is declared as being fetched as part of
+ // the main frame.
+ DCHECK(resource_type != RESOURCE_TYPE_MAIN_FRAME || is_main_frame);
+
ResourceRequestInfoImpl* info =
new ResourceRequestInfoImpl(
PROCESS_TYPE_RENDERER, // process_type
@@ -38,8 +48,8 @@ void ResourceRequestInfo::AllocateForTesting(net::URLRequest* request,
0, // origin_pid
0, // request_id
render_frame_id, // render_frame_id
- resource_type == RESOURCE_TYPE_MAIN_FRAME, // is_main_frame
- false, // parent_is_main_frame
+ is_main_frame, // is_main_frame
+ parent_is_main_frame, // parent_is_main_frame
0, // parent_render_frame_id
resource_type, // resource_type
ui::PAGE_TRANSITION_LINK, // transition_type
« no previous file with comments | « content/browser/loader/resource_loader_unittest.cc ('k') | content/public/browser/resource_request_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698