summaryrefslogtreecommitdiffstats
path: root/content/child
diff options
context:
space:
mode:
authordavidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-19 04:33:42 +0000
committerdavidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-19 04:33:42 +0000
commit4972fc82e6b6df8da332275d541bcead15d5a65e (patch)
treeadac31a2be698268a6c03599251c4f4601345364 /content/child
parentbe12cc446c38f5d149318e8282dd32b726c02640 (diff)
downloadchromium_src-4972fc82e6b6df8da332275d541bcead15d5a65e.zip
chromium_src-4972fc82e6b6df8da332275d541bcead15d5a65e.tar.gz
chromium_src-4972fc82e6b6df8da332275d541bcead15d5a65e.tar.bz2
Preserve should_replace_current_entry across request transfers.
When a request transfer happens, we lose the should_replace_current_entry bit of the navigation. This results in us getting history wrong when, say, a hosted Google Calendar app is installed and we client-redirect to it while not logged in, triggering a server redirect to accounts.google.com and a request transfer. Push this state down to the renderer into NavigationState so it can be stapled to the request, bubbled back up to the CrossSiteResourceHandler and into the transferred navigation. Also test and fix a case where the state does not round-trip correctly if a fresh renderer with a browser-initiated navigation decides to fork the navigation back up to the browser anyway. BUG=311721 TEST=SitePerProcessBrowserTest.ReplaceEntryCrossProcessThenTransfers SitePerProcessBrowserTest.ReplaceEntryInProcessThenTransfers SitePerProcessBrowserTest.ReplaceEntryCrossProcessTwice Review URL: https://codereview.chromium.org/71993002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235918 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/child')
-rw-r--r--content/child/request_extra_data.cc2
-rw-r--r--content/child/request_extra_data.h5
-rw-r--r--content/child/resource_dispatcher.cc3
-rw-r--r--content/child/resource_dispatcher_unittest.cc2
4 files changed, 11 insertions, 1 deletions
diff --git a/content/child/request_extra_data.cc b/content/child/request_extra_data.cc
index ddd2208..4074079 100644
--- a/content/child/request_extra_data.cc
+++ b/content/child/request_extra_data.cc
@@ -19,6 +19,7 @@ RequestExtraData::RequestExtraData(WebReferrerPolicy referrer_policy,
int64 parent_frame_id,
bool allow_download,
PageTransition transition_type,
+ bool should_replace_current_entry,
int transferred_request_child_id,
int transferred_request_request_id)
: webkit_glue::WebURLRequestExtraDataImpl(referrer_policy,
@@ -31,6 +32,7 @@ RequestExtraData::RequestExtraData(WebReferrerPolicy referrer_policy,
parent_frame_id_(parent_frame_id),
allow_download_(allow_download),
transition_type_(transition_type),
+ should_replace_current_entry_(should_replace_current_entry),
transferred_request_child_id_(transferred_request_child_id),
transferred_request_request_id_(transferred_request_request_id) {
}
diff --git a/content/child/request_extra_data.h b/content/child/request_extra_data.h
index d0c85fb..7ad43fd 100644
--- a/content/child/request_extra_data.h
+++ b/content/child/request_extra_data.h
@@ -27,6 +27,7 @@ class CONTENT_EXPORT RequestExtraData
int64 parent_frame_id,
bool allow_download,
PageTransition transition_type,
+ bool should_replace_current_entry,
int transferred_request_child_id,
int transferred_request_request_id);
virtual ~RequestExtraData();
@@ -38,6 +39,9 @@ class CONTENT_EXPORT RequestExtraData
int64 parent_frame_id() const { return parent_frame_id_; }
bool allow_download() const { return allow_download_; }
PageTransition transition_type() const { return transition_type_; }
+ bool should_replace_current_entry() const {
+ return should_replace_current_entry_;
+ }
int transferred_request_child_id() const {
return transferred_request_child_id_;
}
@@ -53,6 +57,7 @@ class CONTENT_EXPORT RequestExtraData
int64 parent_frame_id_;
bool allow_download_;
PageTransition transition_type_;
+ bool should_replace_current_entry_;
int transferred_request_child_id_;
int transferred_request_request_id_;
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc
index 37c52b0..657ffe1 100644
--- a/content/child/resource_dispatcher.cc
+++ b/content/child/resource_dispatcher.cc
@@ -135,6 +135,8 @@ IPCResourceLoaderBridge::IPCResourceLoaderBridge(
request_.parent_frame_id = extra_data->parent_frame_id();
request_.allow_download = extra_data->allow_download();
request_.transition_type = extra_data->transition_type();
+ request_.should_replace_current_entry =
+ extra_data->should_replace_current_entry();
request_.transferred_request_child_id =
extra_data->transferred_request_child_id();
request_.transferred_request_request_id =
@@ -147,6 +149,7 @@ IPCResourceLoaderBridge::IPCResourceLoaderBridge(
request_.parent_frame_id = -1;
request_.allow_download = true;
request_.transition_type = PAGE_TRANSITION_LINK;
+ request_.should_replace_current_entry = false;
request_.transferred_request_child_id = -1;
request_.transferred_request_request_id = -1;
}
diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc
index a5b0880..76627ad 100644
--- a/content/child/resource_dispatcher_unittest.cc
+++ b/content/child/resource_dispatcher_unittest.cc
@@ -177,7 +177,7 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender {
blink::WebString(),
false, true, 0, GURL(),
false, -1, true,
- PAGE_TRANSITION_LINK, -1, -1);
+ PAGE_TRANSITION_LINK, false, -1, -1);
request_info.extra_data = &extra_data;
return dispatcher_->CreateBridge(request_info);