summaryrefslogtreecommitdiffstats
path: root/content/browser
diff options
context:
space:
mode:
authornasko@chromium.org <nasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-28 15:34:59 +0000
committernasko@chromium.org <nasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-28 15:34:59 +0000
commit77ab1731f433d10b37af1a4363cd301cdd484fb5 (patch)
tree81fcf15f143606a693597aa232a68c3f2d443b24 /content/browser
parent6cec68ca4ecc9a02cf156440e11bf171f60c4da0 (diff)
downloadchromium_src-77ab1731f433d10b37af1a4363cd301cdd484fb5.zip
chromium_src-77ab1731f433d10b37af1a4363cd301cdd484fb5.tar.gz
chromium_src-77ab1731f433d10b37af1a4363cd301cdd484fb5.tar.bz2
Rename GetSite in SiteInstance to GetSiteURL.
This rename is in preparation of adding a GetSite method, which will return a structure instead of GURL. BUG=145500 Review URL: https://chromiumcodereview.appspot.com/11000027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r--content/browser/browser_context.cc3
-rw-r--r--content/browser/browser_plugin/browser_plugin_embedder.cc2
-rw-r--r--content/browser/browser_plugin/old/old_browser_plugin_host.cc2
-rw-r--r--content/browser/browsing_instance.cc4
-rw-r--r--content/browser/intents/intent_injector.cc4
-rw-r--r--content/browser/renderer_host/pepper/pepper_message_filter.cc4
-rw-r--r--content/browser/renderer_host/render_view_host_manager_browsertest.cc2
-rw-r--r--content/browser/site_instance_impl.cc2
-rw-r--r--content/browser/site_instance_impl.h2
-rw-r--r--content/browser/site_instance_impl_unittest.cc6
-rw-r--r--content/browser/web_contents/navigation_controller_impl.cc2
-rw-r--r--content/browser/web_contents/navigation_controller_impl_unittest.cc4
-rw-r--r--content/browser/web_contents/render_view_host_manager.cc6
-rw-r--r--content/browser/web_contents/render_view_host_manager_unittest.cc2
-rw-r--r--content/browser/web_contents/web_contents_impl.cc2
15 files changed, 24 insertions, 23 deletions
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index b2aadfe..58e5df8 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -116,7 +116,8 @@ StoragePartition* BrowserContext::GetStoragePartition(
// this conditional and require that |site_instance| is non-NULL.
if (site_instance) {
partition_id = GetContentClient()->browser()->
- GetStoragePartitionIdForSite(browser_context, site_instance->GetSite());
+ GetStoragePartitionIdForSite(browser_context,
+ site_instance->GetSiteURL());
}
return GetStoragePartitionByPartitionId(browser_context, partition_id);
diff --git a/content/browser/browser_plugin/browser_plugin_embedder.cc b/content/browser/browser_plugin/browser_plugin_embedder.cc
index 00b85a8..742576a 100644
--- a/content/browser/browser_plugin/browser_plugin_embedder.cc
+++ b/content/browser/browser_plugin/browser_plugin_embedder.cc
@@ -85,7 +85,7 @@ void BrowserPluginEmbedder::NavigateGuest(RenderViewHost* render_view_host,
GURL url(src);
if (!guest) {
const std::string& host =
- render_view_host->GetSiteInstance()->GetSite().host();
+ render_view_host->GetSiteInstance()->GetSiteURL().host();
guest_web_contents = WebContentsImpl::CreateGuest(
web_contents()->GetBrowserContext(),
host,
diff --git a/content/browser/browser_plugin/old/old_browser_plugin_host.cc b/content/browser/browser_plugin/old/old_browser_plugin_host.cc
index 377beb6..bd8086b 100644
--- a/content/browser/browser_plugin/old/old_browser_plugin_host.cc
+++ b/content/browser/browser_plugin/old/old_browser_plugin_host.cc
@@ -85,7 +85,7 @@ void BrowserPluginHost::NavigateGuestFromEmbedder(
static_cast<WebContentsImpl*>(guest_observer->web_contents()): NULL;
GURL url(src);
if (!guest_observer) {
- std::string host = render_view_host->GetSiteInstance()->GetSite().host();
+ std::string host = render_view_host->GetSiteInstance()->GetSiteURL().host();
GURL guest_url(
base::StringPrintf("%s://%s", chrome::kGuestScheme, host.c_str()));
// The SiteInstance of a given guest is based on the fact that it's a guest
diff --git a/content/browser/browsing_instance.cc b/content/browser/browsing_instance.cc
index 60daa5e..04fa657 100644
--- a/content/browser/browsing_instance.cc
+++ b/content/browser/browsing_instance.cc
@@ -48,7 +48,7 @@ void BrowsingInstance::RegisterSiteInstance(SiteInstance* site_instance) {
DCHECK(static_cast<SiteInstanceImpl*>(site_instance)->
browsing_instance_ == this);
DCHECK(static_cast<SiteInstanceImpl*>(site_instance)->HasSite());
- std::string site = site_instance->GetSite().possibly_invalid_spec();
+ std::string site = site_instance->GetSiteURL().possibly_invalid_spec();
// Only register if we don't have a SiteInstance for this site already.
// It's possible to have two SiteInstances point to the same site if two
@@ -66,7 +66,7 @@ void BrowsingInstance::UnregisterSiteInstance(SiteInstance* site_instance) {
DCHECK(static_cast<SiteInstanceImpl*>(site_instance)->
browsing_instance_ == this);
DCHECK(static_cast<SiteInstanceImpl*>(site_instance)->HasSite());
- std::string site = site_instance->GetSite().possibly_invalid_spec();
+ std::string site = site_instance->GetSiteURL().possibly_invalid_spec();
// Only unregister the SiteInstance if it is the same one that is registered
// for the site. (It might have been an unregistered SiteInstance. See the
diff --git a/content/browser/intents/intent_injector.cc b/content/browser/intents/intent_injector.cc
index 453d51d..6645760 100644
--- a/content/browser/intents/intent_injector.cc
+++ b/content/browser/intents/intent_injector.cc
@@ -58,7 +58,7 @@ void IntentInjector::SetIntent(
base::Bind(&IntentInjector::OnSendReturnMessage,
weak_factory_.GetWeakPtr()));
source_intent_.reset(new webkit_glue::WebIntentData(intent));
- initial_url_ = web_contents()->GetPendingSiteInstance()->GetSite();
+ initial_url_ = web_contents()->GetPendingSiteInstance()->GetSiteURL();
}
void IntentInjector::Abandon() {
@@ -78,7 +78,7 @@ void IntentInjector::RenderViewCreated(RenderViewHost* render_view_host) {
// Only deliver the intent to the renderer if it has the same origin
// as the initial delivery target.
if (initial_url_.GetOrigin() !=
- render_view_host->GetSiteInstance()->GetSite().GetOrigin()) {
+ render_view_host->GetSiteInstance()->GetSiteURL().GetOrigin()) {
return;
}
diff --git a/content/browser/renderer_host/pepper/pepper_message_filter.cc b/content/browser/renderer_host/pepper/pepper_message_filter.cc
index 0355a7c..dac6cc8 100644
--- a/content/browser/renderer_host/pepper/pepper_message_filter.cc
+++ b/content/browser/renderer_host/pepper/pepper_message_filter.cc
@@ -829,8 +829,8 @@ bool PepperMessageFilter::CanUseSocketAPIs(int32 render_id) {
if (!content::GetContentClient()->browser()->AllowPepperSocketAPI(
site_instance->GetBrowserContext(),
- site_instance->GetSite())) {
- LOG(ERROR) << "Host " << site_instance->GetSite().host()
+ site_instance->GetSiteURL())) {
+ LOG(ERROR) << "Host " << site_instance->GetSiteURL().host()
<< " cannot use socket API";
return false;
}
diff --git a/content/browser/renderer_host/render_view_host_manager_browsertest.cc b/content/browser/renderer_host/render_view_host_manager_browsertest.cc
index 401020b..e9177b8 100644
--- a/content/browser/renderer_host/render_view_host_manager_browsertest.cc
+++ b/content/browser/renderer_host/render_view_host_manager_browsertest.cc
@@ -1094,7 +1094,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, LeakingRenderViewHosts) {
GetRenderViewHost();
SiteInstance* blank_site_instance = blank_rvh->GetSiteInstance();
EXPECT_EQ(shell()->web_contents()->GetURL(), GURL::EmptyGURL());
- EXPECT_EQ(blank_site_instance->GetSite(), GURL::EmptyGURL());
+ EXPECT_EQ(blank_site_instance->GetSiteURL(), GURL::EmptyGURL());
rvh_observers.AddObserverToRVH(blank_rvh);
// Now navigate to the view-source URL and ensure we got a different
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index d8fcd0e..59a2aac 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -180,7 +180,7 @@ void SiteInstanceImpl::SetSite(const GURL& url) {
}
}
-const GURL& SiteInstanceImpl::GetSite() const {
+const GURL& SiteInstanceImpl::GetSiteURL() const {
return site_;
}
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h
index f8c7aba..9647f36 100644
--- a/content/browser/site_instance_impl.h
+++ b/content/browser/site_instance_impl.h
@@ -23,7 +23,7 @@ class CONTENT_EXPORT SiteInstanceImpl : public content::SiteInstance,
virtual int32 GetId() OVERRIDE;
virtual bool HasProcess() const OVERRIDE;
virtual content::RenderProcessHost* GetProcess() OVERRIDE;
- virtual const GURL& GetSite() const OVERRIDE;
+ virtual const GURL& GetSiteURL() const OVERRIDE;
virtual SiteInstance* GetRelatedSiteInstance(const GURL& url) OVERRIDE;
virtual bool IsRelatedSiteInstance(const SiteInstance* instance) OVERRIDE;
virtual content::BrowserContext* GetBrowserContext() const OVERRIDE;
diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc
index 8c7a39f..ce87d4e 100644
--- a/content/browser/site_instance_impl_unittest.cc
+++ b/content/browser/site_instance_impl_unittest.cc
@@ -349,10 +349,10 @@ TEST_F(SiteInstanceTest, SetSite) {
scoped_refptr<SiteInstanceImpl> instance(static_cast<SiteInstanceImpl*>(
SiteInstance::Create(NULL)));
EXPECT_FALSE(instance->HasSite());
- EXPECT_TRUE(instance->GetSite().is_empty());
+ EXPECT_TRUE(instance->GetSiteURL().is_empty());
instance->SetSite(GURL("http://www.google.com/index.html"));
- EXPECT_EQ(GURL("http://google.com"), instance->GetSite());
+ EXPECT_EQ(GURL("http://google.com"), instance->GetSiteURL());
EXPECT_TRUE(instance->HasSite());
@@ -662,7 +662,7 @@ TEST_F(SiteInstanceTest, HasWrongProcessForURL) {
SiteInstance::Create(browser_context.get())));
EXPECT_FALSE(instance->HasSite());
- EXPECT_TRUE(instance->GetSite().is_empty());
+ EXPECT_TRUE(instance->GetSiteURL().is_empty());
instance->SetSite(GURL("http://evernote.com/"));
EXPECT_TRUE(instance->HasSite());
diff --git a/content/browser/web_contents/navigation_controller_impl.cc b/content/browser/web_contents/navigation_controller_impl.cc
index 750ee37..56a9988 100644
--- a/content/browser/web_contents/navigation_controller_impl.cc
+++ b/content/browser/web_contents/navigation_controller_impl.cc
@@ -1303,7 +1303,7 @@ NavigationControllerImpl::GetSessionStorageNamespace(
// this if statement so |instance| must not be NULL.
partition_id =
GetContentClient()->browser()->GetStoragePartitionIdForSite(
- browser_context_, instance->GetSite());
+ browser_context_, instance->GetSiteURL());
}
SessionStorageNamespaceMap::const_iterator it =
diff --git a/content/browser/web_contents/navigation_controller_impl_unittest.cc b/content/browser/web_contents/navigation_controller_impl_unittest.cc
index 9a0d585..94cb61a 100644
--- a/content/browser/web_contents/navigation_controller_impl_unittest.cc
+++ b/content/browser/web_contents/navigation_controller_impl_unittest.cc
@@ -1873,7 +1873,7 @@ TEST_F(NavigationControllerTest, RestoreNavigate) {
EXPECT_EQ(url,
NavigationEntryImpl::FromNavigationEntry(
our_controller.GetLastCommittedEntry())->site_instance()->
- GetSite());
+ GetSiteURL());
EXPECT_EQ(NavigationEntryImpl::RESTORE_NONE,
NavigationEntryImpl::FromNavigationEntry(
our_controller.GetEntryAtIndex(0))->restore_type());
@@ -1957,7 +1957,7 @@ TEST_F(NavigationControllerTest, RestoreNavigateAfterFailure) {
EXPECT_EQ(url,
NavigationEntryImpl::FromNavigationEntry(
our_controller.GetLastCommittedEntry())->site_instance()->
- GetSite());
+ GetSiteURL());
EXPECT_EQ(NavigationEntryImpl::RESTORE_NONE,
NavigationEntryImpl::FromNavigationEntry(
our_controller.GetEntryAtIndex(0))->restore_type());
diff --git a/content/browser/web_contents/render_view_host_manager.cc b/content/browser/web_contents/render_view_host_manager.cc
index f858c49..c660803 100644
--- a/content/browser/web_contents/render_view_host_manager.cc
+++ b/content/browser/web_contents/render_view_host_manager.cc
@@ -406,7 +406,7 @@ bool RenderViewHostManager::ShouldSwapProcessesForNavigation(
// page and one isn't. If there's no curr_entry, check the current RVH's
// site, which might already be committed to a Web UI URL (such as the NTP).
const GURL& current_url = (curr_entry) ? curr_entry->GetURL() :
- render_view_host_->GetSiteInstance()->GetSite();
+ render_view_host_->GetSiteInstance()->GetSiteURL();
content::BrowserContext* browser_context =
delegate_->GetControllerForRenderManager().GetBrowserContext();
const WebUIControllerFactory* web_ui_factory =
@@ -577,7 +577,7 @@ SiteInstance* RenderViewHostManager::GetSiteInstanceForEntry(
// the page to a different same-site URL. (This seems very unlikely in
// practice.)
const GURL& current_url = (curr_entry) ? curr_entry->GetURL() :
- curr_instance->GetSite();
+ curr_instance->GetSiteURL();
// View-source URLs must use a new SiteInstance and BrowsingInstance.
// TODO(creis): Refactor this method so this duplicated code isn't needed.
@@ -798,7 +798,7 @@ RenderViewHostImpl* RenderViewHostManager::UpdateRendererStateForNavigate(
SiteInstance* new_instance = curr_instance;
const content::NavigationEntry* curr_entry =
delegate_->GetLastCommittedNavigationEntryForRenderManager();
- bool is_guest_scheme = curr_instance->GetSite().SchemeIs(
+ bool is_guest_scheme = curr_instance->GetSiteURL().SchemeIs(
chrome::kGuestScheme);
bool force_swap = ShouldSwapProcessesForNavigation(curr_entry, &entry);
if (!is_guest_scheme && (ShouldTransitionCrossSite() || force_swap))
diff --git a/content/browser/web_contents/render_view_host_manager_unittest.cc b/content/browser/web_contents/render_view_host_manager_unittest.cc
index 80a31f2..0ffde49 100644
--- a/content/browser/web_contents/render_view_host_manager_unittest.cc
+++ b/content/browser/web_contents/render_view_host_manager_unittest.cc
@@ -687,7 +687,7 @@ TEST_F(RenderViewHostManagerTest, WebUI) {
// get loaded in between.
EXPECT_TRUE(static_cast<SiteInstanceImpl*>(host->GetSiteInstance())->
HasSite());
- EXPECT_EQ(kUrl, host->GetSiteInstance()->GetSite());
+ EXPECT_EQ(kUrl, host->GetSiteInstance()->GetSiteURL());
// The Web UI is committed immediately because the RenderViewHost has not been
// used yet. UpdateRendererStateForNavigate() took the short cut path.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index c4ab6f5..6b75c91 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1309,7 +1309,7 @@ void WebContentsImpl::CreateNewWindow(
const std::string& partition_id =
content::GetContentClient()->browser()->
GetStoragePartitionIdForSite(GetBrowserContext(),
- site_instance->GetSite());
+ site_instance->GetSiteURL());
content::StoragePartition* partition =
BrowserContext::GetStoragePartition(GetBrowserContext(),
site_instance);