summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-15 20:54:57 +0000
committerstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-15 20:54:57 +0000
commitfeb099646fb6f770f24532630722f1f98ad1a901 (patch)
tree3df7be87973e114c2bcefb6d565d5e569825216d /chrome/browser
parent22611c632574687325aa2ebeea896594fb83fbc3 (diff)
downloadchromium_src-feb099646fb6f770f24532630722f1f98ad1a901.zip
chromium_src-feb099646fb6f770f24532630722f1f98ad1a901.tar.gz
chromium_src-feb099646fb6f770f24532630722f1f98ad1a901.tar.bz2
Protect against early calls to GetProfileSuncService() (chromium-os:10209)
BUG=chromium-os:10209 TEST=Run sync tests, and confirm that sync is enabled after login for all types of login on ChromeOS Review URL: http://codereview.chromium.org/5792001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69310 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/profiles/profile_impl.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 436727b..c0bf8f6 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -1243,6 +1243,15 @@ TokenService* ProfileImpl::GetTokenService() {
}
ProfileSyncService* ProfileImpl::GetProfileSyncService() {
+#if defined(OS_CHROMEOS)
+ // If kLoginManager is specified, we shouldn't call this unless login has
+ // completed and specified cros_user. Guard with if (HasProfileSyncService())
+ // where this might legitimately get called before login has completed.
+ if (!sync_service_.get() &&
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager)) {
+ LOG(FATAL) << "GetProfileSyncService() called before login complete.";
+ }
+#endif
return GetProfileSyncService("");
}