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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 8443005: Don't reload into an app process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index ecc89ff5f512a0a57349ed106e5835aed42abb14..e920f9899436b5ee892ce8785f49cbdcd4b0d144 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -571,34 +571,27 @@ TabContents* TabContents::OpenURL(const OpenURLParams& params) {
bool TabContents::NavigateToPendingEntry(
NavigationController::ReloadType reload_type) {
- return NavigateToEntry(controller_.pending_entry(), reload_type);
+ return NavigateToEntry(*controller_.pending_entry(), reload_type);
}
bool TabContents::NavigateToEntry(
- NavigationEntry* entry,
+ const NavigationEntry& entry,
Charlie Reis 2011/11/03 20:47:58 These changes will be redundant with the revert.
NavigationController::ReloadType reload_type) {
// The renderer will reject IPC messages with URLs longer than
// this limit, so don't attempt to navigate with a longer URL.
- if (entry->url().spec().size() > content::kMaxURLChars)
+ if (entry.url().spec().size() > content::kMaxURLChars)
return false;
- RenderViewHost* dest_render_view_host = render_manager_.Navigate(*entry);
+ RenderViewHost* dest_render_view_host = render_manager_.Navigate(entry);
if (!dest_render_view_host)
return false; // Unable to create the desired render view host.
- // If we were forced to swap the entry's existing SiteInstance, we need to
- // update it before the navigation begins so that we can find it when the
- // navigation commits.
- if (entry->site_instance() &&
- entry->site_instance() != dest_render_view_host->site_instance())
- entry->set_site_instance(dest_render_view_host->site_instance());
-
// For security, we should never send non-Web-UI URLs to a Web UI renderer.
// Double check that here.
int enabled_bindings = dest_render_view_host->enabled_bindings();
bool is_allowed_in_web_ui_renderer = content::GetContentClient()->
browser()->GetWebUIFactory()->IsURLAcceptableForWebUI(browser_context(),
- entry->url());
+ entry.url());
CHECK(!(enabled_bindings & content::BINDINGS_POLICY_WEB_UI) ||
is_allowed_in_web_ui_renderer);
@@ -607,7 +600,7 @@ bool TabContents::NavigateToEntry(
if (devtools_manager) { // NULL in unit tests.
devtools_manager->OnNavigatingToPendingEntry(render_view_host(),
dest_render_view_host,
- entry->url());
+ entry.url());
}
// Used for page load time metrics.
@@ -615,24 +608,24 @@ bool TabContents::NavigateToEntry(
// Navigate in the desired RenderViewHost.
ViewMsg_Navigate_Params navigate_params;
- MakeNavigateParams(*entry, controller_, delegate_, reload_type,
+ MakeNavigateParams(entry, controller_, delegate_, reload_type,
&navigate_params);
dest_render_view_host->Navigate(navigate_params);
- if (entry->page_id() == -1) {
+ if (entry.page_id() == -1) {
// HACK!! This code suppresses javascript: URLs from being added to
// session history, which is what we want to do for javascript: URLs that
// do not generate content. What we really need is a message from the
// renderer telling us that a new page was not created. The same message
// could be used for mailto: URLs and the like.
- if (entry->url().SchemeIs(chrome::kJavaScriptScheme))
+ if (entry.url().SchemeIs(chrome::kJavaScriptScheme))
return false;
}
// Notify observers about navigation.
FOR_EACH_OBSERVER(TabContentsObserver,
observers_,
- NavigateToPendingEntry(entry->url(), reload_type));
+ NavigateToPendingEntry(entry.url(), reload_type));
if (delegate_)
delegate_->DidNavigateToPendingEntry(this);
@@ -1097,7 +1090,7 @@ void TabContents::OnGoToEntryAtOffset(int offset) {
content::PageTransitionFromInt(
entry->transition_type() |
content::PAGE_TRANSITION_FORWARD_BACK));
- NavigateToEntry(entry, NavigationController::NO_RELOAD);
+ NavigateToEntry(*entry, NavigationController::NO_RELOAD);
// If the entry is being restored and doesn't have a SiteInstance yet, fill
// it in now that we know. This allows us to find the entry when it commits.

Powered by Google App Engine
This is Rietveld 408576698