Index: chrome/browser/sessions/session_restore.cc |
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc |
index bb6cbbe1688c3a14d306c5339f45010a657722aa..189496bebaf63b9fee8e9961d839b735ec3ce2ae 100644 |
--- a/chrome/browser/sessions/session_restore.cc |
+++ b/chrome/browser/sessions/session_restore.cc |
@@ -32,6 +32,7 @@ |
#include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
#include "chrome/common/chrome_notification_types.h" |
#include "content/public/browser/child_process_security_policy.h" |
+#include "content/public/browser/dom_storage_context.h" |
#include "content/public/browser/navigation_controller.h" |
#include "content/public/browser/notification_registrar.h" |
#include "content/public/browser/notification_service.h" |
@@ -51,6 +52,10 @@ using content::NavigationController; |
using content::RenderWidgetHost; |
using content::WebContents; |
+namespace content { |
+class SessinStorageNamespace; |
+} // namespace content |
+ |
namespace { |
class SessionRestoreImpl; |
@@ -875,6 +880,14 @@ class SessionRestoreImpl : public content::NotificationObserver { |
RecordAppLaunchForTab(browser, tab, selected_index); |
+ // Associate sessionStorage (if any) to the restored tab. |
+ content::SessionStorageNamespace* session_storage_namespace = NULL; |
michaeln
2012/06/05 01:41:07
probably s/b a scoped_refptr<> here
marja
2012/06/06 13:37:10
Done.
|
+ if (!tab.session_storage_persistent_id.empty()) { |
+ session_storage_namespace = |
+ content::BrowserContext::GetDOMStorageContext(profile_)-> |
+ CreateSessionStorage(tab.session_storage_persistent_id); |
+ } |
+ |
WebContents* web_contents = |
browser->AddRestoredTab(tab.navigations, |
tab_index, |
@@ -883,7 +896,7 @@ class SessionRestoreImpl : public content::NotificationObserver { |
false, // select |
tab.pinned, |
true, |
- NULL); |
+ session_storage_namespace); |
// Regression check: check that the tab didn't start loading right away. The |
// focused tab will be loaded by Browser, and TabLoader will load the rest. |
DCHECK(web_contents->GetController().NeedsReload()); |