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

Unified Diff: chrome/browser/sessions/session_restore.cc

Issue 9963107: Persist sessionStorage on disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 8 years, 6 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: 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());

Powered by Google App Engine
This is Rietveld 408576698