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

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

Issue 9146028: Define the public interface for content browser SiteInstance. This interface is implemented by th... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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/tab_contents/tab_contents.h ('k') | content/browser/tab_contents/tab_contents_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/tab_contents.cc
===================================================================
--- content/browser/tab_contents/tab_contents.cc (revision 118952)
+++ content/browser/tab_contents/tab_contents.cc (working copy)
@@ -27,7 +27,7 @@
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/browser/renderer_host/resource_dispatcher_host.h"
#include "content/browser/renderer_host/resource_request_details.h"
-#include "content/browser/site_instance.h"
+#include "content/browser/site_instance_impl.h"
#include "content/browser/tab_contents/interstitial_page.h"
#include "content/browser/tab_contents/navigation_entry_impl.h"
#include "content/browser/tab_contents/provisional_load_details.h"
@@ -121,6 +121,7 @@
using content::NavigationEntryImpl;
using content::OpenURLParams;
using content::RenderViewHostDelegate;
+using content::SiteInstance;
using content::SSLStatus;
using content::UserMetricsAction;
using content::WebContents;
@@ -504,20 +505,20 @@
}
int32 TabContents::GetMaxPageIDForSiteInstance(SiteInstance* site_instance) {
- if (max_page_ids_.find(site_instance->id()) == max_page_ids_.end())
- max_page_ids_[site_instance->id()] = -1;
+ if (max_page_ids_.find(site_instance->GetId()) == max_page_ids_.end())
+ max_page_ids_[site_instance->GetId()] = -1;
- return max_page_ids_[site_instance->id()];
+ return max_page_ids_[site_instance->GetId()];
}
void TabContents::UpdateMaxPageID(int32 page_id) {
UpdateMaxPageIDForSiteInstance(GetSiteInstance(), page_id);
}
-void TabContents::UpdateMaxPageIDForSiteInstance(SiteInstance* site_instance,
- int32 page_id) {
+void TabContents::UpdateMaxPageIDForSiteInstance(
+ SiteInstance* site_instance, int32 page_id) {
if (GetMaxPageIDForSiteInstance(site_instance) < page_id)
- max_page_ids_[site_instance->id()] = page_id;
+ max_page_ids_[site_instance->GetId()] = page_id;
}
void TabContents::CopyMaxPageIDsFrom(TabContents* tab_contents) {
@@ -672,7 +673,7 @@
// processes for some reason.
TabContents* tc = new TabContents(
GetBrowserContext(),
- SiteInstance::CreateSiteInstance(GetBrowserContext()),
+ SiteInstance::Create(GetBrowserContext()),
MSG_ROUTING_NONE, this, NULL);
tc->GetControllerImpl().CopyStateFrom(controller_);
return tc;
@@ -878,9 +879,10 @@
return true;
}
-void TabContents::SetHistoryLengthAndPrune(const SiteInstance* site_instance,
- int history_length,
- int32 minimum_page_id) {
+void TabContents::SetHistoryLengthAndPrune(
+ const SiteInstance* site_instance,
+ int history_length,
+ int32 minimum_page_id) {
// SetHistoryLengthAndPrune doesn't work when there are pending cross-site
// navigations. Callers should ensure that this is the case.
if (render_manager_.pending_render_view_host()) {
@@ -1396,7 +1398,8 @@
// it in now that we know. This allows us to find the entry when it commits.
if (!entry->site_instance() &&
entry->restore_type() != NavigationEntryImpl::RESTORE_NONE) {
- entry->set_site_instance(GetPendingSiteInstance());
+ entry->set_site_instance(
+ static_cast<SiteInstanceImpl*>(GetPendingSiteInstance()));
}
}
}
@@ -1735,8 +1738,8 @@
render_manager_.DidNavigateMainFrame(rvh);
// Update the site of the SiteInstance if it doesn't have one yet.
- if (!GetSiteInstance()->has_site())
- GetSiteInstance()->SetSite(params.url);
+ if (!static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite())
+ static_cast<SiteInstanceImpl*>(GetSiteInstance())->SetSite(params.url);
// Need to update MIME type here because it's referred to in
// UpdateNavigationCommands() called by RendererDidNavigate() to
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | content/browser/tab_contents/tab_contents_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698