Chromium Code Reviews| 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..2d18cf2cffec2fee2cda8cf99ba1987733732541 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); |
|
michaeln
2012/08/10 19:54:55
This recipe for getting the default partition and
awong
2012/08/10 21:11:53
Ack...this is a straight up bug.
The site_instanc
|
| + DOMStorageContextImpl* dom_storage_context = |
| + static_cast<DOMStorageContextImpl*>( |
| + BrowserContext::GetDOMStorageContextByPartitionId(browser_context, |
|
michaeln
2012/08/08 22:28:53
Can this be simplified to GetDefaultDOMStorageCont
awong
2012/08/09 01:51:43
The goal is to completely remove GetDefaultDOMStor
|
| + 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); |
| + MSG_ROUTING_NONE, false, session_storage_namespace_impl); |
| web_contents_->RenderViewForInterstitialPageCreated(render_view_host); |
| return render_view_host; |
| } |