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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 9985002: Allow SessionService to be disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed sky's comments Created 8 years, 9 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
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/profiles/profile_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 0ebfc0157cce468c45c4a565b028ed89d4a2e452..b07507ec3d453e62117f2205d589610d80b140ac 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -124,8 +124,10 @@ namespace {
COMPILE_ASSERT(sizeof(ProfileImpl) <= 744u, profile_impl_size_unexpected);
#endif
+#if defined(ENABLE_SESSION_SERVICE)
// Delay, in milliseconds, before we explicitly create the SessionService.
static const int kCreateSessionServiceDelayMS = 500;
+#endif
// Text content of README file created in each profile directory. Both %s
// placeholders must contain the product name. This is not localizable and hence
@@ -233,9 +235,11 @@ ProfileImpl::ProfileImpl(const FilePath& path,
DCHECK(!path.empty()) << "Using an empty path will attempt to write " <<
"profile files to the root directory!";
+#if defined(ENABLE_SESSION_SERVICE)
create_session_service_timer_.Start(FROM_HERE,
TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this,
&ProfileImpl::EnsureSessionServiceCreated);
+#endif
// Determine if prefetch is enabled for this profile.
// If not profile_manager is present, it means we are in a unittest.
@@ -459,7 +463,9 @@ ProfileImpl::~ProfileImpl() {
else if (session_restore_enabled_ && pref.type == SessionStartupPref::LAST)
BrowserContext::SaveSessionState(this);
+#if defined(ENABLE_SESSION_SERVICE)
StopCreateSessionServiceTimer();
+#endif
// Remove pref observers
pref_change_registrar_.RemoveAll();
@@ -962,6 +968,7 @@ void ProfileImpl::Observe(int type,
}
}
+#if defined(ENABLE_SESSION_SERVICE)
void ProfileImpl::StopCreateSessionServiceTimer() {
create_session_service_timer_.Stop();
}
@@ -969,6 +976,7 @@ void ProfileImpl::StopCreateSessionServiceTimer() {
void ProfileImpl::EnsureSessionServiceCreated() {
SessionServiceFactory::GetForProfile(this);
}
+#endif
ChromeURLDataManager* ProfileImpl::GetChromeURLDataManager() {
if (!chrome_url_data_manager_.get())
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/profiles/profile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698