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

Unified Diff: chrome/browser/ui/browser_tabrestore.cc

Issue 10831116: Move SessionStorageNamespace entirely into NavigationController and support StoragePartitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix content shell Created 8 years, 5 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/ui/browser_tabrestore.cc
diff --git a/chrome/browser/ui/browser_tabrestore.cc b/chrome/browser/ui/browser_tabrestore.cc
index 01624985809f3d27bd99d2b0f6df0b50e5348407..c3da63ea7527aca5f42e7199a7ad70d31b0bfd2b 100644
--- a/chrome/browser/ui/browser_tabrestore.cc
+++ b/chrome/browser/ui/browser_tabrestore.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.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 "ipc/ipc_message.h"
@@ -39,14 +40,21 @@ content::WebContents* AddRestoredTab(
bool select,
bool pin,
bool from_last_session,
- content::SessionStorageNamespace* storage_namespace) {
+ content::SessionStorageNamespace* session_storage_namespace) {
GURL restore_url = navigations.at(selected_navigation).virtual_url();
- TabContents* tab_contents = chrome::TabContentsFactory(
+ // TODO(ajwong): Remove the temporary session_storage_namespace_map when
+ // we teach session restore to understand that one tab can have multiple
+ // SessionStorageNamespace objects. Also remove the
+ // session_storage_namespace.h include since we only need that to assign
+ // into the map.
+ content::SessionStorageNamespaceMap session_storage_namespace_map;
+ session_storage_namespace_map[""] = session_storage_namespace;
+ TabContents* tab_contents = chrome::TabContentsFactoryWithSessionStorage(
browser->profile(),
tab_util::GetSiteInstanceForNewTab(browser->profile(), restore_url),
MSG_ROUTING_NONE,
chrome::GetActiveWebContents(browser),
- storage_namespace);
+ session_storage_namespace_map);
WebContents* new_tab = tab_contents->web_contents();
tab_contents->extension_tab_helper()->SetExtensionAppById(extension_app_id);
std::vector<NavigationEntry*> entries;
@@ -94,12 +102,19 @@ void ReplaceRestoredTab(
const std::string& extension_app_id,
content::SessionStorageNamespace* session_storage_namespace) {
GURL restore_url = navigations.at(selected_navigation).virtual_url();
- TabContents* tab_contents = chrome::TabContentsFactory(
+ // TODO(ajwong): Remove the temporary session_storage_namespace_map when
+ // we teach session restore to understand that one tab can have multiple
+ // SessionStorageNamespace objects. Also remove the
+ // session_storage_namespace.h include since we only need that to assign
+ // into the map.
+ content::SessionStorageNamespaceMap session_storage_namespace_map;
+ session_storage_namespace_map[""] = session_storage_namespace;
+ TabContents* tab_contents = chrome::TabContentsFactoryWithSessionStorage(
browser->profile(),
tab_util::GetSiteInstanceForNewTab(browser->profile(), restore_url),
MSG_ROUTING_NONE,
GetActiveWebContents(browser),
- session_storage_namespace);
+ session_storage_namespace_map);
tab_contents->extension_tab_helper()->SetExtensionAppById(extension_app_id);
WebContents* replacement = tab_contents->web_contents();
std::vector<NavigationEntry*> entries;

Powered by Google App Engine
This is Rietveld 408576698