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

Unified Diff: content/browser/site_instance_impl.cc

Issue 10837230: Move StoragePartition into content/public and remove BrowserContext::GetDOMStorageContext(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove DISALLOW_COPY_AND_ASSIGN, and change RPH::CreateMessageFilters() to not suddenly isolate all… Created 8 years, 4 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
Index: content/browser/site_instance_impl.cc
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index bded90208fe147f8cc542cc95cd572ba1e420a25..d8fcd0e2e32b3cf3c3fa10248d04fa1534a6961f 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -8,6 +8,7 @@
#include "content/browser/browsing_instance.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
+#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
@@ -17,9 +18,11 @@
#include "content/public/common/url_constants.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
+using content::BrowserContext;
using content::RenderProcessHost;
using content::RenderProcessHostImpl;
using content::SiteInstance;
+using content::StoragePartitionImpl;
using content::WebUIControllerFactory;
static bool IsURLSameAsAnySiteInstance(const GURL& url) {
@@ -93,8 +96,7 @@ RenderProcessHost* SiteInstanceImpl::GetProcess() {
// Create a new process if ours went away or was reused.
if (!process_) {
- content::BrowserContext* browser_context =
- browsing_instance_->browser_context();
+ BrowserContext* browser_context = browsing_instance_->browser_context();
// If we should use process-per-site mode (either in general or for the
// given site), then look for an existing RenderProcessHost for the site.
@@ -118,8 +120,11 @@ RenderProcessHost* SiteInstanceImpl::GetProcess() {
process_ = render_process_host_factory_->CreateRenderProcessHost(
browser_context);
} else {
+ StoragePartitionImpl* partition =
+ static_cast<StoragePartitionImpl*>(
+ BrowserContext::GetStoragePartition(browser_context, this));
process_ =
- new RenderProcessHostImpl(browser_context,
+ new RenderProcessHostImpl(browser_context, partition,
site_.SchemeIs(chrome::kGuestScheme));
}
}
@@ -154,8 +159,7 @@ void SiteInstanceImpl::SetSite(const GURL& url) {
// Remember that this SiteInstance has been used to load a URL, even if the
// URL is invalid.
has_site_ = true;
- content::BrowserContext* browser_context =
- browsing_instance_->browser_context();
+ BrowserContext* browser_context = browsing_instance_->browser_context();
site_ = GetSiteForURL(browser_context, url);
// Now that we have a site, register it with the BrowsingInstance. This
@@ -214,18 +218,18 @@ bool SiteInstanceImpl::HasWrongProcessForURL(const GURL& url) const {
process_, browsing_instance_->browser_context(), site_url);
}
-content::BrowserContext* SiteInstanceImpl::GetBrowserContext() const {
+BrowserContext* SiteInstanceImpl::GetBrowserContext() const {
return browsing_instance_->browser_context();
}
/*static*/
-SiteInstance* SiteInstance::Create(content::BrowserContext* browser_context) {
+SiteInstance* SiteInstance::Create(BrowserContext* browser_context) {
return new SiteInstanceImpl(new BrowsingInstance(browser_context));
}
/*static*/
-SiteInstance* SiteInstance::CreateForURL(
- content::BrowserContext* browser_context, const GURL& url) {
+SiteInstance* SiteInstance::CreateForURL(BrowserContext* browser_context,
+ const GURL& url) {
// This BrowsingInstance may be deleted if it returns an existing
// SiteInstance.
scoped_refptr<BrowsingInstance> instance(
@@ -234,7 +238,7 @@ SiteInstance* SiteInstance::CreateForURL(
}
/*static*/
-GURL SiteInstanceImpl::GetSiteForURL(content::BrowserContext* browser_context,
+GURL SiteInstanceImpl::GetSiteForURL(BrowserContext* browser_context,
const GURL& real_url) {
// TODO(fsamuel, creis): For some reason appID is not recognized as a host.
if (real_url.SchemeIs(chrome::kGuestScheme))
@@ -274,7 +278,7 @@ GURL SiteInstanceImpl::GetSiteForURL(content::BrowserContext* browser_context,
}
/*static*/
-bool SiteInstance::IsSameWebSite(content::BrowserContext* browser_context,
+bool SiteInstance::IsSameWebSite(BrowserContext* browser_context,
const GURL& real_url1,
const GURL& real_url2) {
GURL url1 = SiteInstanceImpl::GetEffectiveURL(browser_context, real_url1);
@@ -303,9 +307,8 @@ bool SiteInstance::IsSameWebSite(content::BrowserContext* browser_context,
}
/*static*/
-GURL SiteInstanceImpl::GetEffectiveURL(
- content::BrowserContext* browser_context,
- const GURL& url) {
+GURL SiteInstanceImpl::GetEffectiveURL(BrowserContext* browser_context,
+ const GURL& url) {
return content::GetContentClient()->browser()->
GetEffectiveURL(browser_context, url);
}
@@ -327,4 +330,3 @@ void SiteInstanceImpl::LockToOrigin() {
policy->LockToOrigin(process_->GetID(), site_);
}
}
-
« no previous file with comments | « content/browser/renderer_host/test_render_view_host.cc ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698