summaryrefslogtreecommitdiffstats
path: root/content/browser/web_contents/web_contents_impl.cc
diff options
context:
space:
mode:
authormarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-20 01:06:30 +0000
committermarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-20 01:06:30 +0000
commitfdac6adeae4bd9a79b4d93d006d96ac2bd902bde (patch)
treede319c63b9d50a17de408b7f4daf12da1a8c0329 /content/browser/web_contents/web_contents_impl.cc
parent243f55f68ef7a32d3d1c7f11ff26dfcf5cdda112 (diff)
downloadchromium_src-fdac6adeae4bd9a79b4d93d006d96ac2bd902bde.zip
chromium_src-fdac6adeae4bd9a79b4d93d006d96ac2bd902bde.tar.gz
chromium_src-fdac6adeae4bd9a79b4d93d006d96ac2bd902bde.tar.bz2
Revert "Fix SessionStorage confusion between RenderViewHostImpl and NavigationController."
Reason: There's something wrong with the StoragePartition cleanup, see comments in https://codereview.chromium.org/19756002/. BUG= TBR=michaeln@chromium.org Review URL: https://chromiumcodereview.appspot.com/19765009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212711 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/web_contents/web_contents_impl.cc')
-rw-r--r--content/browser/web_contents/web_contents_impl.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 53fb4bc..068f7c9 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -272,11 +272,18 @@ WebContents* WebContents::Create(const WebContents::CreateParams& params) {
WebContents* WebContents::CreateWithSessionStorage(
const WebContents::CreateParams& params,
- SessionStorageNamespace* session_storage_namespace) {
+ const SessionStorageNamespaceMap& session_storage_namespace_map) {
WebContentsImpl* new_contents = new WebContentsImpl(
params.browser_context, NULL);
- new_contents->GetController()
- .SetSessionStorageNamespace(session_storage_namespace);
+
+ for (SessionStorageNamespaceMap::const_iterator it =
+ session_storage_namespace_map.begin();
+ it != session_storage_namespace_map.end();
+ ++it) {
+ new_contents->GetController()
+ .SetSessionStorageNamespace(it->first, it->second.get());
+ }
+
new_contents->Init(params);
return new_contents;
}
@@ -1460,6 +1467,10 @@ void WebContentsImpl::CreateNewWindow(
// We must assign the SessionStorageNamespace before calling Init().
//
// http://crbug.com/142685
+ const std::string& partition_id =
+ GetContentClient()->browser()->
+ GetStoragePartitionIdForSite(GetBrowserContext(),
+ site_instance->GetSiteURL());
StoragePartition* partition = BrowserContext::GetStoragePartition(
GetBrowserContext(), site_instance.get());
DOMStorageContextImpl* dom_storage_context =
@@ -1468,6 +1479,7 @@ void WebContentsImpl::CreateNewWindow(
static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
new_contents->GetController().SetSessionStorageNamespace(
+ partition_id,
session_storage_namespace);
CreateParams create_params(GetBrowserContext(), site_instance.get());
create_params.routing_id = route_id;
@@ -1687,10 +1699,6 @@ void WebContentsImpl::RequestMediaAccessPermission(
callback.Run(MediaStreamDevices(), scoped_ptr<MediaStreamUI>());
}
-SessionStorageNamespace* WebContentsImpl::GetSessionStorageNamespace() {
- return controller_.GetSessionStorageNamespace();
-}
-
void WebContentsImpl::DidSendScreenRects(RenderWidgetHostImpl* rwh) {
if (browser_plugin_embedder_)
browser_plugin_embedder_->DidSendScreenRects();