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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 59793008: sync: don't allow NULL profile in ProfileSyncService and friends (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 7 years, 1 month 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/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 8308195fa8fb3fb3e7716481750978ad7e3aaeec..856ada2d8186a9953071e6e60945348052456144 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -159,8 +159,7 @@ ProfileSyncService::ProfileSyncService(
passphrase_required_reason_(syncer::REASON_PASSPHRASE_NOT_REQUIRED),
factory_(factory),
profile_(profile),
- // |profile| may be NULL in unit tests.
- sync_prefs_(profile_ ? profile_->GetPrefs() : NULL),
+ sync_prefs_(profile_->GetPrefs()),
sync_service_url_(kDevServerUrl),
data_type_requested_sync_startup_(false),
is_first_time_sync_configure_(false),
@@ -181,6 +180,7 @@ ProfileSyncService::ProfileSyncService(
weak_factory_(this),
connection_status_(syncer::CONNECTION_NOT_ATTEMPTED),
last_get_token_error_(GoogleServiceAuthError::AuthErrorNone()) {
+ DCHECK(profile);
// By default, dev, canary, and unbranded Chromium users will go to the
// development servers. Development servers have more features than standard
// sync servers. Users with officially-branded Chrome stable and beta builds
« no previous file with comments | « chrome/browser/sync/glue/ui_data_type_controller_unittest.cc ('k') | chrome/browser/sync/profile_sync_service_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698