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

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

Issue 6901031: Profile shouldn't own Session/TabRestore services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again and hope upload works this time Created 9 years, 8 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.cc
diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc
index 1e81bb1045f203a5a5165b2a450d829206b8aecd..4076dee25abdbe8abee07fb7ff5f8b40d9c1137f 100644
--- a/chrome/browser/sessions/tab_restore_service.cc
+++ b/chrome/browser/sessions/tab_restore_service.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/extensions/extension_tab_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_service.h"
+#include "chrome/browser/sessions/session_service_factory.h"
#include "chrome/browser/sessions/session_command.h"
#include "chrome/browser/sessions/session_types.h"
#include "chrome/browser/sessions/tab_restore_service_delegate.h"
@@ -420,13 +421,14 @@ void TabRestoreService::LoadTabsFromLastSession() {
load_state_ = LOADING;
+ SessionService* session_service =
+ SessionServiceFactory::GetForProfile(profile());
if (!profile()->restored_last_session() &&
!profile()->DidLastSessionExitCleanly() &&
- profile()->GetSessionService()) {
+ session_service) {
// The previous session crashed and wasn't restored. Load the tabs/windows
// that were open at the point of crash from the session service.
- profile()->GetSessionService()->GetLastSession(
- &load_consumer_,
+ session_service->GetLastSession(&load_consumer_,
NewCallback(this, &TabRestoreService::OnGotPreviousSession));
} else {
load_state_ |= LOADED_LAST_SESSION;
« no previous file with comments | « chrome/browser/sessions/session_service_factory.cc ('k') | chrome/browser/sessions/tab_restore_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698