summaryrefslogtreecommitdiffstats
path: root/content/browser/web_contents
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/web_contents')
-rw-r--r--content/browser/web_contents/interstitial_page_impl.cc9
-rw-r--r--content/browser/web_contents/navigation_controller_impl.cc9
-rw-r--r--content/browser/web_contents/web_contents_impl.cc10
3 files changed, 17 insertions, 11 deletions
diff --git a/content/browser/web_contents/interstitial_page_impl.cc b/content/browser/web_contents/interstitial_page_impl.cc
index 1d53cb1..f2ac72e 100644
--- a/content/browser/web_contents/interstitial_page_impl.cc
+++ b/content/browser/web_contents/interstitial_page_impl.cc
@@ -32,6 +32,7 @@
#include "content/public/browser/invalidate_type.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/bindings_policy.h"
#include "content/public/common/page_transition_types.h"
@@ -487,14 +488,10 @@ RenderViewHost* InterstitialPageImpl::CreateRenderViewHost() {
BrowserContext* browser_context = web_contents()->GetBrowserContext();
scoped_refptr<SiteInstance> site_instance =
SiteInstance::Create(browser_context);
- const std::string& partition_id =
- content::GetContentClient()->browser()->
- GetStoragePartitionIdForSiteInstance(browser_context,
- site_instance);
DOMStorageContextImpl* dom_storage_context =
static_cast<DOMStorageContextImpl*>(
- BrowserContext::GetDOMStorageContextByPartitionId(browser_context,
- partition_id));
+ BrowserContext::GetStoragePartition(
+ browser_context, site_instance)->GetDOMStorageContext());
SessionStorageNamespaceImpl* session_storage_namespace_impl =
new SessionStorageNamespaceImpl(dom_storage_context);
diff --git a/content/browser/web_contents/navigation_controller_impl.cc b/content/browser/web_contents/navigation_controller_impl.cc
index 28ad4a4..877a446 100644
--- a/content/browser/web_contents/navigation_controller_impl.cc
+++ b/content/browser/web_contents/navigation_controller_impl.cc
@@ -27,6 +27,7 @@
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/content_client.h"
@@ -1269,11 +1270,15 @@ NavigationControllerImpl::GetSessionStorageNamespace(
return it->second.get();
// Create one if no one has accessed session storage for this partition yet.
+ //
+ // TODO(ajwong): Should this use the |partition_id| directly rather than
+ // re-lookup via |instance|? http://crbug.com/142685
+ content::StoragePartition* partition =
+ BrowserContext::GetStoragePartition(browser_context_, instance);
SessionStorageNamespaceImpl* session_storage_namespace =
new SessionStorageNamespaceImpl(
static_cast<DOMStorageContextImpl*>(
- BrowserContext::GetDOMStorageContextByPartitionId(
- browser_context_, partition_id)));
+ partition->GetDOMStorageContext()));
session_storage_namespace_map_[partition_id] = session_storage_namespace;
return session_storage_namespace;
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index d4c3dafb..61d98d8 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -54,6 +54,7 @@
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/resource_request_details.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
@@ -1247,14 +1248,17 @@ void WebContentsImpl::CreateNewWindow(
params.opener_suppressed ? NULL : this);
// We must assign the SessionStorageNamespace before calling Init().
+ //
+ // http://crbug.com/142685
const std::string& partition_id =
content::GetContentClient()->browser()->
GetStoragePartitionIdForSiteInstance(GetBrowserContext(),
site_instance);
+ content::StoragePartition* partition =
+ BrowserContext::GetStoragePartition(GetBrowserContext(),
+ site_instance);
DOMStorageContextImpl* dom_storage_context =
- static_cast<DOMStorageContextImpl*>(
- BrowserContext::GetDOMStorageContextByPartitionId(
- GetBrowserContext(), partition_id));
+ static_cast<DOMStorageContextImpl*>(partition->GetDOMStorageContext());
SessionStorageNamespaceImpl* session_storage_namespace_impl =
static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));