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

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: Draft: associate with session restore. Created 8 years, 7 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 ffea378ce7c3c9325ce2b1387bcc5d231c1adacb..13a52e25e341e64534ab78aeccb243df8f4e45c2 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -32,12 +32,14 @@
#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"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
+#include "content/public/browser/session_storage_namespace.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "net/base/network_change_notifier.h"
@@ -886,6 +888,17 @@ class SessionRestoreImpl : public content::NotificationObserver {
// focused tab will be loaded by Browser, and TabLoader will load the rest.
DCHECK(web_contents->GetController().NeedsReload());
+ // Associate session storage.
+ if (tab.session_storage_real_id_associated) {
+ int64 namespace_id =
+ web_contents->GetController().GetSessionStorageNamespace()->id();
+ content::DOMStorageContext* dom_storage_context =
+ content::BrowserContext::GetDOMStorageContext(
+ web_contents->GetBrowserContext());
+ dom_storage_context-> AssociateSessionStorage(
+ namespace_id, tab.session_storage_real_id);
+ }
+
// Set up the file access rights for the selected navigation entry.
const int id = web_contents->GetRenderProcessHost()->GetID();
const int read_file_permissions =
« no previous file with comments | « no previous file | chrome/browser/sessions/session_service.h » ('j') | chrome/browser/sessions/session_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698