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

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

Issue 8929007: Restore sessionStorage when chrome restarts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix: cloning storage areas. Created 8 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/sessions/session_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_restore.cc
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index 9f8e83b98e83b74f03bcf0ae743d751df36902e3..0c11fc7ae4ea42318c8ef9b6f3ff4277e0ca4a47 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -29,6 +29,9 @@
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/chrome_notification_types.h"
+#include "content/browser/in_process_webkit/dom_storage_namespace.h"
+#include "content/browser/in_process_webkit/session_storage_namespace.h"
+#include "content/browser/in_process_webkit/webkit_context.h"
#include "content/browser/renderer_host/render_widget_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/public/browser/navigation_controller.h"
@@ -399,6 +402,13 @@ void TabLoader::HandleTabClosedOrLoaded(NavigationController* tab) {
}
}
+void RestoreSessionStorage(WebKitContext* webkit_context,
+ int64 namespace_id,
+ const FilePath& session_storage_directory) {
+ webkit_context->dom_storage_context()->RecreateSessionStorageNamespace(
+ namespace_id, session_storage_directory);
+}
+
// SessionRestoreImpl ---------------------------------------------------------
// SessionRestoreImpl is responsible for fetching the set of tabs to create
@@ -732,6 +742,16 @@ class SessionRestoreImpl : public content::NotificationObserver {
tab.pinned,
true,
NULL);
+ int64 namespace_id =
+ web_contents->GetController().GetSessionStorageNamespace()->id();
+
+ content::BrowserThread::PostTask(
+ content::BrowserThread::WEBKIT_DEPRECATED, FROM_HERE,
+ base::Bind(&RestoreSessionStorage,
+ make_scoped_refptr(
+ web_contents->GetBrowserContext()->GetWebKitContext()),
+ namespace_id, tab.session_storage_directory));
+
if (schedule_load)
tab_loader_->ScheduleLoad(&web_contents->GetController());
}
« no previous file with comments | « no previous file | chrome/browser/sessions/session_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698