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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10704048: [RDS] Reloads a page using the original request URL (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase fix Created 8 years, 4 months 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
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 79ea7ab8605ef7f9dd485124e03e18e465cc277b..1d57e35c9852de06b65c1ac0ba0ee55528086506 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -189,6 +189,8 @@ ViewMsg_Navigate_Type::Value GetNavigationType(
return ViewMsg_Navigate_Type::RELOAD;
case NavigationControllerImpl::RELOAD_IGNORING_CACHE:
return ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE;
+ case NavigationControllerImpl::RELOAD_ORIGINAL_REQUEST_URL:
+ return ViewMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL;
case NavigationControllerImpl::NO_RELOAD:
break; // Fall through to rest of function.
}
@@ -216,7 +218,6 @@ void MakeNavigateParams(const NavigationEntryImpl& entry,
params->pending_history_list_offset = controller.GetIndexOfEntry(&entry);
params->current_history_list_offset = controller.GetLastCommittedEntryIndex();
params->current_history_list_length = controller.GetEntryCount();
- params->url = entry.GetURL();
if (!entry.GetBaseURLForDataURL().is_empty()) {
params->base_url_for_data_url = entry.GetBaseURLForDataURL();
params->history_url_for_data_url = entry.GetVirtualURL();
@@ -246,6 +247,17 @@ void MakeNavigateParams(const NavigationEntryImpl& entry,
}
+ if (reload_type == NavigationControllerImpl::RELOAD_ORIGINAL_REQUEST_URL &&
+ entry.GetOriginalRequestURL().is_valid() && !entry.GetHasPostData()) {
+ // We may have been redirected when navigating to the current URL.
+ // Use the URL the user originally intended to visit, if it's valid and if a
+ // POST wasn't involved; the latter case avoids issues with sending data to
+ // the wrong page.
+ params->url = entry.GetOriginalRequestURL();
+ } else {
+ params->url = entry.GetURL();
+ }
+
if (delegate)
delegate->AddNavigationHeaders(params->url, &params->extra_headers);
}
« no previous file with comments | « content/browser/web_contents/navigation_controller_impl_unittest.cc ('k') | content/common/view_message_enums.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698