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

Unified Diff: content/browser/web_contents/interstitial_page_impl.cc

Issue 10831116: Move SessionStorageNamespace entirely into NavigationController and support StoragePartitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged ToT 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/web_contents/interstitial_page_impl.cc
diff --git a/content/browser/web_contents/interstitial_page_impl.cc b/content/browser/web_contents/interstitial_page_impl.cc
index 32493badc9ec3f89df8e9fd2c008e575424567c2..1d53cb196e558f5bceea55a985e3e961b9423516 100644
--- a/content/browser/web_contents/interstitial_page_impl.cc
+++ b/content/browser/web_contents/interstitial_page_impl.cc
@@ -12,6 +12,8 @@
#include "base/string_util.h"
#include "base/threading/thread.h"
#include "base/utf_string_conversions.h"
+#include "content/browser/dom_storage/dom_storage_context_impl.h"
+#include "content/browser/dom_storage/session_storage_namespace_impl.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/resource_dispatcher_host_impl.h"
@@ -22,7 +24,9 @@
#include "content/common/view_messages.h"
#include "content/port/browser/render_view_host_delegate_view.h"
#include "content/port/browser/render_widget_host_view_port.h"
+#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/dom_operation_notification_details.h"
#include "content/public/browser/interstitial_page_delegate.h"
#include "content/public/browser/invalidate_type.h"
@@ -227,7 +231,7 @@ void InterstitialPageImpl::Show() {
// Give delegates a chance to set some states on the navigation entry.
delegate_->OverrideEntry(entry);
- web_contents_->GetControllerImpl().AddTransientEntry(entry);
+ web_contents_->GetController().AddTransientEntry(entry);
}
DCHECK(!render_view_host_);
@@ -477,9 +481,26 @@ WebContents* InterstitialPageImpl::web_contents() const {
}
RenderViewHost* InterstitialPageImpl::CreateRenderViewHost() {
+ // Interstitial pages don't want to share the session storage so we mint a
+ // new one.
+ using content::BrowserContext;
+ 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));
+ SessionStorageNamespaceImpl* session_storage_namespace_impl =
+ new SessionStorageNamespaceImpl(dom_storage_context);
+
RenderViewHostImpl* render_view_host = new RenderViewHostImpl(
- SiteInstance::Create(web_contents()->GetBrowserContext()), this, this,
- MSG_ROUTING_NONE, false, NULL);
+ site_instance, this, this, MSG_ROUTING_NONE, false,
+ session_storage_namespace_impl);
web_contents_->RenderViewForInterstitialPageCreated(render_view_host);
return render_view_host;
}
« no previous file with comments | « content/browser/site_instance_impl_unittest.cc ('k') | content/browser/web_contents/navigation_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698