Chromium Code Reviews| Index: chrome/browser/sessions/session_restore.cc |
| diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc |
| index 0931ae0c809fad9cf319fe1b23b284e4cb7ee90c..f4737a29a3eac5fef5224f15371b7291d4269a09 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/browser/tab_contents/navigation_controller.h" |
| @@ -729,10 +732,30 @@ class SessionRestoreImpl : public content::NotificationObserver { |
| tab.pinned, |
| true, |
| NULL); |
| + int64 namespace_id = |
| + tab_contents->controller().session_storage_namespace()->id(); |
| + |
| + DOMStorageContext* dom_storage_context = |
| + tab_contents->browser_context()->GetWebKitContext()-> |
| + dom_storage_context(); |
| + |
| + content::BrowserThread::PostTask( |
| + content::BrowserThread::WEBKIT, FROM_HERE, |
| + base::Bind(&SessionRestoreImpl::RestoreSessionStorage, |
| + base::Unretained(this), dom_storage_context, namespace_id, |
|
michaeln
2011/12/13 20:40:03
what ensures 'this' is still valid when the task e
marja
2012/01/17 16:21:49
This is fixed now; WebKitContext is refcounted.
|
| + tab.session_storage_directory)); |
| + |
| if (schedule_load) |
| tab_loader_->ScheduleLoad(&tab_contents->controller()); |
| } |
| + void RestoreSessionStorage(DOMStorageContext* dom_storage_context, |
| + int64 namespace_id, |
| + const FilePath& session_storage_directory) { |
| + dom_storage_context->RecreateSessionStorageNamespace( |
| + namespace_id, session_storage_directory); |
| + } |
| + |
| Browser* CreateRestoredBrowser(Browser::Type type, |
| gfx::Rect bounds, |
| ui::WindowShowState show_state) { |