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

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

Issue 1331173002: Eliminate BaseSessionServiceDelegateImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@persistent_tab_restore_service_client
Patch Set: 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/session_service.cc
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
index 6db79705ece69a44f19b9d48d6340154a9abbf68..6bf364d2e2a79e4a16db05644e79f64f3d5105b1 100644
--- a/chrome/browser/sessions/session_service.cc
+++ b/chrome/browser/sessions/session_service.cc
@@ -24,7 +24,7 @@
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/sessions/base_session_service_delegate_impl.h"
+#include "chrome/browser/sessions/session_common_utils.h"
#include "chrome/browser/sessions/session_data_deleter.h"
#include "chrome/browser/sessions/session_restore.h"
#include "chrome/browser/sessions/session_service_utils.h"
@@ -64,13 +64,12 @@ static const int kWritesPerReset = 250;
// SessionService -------------------------------------------------------------
SessionService::SessionService(Profile* profile)
- : BaseSessionServiceDelegateImpl(true),
- profile_(profile),
- base_session_service_(
- new sessions::BaseSessionService(
- sessions::BaseSessionService::SESSION_RESTORE,
- profile->GetPath(),
- this)),
+ : profile_(profile),
+ should_use_delayed_save_(true),
+ base_session_service_(new sessions::BaseSessionService(
+ sessions::BaseSessionService::SESSION_RESTORE,
+ profile->GetPath(),
+ this)),
has_open_trackable_browsers_(false),
move_on_new_browser_(false),
save_delay_in_millis_(base::TimeDelta::FromMilliseconds(2500)),
@@ -84,13 +83,12 @@ SessionService::SessionService(Profile* profile)
}
SessionService::SessionService(const base::FilePath& save_path)
- : BaseSessionServiceDelegateImpl(false),
- profile_(NULL),
- base_session_service_(
- new sessions::BaseSessionService(
- sessions::BaseSessionService::SESSION_RESTORE,
- save_path,
- this)),
+ : profile_(NULL),
+ should_use_delayed_save_(false),
+ base_session_service_(new sessions::BaseSessionService(
+ sessions::BaseSessionService::SESSION_RESTORE,
+ save_path,
+ this)),
has_open_trackable_browsers_(false),
move_on_new_browser_(false),
save_delay_in_millis_(base::TimeDelta::FromMilliseconds(2500)),
@@ -509,6 +507,15 @@ base::CancelableTaskTracker::TaskId SessionService::GetLastSession(
tracker);
}
+base::SequencedWorkerPool* SessionService::GetBlockingPool() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ return content::BrowserThread::GetBlockingPool();
+}
+
+bool SessionService::ShouldUseDelayedSave() {
+ return should_use_delayed_save_;
+}
+
void SessionService::OnSavedCommands() {
RecordSessionUpdateHistogramData(chrome::NOTIFICATION_SESSION_SERVICE_SAVED,
&last_updated_save_time_);

Powered by Google App Engine
This is Rietveld 408576698