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

Unified Diff: chrome/browser/sessions/tab_restore_service_helper.cc

Issue 1343833002: Abstract content::SessionStorageNamespace from core TabRestore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extension_tab_helper
Patch Set: Response to review Created 5 years, 3 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/tab_restore_service_helper.cc
diff --git a/chrome/browser/sessions/tab_restore_service_helper.cc b/chrome/browser/sessions/tab_restore_service_helper.cc
index 6c492c1f7108ad4f312cd01a0c80e898a475494a..864f36e0f0ec53c7a95533f99a3b762ccfb1c1ff 100644
--- a/chrome/browser/sessions/tab_restore_service_helper.cc
+++ b/chrome/browser/sessions/tab_restore_service_helper.cc
@@ -17,7 +17,6 @@
#include "components/sessions/session_types.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"
using content::NavigationController;
@@ -217,14 +216,10 @@ std::vector<content::WebContents*> TabRestoreServiceHelper::RestoreEntryById(
for (size_t tab_i = 0; tab_i < window->tabs.size(); ++tab_i) {
const Tab& tab = window->tabs[tab_i];
WebContents* restored_tab = delegate->AddRestoredTab(
- tab.navigations,
- delegate->GetTabCount(),
- tab.current_navigation_index,
- tab.extension_app_id,
- static_cast<int>(tab_i) == window->selected_tab_index,
- tab.pinned,
- tab.from_last_session,
- tab.session_storage_namespace.get(),
+ tab.navigations, delegate->GetTabCount(),
+ tab.current_navigation_index, tab.extension_app_id,
+ static_cast<int>(tab_i) == window->selected_tab_index, tab.pinned,
+ tab.from_last_session, tab.client_data.get(),
tab.user_agent_override);
if (restored_tab) {
restored_tab->GetController().LoadIfNecessary();
@@ -401,9 +396,8 @@ void TabRestoreServiceHelper::PopulateTab(
tab->user_agent_override =
controller->GetWebContents()->GetUserAgentOverride();
- // TODO(ajwong): This does not correctly handle storage for isolated apps.
- tab->session_storage_namespace =
- controller->GetDefaultSessionStorageNamespace();
+ tab->client_data =
+ client_->GetTabClientDataForWebContents(controller->GetWebContents());
// Delegate may be NULL during unit tests.
if (delegate) {
@@ -421,12 +415,8 @@ TabRestoreServiceDelegate* TabRestoreServiceHelper::RestoreTab(
WebContents* web_contents;
if (disposition == CURRENT_TAB && delegate) {
web_contents = delegate->ReplaceRestoredTab(
- tab.navigations,
- tab.current_navigation_index,
- tab.from_last_session,
- tab.extension_app_id,
- tab.session_storage_namespace.get(),
- tab.user_agent_override);
+ tab.navigations, tab.current_navigation_index, tab.from_last_session,
+ tab.extension_app_id, tab.client_data.get(), tab.user_agent_override);
} else {
// We only respsect the tab's original browser if there's no disposition.
if (disposition == UNKNOWN && tab.has_browser()) {
@@ -455,15 +445,10 @@ TabRestoreServiceDelegate* TabRestoreServiceHelper::RestoreTab(
tab_index = delegate->GetTabCount();
}
- web_contents = delegate->AddRestoredTab(tab.navigations,
- tab_index,
- tab.current_navigation_index,
- tab.extension_app_id,
- disposition != NEW_BACKGROUND_TAB,
- tab.pinned,
- tab.from_last_session,
- tab.session_storage_namespace.get(),
- tab.user_agent_override);
+ web_contents = delegate->AddRestoredTab(
+ tab.navigations, tab_index, tab.current_navigation_index,
+ tab.extension_app_id, disposition != NEW_BACKGROUND_TAB, tab.pinned,
+ tab.from_last_session, tab.client_data.get(), tab.user_agent_override);
web_contents->GetController().LoadIfNecessary();
}
client_->OnTabRestored(
« no previous file with comments | « chrome/browser/sessions/tab_restore_service_delegate.h ('k') | chrome/browser/ui/browser_tab_restore_service_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698