Index: content/browser/web_contents/web_contents_impl.cc |
=================================================================== |
--- content/browser/web_contents/web_contents_impl.cc (revision 227958) |
+++ content/browser/web_contents/web_contents_impl.cc (working copy) |
@@ -224,6 +224,7 @@ |
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(); |
@@ -243,25 +244,13 @@ |
// Avoid downloading when in view-source mode. |
params->allow_download = !entry.IsViewSourceMode(); |
params->is_post = entry.GetHasPostData(); |
- if(entry.GetBrowserInitiatedPostData()) { |
- params->browser_initiated_post_data.assign( |
- entry.GetBrowserInitiatedPostData()->front(), |
- entry.GetBrowserInitiatedPostData()->front() + |
- entry.GetBrowserInitiatedPostData()->size()); |
- |
+ if (entry.GetBrowserInitiatedPostData()) { |
+ params->browser_initiated_post_data.assign( |
+ entry.GetBrowserInitiatedPostData()->front(), |
+ entry.GetBrowserInitiatedPostData()->front() + |
+ entry.GetBrowserInitiatedPostData()->size()); |
} |
- 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(); |
- } |
- |
params->can_load_local_resources = entry.GetCanLoadLocalResources(); |
params->frame_to_navigate = entry.GetFrameToNavigate(); |
@@ -1820,10 +1809,20 @@ |
} |
bool WebContentsImpl::NavigateToEntry( |
- const NavigationEntryImpl& entry, |
+ const NavigationEntryImpl& entry_in, |
NavigationController::ReloadType reload_type) { |
TRACE_EVENT0("browser", "WebContentsImpl::NavigateToEntry"); |
+ NavigationEntryImpl entry(entry_in); |
Charlie Reis
2013/10/11 21:22:27
After taking a closer look, I wonder if we just wa
jam
2013/10/11 22:24:49
Done.
|
+ 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. |
+ entry.SetURL(entry.GetOriginalRequestURL()); |
+ } |
+ |
// The renderer will reject IPC messages with URLs longer than |
// this limit, so don't attempt to navigate with a longer URL. |
if (entry.GetURL().spec().size() > kMaxURLChars) { |