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

Unified Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 923183003: Move URL fixup to a preliminary phase that doesn't affect virtual URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoid duplicate code Created 5 years, 10 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
« no previous file with comments | « content/browser/browser_url_handler_impl.cc ('k') | content/public/browser/browser_url_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 979b26c1dc5603b12adb1edc1907ea5a08cc41aa..939f10810bfb1bec9cc3a770c70a8b8a0f6241a0 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -165,11 +165,17 @@ NavigationEntry* NavigationController::CreateNavigationEntry(
bool is_renderer_initiated,
const std::string& extra_headers,
BrowserContext* browser_context) {
+ // Fix up the given URL before letting it be rewritten, so that any minor
+ // cleanup (e.g., removing leading dots) will not lead to a virtual URL.
+ GURL dest_url(url);
+ BrowserURLHandlerImpl::GetInstance()->FixupURLBeforeRewrite(&dest_url,
+ browser_context);
+
// Allow the browser URL handler to rewrite the URL. This will, for example,
// remove "view-source:" from the beginning of the URL to get the URL that
// will actually be loaded. This real URL won't be shown to the user, just
// used internally.
- GURL loaded_url(url);
+ GURL loaded_url(dest_url);
bool reverse_on_redirect = false;
BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary(
&loaded_url, browser_context, &reverse_on_redirect);
@@ -183,8 +189,8 @@ NavigationEntry* NavigationController::CreateNavigationEntry(
base::string16(),
transition,
is_renderer_initiated);
- entry->SetVirtualURL(url);
- entry->set_user_typed_url(url);
+ entry->SetVirtualURL(dest_url);
+ entry->set_user_typed_url(dest_url);
entry->set_update_virtual_url_with_url(reverse_on_redirect);
entry->set_extra_headers(extra_headers);
return entry;
« no previous file with comments | « content/browser/browser_url_handler_impl.cc ('k') | content/public/browser/browser_url_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698