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

Unified Diff: chrome/browser/tab_contents/navigation_controller.cc

Issue 545054: Introduce all the plumbing for Session Storage. This mostly consists of crea... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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
Index: chrome/browser/tab_contents/navigation_controller.cc
===================================================================
--- chrome/browser/tab_contents/navigation_controller.cc (revision 36257)
+++ chrome/browser/tab_contents/navigation_controller.cc (working copy)
@@ -12,6 +12,8 @@
#include "chrome/browser/browser_about_handler.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_url_handler.h"
+#include "chrome/browser/in_process_webkit/dom_storage_context.h"
+#include "chrome/browser/in_process_webkit/webkit_context.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/sessions/session_types.h"
@@ -133,7 +135,9 @@
max_restored_page_id_(-1),
ALLOW_THIS_IN_INITIALIZER_LIST(ssl_manager_(this)),
needs_reload_(false),
- user_gesture_observed_(false) {
+ user_gesture_observed_(false),
+ session_storage_namespace_id_(profile->GetWebKitContext()->
+ dom_storage_context()->AllocateSessionStorageNamespaceId()) {
DCHECK(profile_);
}
@@ -144,6 +148,10 @@
NotificationType::TAB_CLOSED,
Source<NavigationController>(this),
NotificationService::NoDetails());
+
+ // When we go away, the session storage namespace will no longer be reachable.
+ profile_->GetWebKitContext()->DeleteSessionStorageNamespace(
+ session_storage_namespace_id_);
}
void NavigationController::RestoreFromState(
@@ -856,6 +864,10 @@
new NavigationEntry(*source.entries_[i])));
}
+ session_storage_namespace_id_ =
+ profile_->GetWebKitContext()->dom_storage_context()->CloneSessionStorage(
+ source.session_storage_namespace_id_);
+
FinishRestore(source.last_committed_entry_index_, false);
}
« no previous file with comments | « chrome/browser/tab_contents/navigation_controller.h ('k') | chrome/browser/tab_contents/render_view_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698