Skip to content

Commit

Permalink
Don't reload into an app process.
Browse files Browse the repository at this point in the history
NavigationEntries are not safe to move from one process to another.

BUG=80621,102408
TEST=Reload a page after installing it as an app.  No process swap.

Review URL: http://codereview.chromium.org/8443005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108571 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
creis@chromium.org committed Nov 3, 2011
1 parent 6efddb4 commit 95df17a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 21 deletions.
4 changes: 2 additions & 2 deletions chrome/browser/extensions/app_process_apitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcessRedirectBack) {

// Ensure that reloading a URL after installing or uninstalling it as an app
// correctly swaps the process. (http://crbug.com/80621)
IN_PROC_BROWSER_TEST_F(AppApiTest, ReloadIntoAppProcess) {
// Disabled until we get a correct fix for 80621. See http://crbug.com/102408.
IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kDisablePopupBlocking);

Expand Down Expand Up @@ -369,7 +370,6 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, ReloadIntoAppProcess) {
contents->render_view_host()->process()->id()));
}


// Tests that if we have a non-app process (path3/container.html) that has an
// iframe with a URL in the app's extent (path1/iframe.html), then opening a
// link from that iframe to a new window to a URL in the app's extent (path1/
Expand Down
9 changes: 0 additions & 9 deletions chrome/renderer/chrome_content_renderer_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -784,15 +784,6 @@ bool ChromeContentRendererClient::CrossesExtensionExtents(
old_url = frame->top()->opener()->top()->document().url();
}

// If this is a reload, check whether it has the wrong process type. We
// should send it to the browser if it's an extension URL (e.g., hosted app)
// in a normal process, or if it's a process for an extension that has been
// uninstalled.
if (old_url == new_url) {
if (is_extension_url != extension_dispatcher_->is_extension_process())
return true;
}

// TODO(creis): Temporary workaround for crbug.com/59285: Only return true if
// we would enter an extension app's extent from a non-app, or if we leave an
// extension with no web extent. We avoid swapping processes to exit a hosted
Expand Down
2 changes: 1 addition & 1 deletion content/browser/tab_contents/navigation_entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class CONTENT_EXPORT NavigationEntry {
//
// Note that the SiteInstance should usually not be changed after it is set,
// but this may happen if the NavigationEntry was cloned and needs to use a
// different SiteInstance, or if a hosted app is installed or uninstalled.
// different SiteInstance.
void set_site_instance(SiteInstance* site_instance);
SiteInstance* site_instance() const {
return site_instance_;
Expand Down
12 changes: 3 additions & 9 deletions content/browser/tab_contents/render_view_host_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,9 @@ SiteInstance* RenderViewHostManager::GetSiteInstanceForEntry(
NavigationController& controller = delegate_->GetControllerForRenderManager();
content::BrowserContext* browser_context = controller.browser_context();

// If the entry has an instance already we should use it, unless the URL
// is part of an app that has been installed or uninstalled since the last
// visit.
if (entry.site_instance()) {
if (entry.site_instance()->HasWrongProcessForURL(dest_url))
return curr_instance->GetRelatedSiteInstance(dest_url);
else
return entry.site_instance();
}
// If the entry has an instance already we should use it.
if (entry.site_instance())
return entry.site_instance();

// (UGLY) HEURISTIC, process-per-site only:
//
Expand Down

0 comments on commit 95df17a

Please sign in to comment.