| 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);
|
| }
|
|
|
|
|