summaryrefslogtreecommitdiffstats
path: root/content/browser/loader
diff options
context:
space:
mode:
authorcreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-03 21:29:35 +0000
committercreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-03 21:29:35 +0000
commit79a702895e17d13056da5454830de5a9244b4f04 (patch)
tree1a4a145eceb46ddf7566dd62b6e359767ec687e3 /content/browser/loader
parent45172e6e478a359eba9c05bc72dd0b4c241a65c8 (diff)
downloadchromium_src-79a702895e17d13056da5454830de5a9244b4f04.zip
chromium_src-79a702895e17d13056da5454830de5a9244b4f04.tar.gz
chromium_src-79a702895e17d13056da5454830de5a9244b4f04.tar.bz2
Update resource requests to remove redundant frame ID.
BUG=314791 TEST=No behavior change. R=battre@chromium.org, nasko@chromium.org TBR=dcheng@chromium.org, jochen@chromium.org Review URL: https://codereview.chromium.org/184873004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254566 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/loader')
-rw-r--r--content/browser/loader/cross_site_resource_handler.cc14
-rw-r--r--content/browser/loader/resource_dispatcher_host_impl.cc10
-rw-r--r--content/browser/loader/resource_dispatcher_host_unittest.cc3
-rw-r--r--content/browser/loader/resource_request_info_impl.cc22
-rw-r--r--content/browser/loader/resource_request_info_impl.h12
-rw-r--r--content/browser/loader/resource_scheduler_unittest.cc3
6 files changed, 24 insertions, 40 deletions
diff --git a/content/browser/loader/cross_site_resource_handler.cc b/content/browser/loader/cross_site_resource_handler.cc
index 2ed007a..c958ba5 100644
--- a/content/browser/loader/cross_site_resource_handler.cc
+++ b/content/browser/loader/cross_site_resource_handler.cc
@@ -43,7 +43,7 @@ struct CrossSiteResponseParams {
const std::vector<GURL>& transfer_url_chain,
const Referrer& referrer,
PageTransition page_transition,
- int64 frame_id,
+ int render_frame_id,
bool should_replace_current_entry)
: render_view_id(render_view_id),
global_request_id(global_request_id),
@@ -51,7 +51,7 @@ struct CrossSiteResponseParams {
transfer_url_chain(transfer_url_chain),
referrer(referrer),
page_transition(page_transition),
- frame_id(frame_id),
+ render_frame_id(render_frame_id),
should_replace_current_entry(should_replace_current_entry) {
}
@@ -61,7 +61,7 @@ struct CrossSiteResponseParams {
std::vector<GURL> transfer_url_chain;
Referrer referrer;
PageTransition page_transition;
- int64 frame_id;
+ int render_frame_id;
bool should_replace_current_entry;
};
@@ -79,7 +79,7 @@ void OnCrossSiteResponseHelper(const CrossSiteResponseParams& params) {
rvh->OnCrossSiteResponse(
params.global_request_id, cross_site_transferring_request.Pass(),
params.transfer_url_chain, params.referrer,
- params.page_transition, params.frame_id,
+ params.page_transition, params.render_frame_id,
params.should_replace_current_entry);
} else if (leak_requests_for_testing_ && cross_site_transferring_request) {
// Some unit tests expect requests to be leaked in this case, so they can
@@ -307,11 +307,11 @@ void CrossSiteResourceHandler::StartCrossSiteTransition(
// occurred, plus the destination URL at the end.
std::vector<GURL> transfer_url_chain;
Referrer referrer;
- int frame_id = -1;
+ int render_frame_id = -1;
if (should_transfer) {
transfer_url_chain = request()->url_chain();
referrer = Referrer(GURL(request()->referrer()), info->GetReferrerPolicy());
- frame_id = info->GetFrameID();
+ render_frame_id = info->GetRenderFrameID();
appcache::AppCacheInterceptor::PrepareForCrossSiteTransfer(
request(), global_id.child_id);
@@ -328,7 +328,7 @@ void CrossSiteResourceHandler::StartCrossSiteTransition(
transfer_url_chain,
referrer,
info->GetPageTransition(),
- frame_id,
+ render_frame_id,
info->should_replace_current_entry())));
}
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 1dbba49..5b2e78b 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -917,8 +917,8 @@ void ResourceDispatcherHostImpl::UpdateRequestForTransfer(
// ResourceRequestInfo rather than caching it locally. This lets us update
// the info object when a transfer occurs.
info->UpdateForTransfer(child_id, route_id, request_data.origin_pid,
- request_id, request_data.frame_id,
- request_data.parent_frame_id, filter_->GetWeakPtr());
+ request_id, request_data.parent_render_frame_id,
+ filter_->GetWeakPtr());
// Update maps that used the old IDs, if necessary. Some transfers in tests
// do not actually use a different ID, so not all maps need to be updated.
@@ -1096,9 +1096,8 @@ void ResourceDispatcherHostImpl::BeginRequest(
request_id,
request_data.render_frame_id,
request_data.is_main_frame,
- request_data.frame_id,
request_data.parent_is_main_frame,
- request_data.parent_frame_id,
+ request_data.parent_render_frame_id,
request_data.resource_type,
request_data.transition_type,
request_data.should_replace_current_entry,
@@ -1294,9 +1293,8 @@ ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo(
request_id_,
MSG_ROUTING_NONE, // render_frame_id
false, // is_main_frame
- -1, // frame_id
false, // parent_is_main_frame
- -1, // parent_frame_id
+ -1, // parent_render_frame_id
ResourceType::SUB_RESOURCE,
PAGE_TRANSITION_LINK,
false, // should_replace_current_entry
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc
index 51bc21b..6f7a8e2 100644
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -111,9 +111,8 @@ static ResourceHostMsg_Request CreateResourceRequest(
request.appcache_host_id = appcache::kNoHostId;
request.download_to_file = false;
request.is_main_frame = true;
- request.frame_id = 0;
request.parent_is_main_frame = false;
- request.parent_frame_id = -1;
+ request.parent_render_frame_id = -1;
request.transition_type = PAGE_TRANSITION_LINK;
request.allow_download = true;
return request;
diff --git a/content/browser/loader/resource_request_info_impl.cc b/content/browser/loader/resource_request_info_impl.cc
index 4bdeb08..03d925e 100644
--- a/content/browser/loader/resource_request_info_impl.cc
+++ b/content/browser/loader/resource_request_info_impl.cc
@@ -40,9 +40,8 @@ void ResourceRequestInfo::AllocateForTesting(
0, // request_id
render_frame_id, // render_frame_id
resource_type == ResourceType::MAIN_FRAME, // is_main_frame
- 0, // frame_id
false, // parent_is_main_frame
- 0, // parent_frame_id
+ 0, // parent_render_frame_id
resource_type, // resource_type
PAGE_TRANSITION_LINK, // transition_type
false, // should_replace_current_entry
@@ -95,9 +94,8 @@ ResourceRequestInfoImpl::ResourceRequestInfoImpl(
int request_id,
int render_frame_id,
bool is_main_frame,
- int64 frame_id,
bool parent_is_main_frame,
- int64 parent_frame_id,
+ int parent_render_frame_id,
ResourceType::Type resource_type,
PageTransition transition_type,
bool should_replace_current_entry,
@@ -119,9 +117,8 @@ ResourceRequestInfoImpl::ResourceRequestInfoImpl(
request_id_(request_id),
render_frame_id_(render_frame_id),
is_main_frame_(is_main_frame),
- frame_id_(frame_id),
parent_is_main_frame_(parent_is_main_frame),
- parent_frame_id_(parent_frame_id),
+ parent_render_frame_id_(parent_render_frame_id),
should_replace_current_entry_(should_replace_current_entry),
is_download_(is_download),
is_stream_(is_stream),
@@ -169,16 +166,12 @@ bool ResourceRequestInfoImpl::IsMainFrame() const {
return is_main_frame_;
}
-int64 ResourceRequestInfoImpl::GetFrameID() const {
- return frame_id_;
-}
-
bool ResourceRequestInfoImpl::ParentIsMainFrame() const {
return parent_is_main_frame_;
}
-int64 ResourceRequestInfoImpl::GetParentFrameID() const {
- return parent_frame_id_;
+int ResourceRequestInfoImpl::GetParentRenderFrameID() const {
+ return parent_render_frame_id_;
}
ResourceType::Type ResourceRequestInfoImpl::GetResourceType() const {
@@ -266,14 +259,13 @@ void ResourceRequestInfoImpl::UpdateForTransfer(
int route_id,
int origin_pid,
int request_id,
- int64 frame_id,
- int64 parent_frame_id,
+ int parent_render_frame_id,
base::WeakPtr<ResourceMessageFilter> filter) {
child_id_ = child_id;
route_id_ = route_id;
origin_pid_ = origin_pid;
request_id_ = request_id;
- frame_id_ = frame_id;
+ parent_render_frame_id_ = parent_render_frame_id;
filter_ = filter;
}
diff --git a/content/browser/loader/resource_request_info_impl.h b/content/browser/loader/resource_request_info_impl.h
index 2284274..82c81c0 100644
--- a/content/browser/loader/resource_request_info_impl.h
+++ b/content/browser/loader/resource_request_info_impl.h
@@ -47,9 +47,8 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
int request_id,
int render_frame_id,
bool is_main_frame,
- int64 frame_id,
bool parent_is_main_frame,
- int64 parent_frame_id,
+ int parent_render_frame_id,
ResourceType::Type resource_type,
PageTransition transition_type,
bool should_replace_current_entry,
@@ -72,9 +71,8 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
virtual int GetRequestID() const OVERRIDE;
virtual int GetRenderFrameID() const OVERRIDE;
virtual bool IsMainFrame() const OVERRIDE;
- virtual int64 GetFrameID() const OVERRIDE;
virtual bool ParentIsMainFrame() const OVERRIDE;
- virtual int64 GetParentFrameID() const OVERRIDE;
+ virtual int GetParentRenderFrameID() const OVERRIDE;
virtual ResourceType::Type GetResourceType() const OVERRIDE;
virtual int GetProcessType() const OVERRIDE;
virtual blink::WebReferrerPolicy GetReferrerPolicy() const OVERRIDE;
@@ -106,8 +104,7 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
int route_id,
int origin_pid,
int request_id,
- int64 frame_id,
- int64 parent_frame_id,
+ int parent_render_frame_id,
base::WeakPtr<ResourceMessageFilter> filter);
// CrossSiteResourceHandler for this request. May be null.
@@ -171,9 +168,8 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
int request_id_;
int render_frame_id_;
bool is_main_frame_;
- int64 frame_id_;
bool parent_is_main_frame_;
- int64 parent_frame_id_;
+ int parent_render_frame_id_;
bool should_replace_current_entry_;
bool is_download_;
bool is_stream_;
diff --git a/content/browser/loader/resource_scheduler_unittest.cc b/content/browser/loader/resource_scheduler_unittest.cc
index 85aa777..d248b4a 100644
--- a/content/browser/loader/resource_scheduler_unittest.cc
+++ b/content/browser/loader/resource_scheduler_unittest.cc
@@ -148,9 +148,8 @@ class ResourceSchedulerTest : public testing::Test {
++next_request_id_, // request_id
MSG_ROUTING_NONE, // render_frame_id
false, // is_main_frame
- 0, // frame_id
false, // parent_is_main_frame
- 0, // parent_frame_id
+ 0, // parent_render_frame_id
ResourceType::SUB_RESOURCE, // resource_type
PAGE_TRANSITION_LINK, // transition_type
false, // should_replace_current_entry