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

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

Issue 6260002: Fix chromium-os:10777 and other sync related crashes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improve comment. Created 9 years, 11 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/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index d4f24d890c29ce168bf401d43e547364158f5b2e..9a9f45ed6ff4ed08c8d380332624b626c7cf4e74 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -1248,12 +1248,13 @@ 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.";
+ if (!sync_service_.get()) {
+ // In ChromeOS, sync only gets initialized properly from login, when
+ // kLoginManager is specified. If this gets called before login, or
+ // during a debugging session without kLoginManager, this will return
+ // NULL, so ensure that calls either handle a NULL result, or use
+ // HasProfileSyncService() to guard against the call.
+ return NULL;
}
#endif
return GetProfileSyncService("");

Powered by Google App Engine
This is Rietveld 408576698