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

Side by Side Diff: content/browser/tab_contents/render_view_host_manager.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/tab_contents/render_view_host_manager.h" 5 #include "content/browser/tab_contents/render_view_host_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/browser/renderer_host/render_view_host.h" 9 #include "content/browser/renderer_host/render_view_host.h"
10 #include "content/browser/renderer_host/render_view_host_delegate.h" 10 #include "content/browser/renderer_host/render_view_host_delegate.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 380
381 SiteInstance* RenderViewHostManager::GetSiteInstanceForEntry( 381 SiteInstance* RenderViewHostManager::GetSiteInstanceForEntry(
382 const NavigationEntry& entry, 382 const NavigationEntry& entry,
383 SiteInstance* curr_instance) { 383 SiteInstance* curr_instance) {
384 // NOTE: This is only called when ShouldTransitionCrossSite is true. 384 // NOTE: This is only called when ShouldTransitionCrossSite is true.
385 385
386 const GURL& dest_url = entry.url(); 386 const GURL& dest_url = entry.url();
387 NavigationController& controller = delegate_->GetControllerForRenderManager(); 387 NavigationController& controller = delegate_->GetControllerForRenderManager();
388 content::BrowserContext* browser_context = controller.browser_context(); 388 content::BrowserContext* browser_context = controller.browser_context();
389 389
390 // If the entry has an instance already we should use it, unless the URL 390 // If the entry has an instance already we should use it.
391 // is part of an app that has been installed or uninstalled since the last 391 if (entry.site_instance())
392 // visit.
393 if (entry.site_instance()) {
394 if (entry.site_instance()->HasWrongProcessForURL(dest_url)) {
395 // If we need to swap to a different SiteInstance, the new one should have
396 // the same max_page_id as the current one so that it identifies new vs
397 // existing navigations correctly. We also need to update the entry's
398 // SiteInstance, which we will do in TabContents::NavigateToEntry.
399 SiteInstance* new_instance =
400 curr_instance->GetRelatedSiteInstance(dest_url);
401 new_instance->UpdateMaxPageID(curr_instance->max_page_id());
402 return new_instance;
403 }
404 return entry.site_instance(); 392 return entry.site_instance();
405 }
406 393
407 // (UGLY) HEURISTIC, process-per-site only: 394 // (UGLY) HEURISTIC, process-per-site only:
408 // 395 //
409 // If this navigation is generated, then it probably corresponds to a search 396 // If this navigation is generated, then it probably corresponds to a search
410 // query. Given that search results typically lead to users navigating to 397 // query. Given that search results typically lead to users navigating to
411 // other sites, we don't really want to use the search engine hostname to 398 // other sites, we don't really want to use the search engine hostname to
412 // determine the site instance for this navigation. 399 // determine the site instance for this navigation.
413 // 400 //
414 // NOTE: This can be removed once we have a way to transition between 401 // NOTE: This can be removed once we have a way to transition between
415 // RenderViews in response to a link click. 402 // RenderViews in response to a link click.
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 } 796 }
810 } 797 }
811 798
812 bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) { 799 bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) {
813 if (!rvh->site_instance()) 800 if (!rvh->site_instance())
814 return false; 801 return false;
815 802
816 return swapped_out_hosts_.find(rvh->site_instance()->id()) != 803 return swapped_out_hosts_.find(rvh->site_instance()->id()) !=
817 swapped_out_hosts_.end(); 804 swapped_out_hosts_.end();
818 } 805 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698