summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/glue
diff options
context:
space:
mode:
authoranujk.sharma <anujk.sharma@samsung.com>2015-04-22 23:38:23 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-23 06:38:38 +0000
commit86194487d0cdf451b1177477828c8870b9cbd10c (patch)
treea12120956b520e5017a8d178a5effd3d210bbbd8 /chrome/browser/sync/glue
parentd389a96ff7963b90a7a80bc3cd3318fdf48c0e70 (diff)
downloadchromium_src-86194487d0cdf451b1177477828c8870b9cbd10c.zip
chromium_src-86194487d0cdf451b1177477828c8870b9cbd10c.tar.gz
chromium_src-86194487d0cdf451b1177477828c8870b9cbd10c.tar.bz2
favor DCHECK_CURRENTLY_ON for better logs in chrome/browser/sync and sync_file_system
BUG=466848 Review URL: https://codereview.chromium.org/1090413003 Cr-Commit-Position: refs/heads/master@{#326465}
Diffstat (limited to 'chrome/browser/sync/glue')
-rw-r--r--chrome/browser/sync/glue/autofill_data_type_controller.cc10
-rw-r--r--chrome/browser/sync/glue/autofill_profile_data_type_controller.cc10
-rw-r--r--chrome/browser/sync/glue/autofill_wallet_data_type_controller.cc14
-rw-r--r--chrome/browser/sync/glue/bookmark_change_processor.cc6
-rw-r--r--chrome/browser/sync/glue/bookmark_data_type_controller.cc2
-rw-r--r--chrome/browser/sync/glue/bookmark_model_associator.cc10
-rw-r--r--chrome/browser/sync/glue/extension_setting_data_type_controller.cc6
-rw-r--r--chrome/browser/sync/glue/frontend_data_type_controller.cc20
-rw-r--r--chrome/browser/sync/glue/history_model_worker.cc2
-rw-r--r--chrome/browser/sync/glue/non_frontend_data_type_controller.cc26
-rw-r--r--chrome/browser/sync/glue/password_data_type_controller.cc6
-rw-r--r--chrome/browser/sync/glue/search_engine_data_type_controller.cc2
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_impl.cc2
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc2
-rw-r--r--chrome/browser/sync/glue/sync_backend_registrar.cc6
-rw-r--r--chrome/browser/sync/glue/typed_url_change_processor.cc2
-rw-r--r--chrome/browser/sync/glue/typed_url_data_type_controller.cc6
17 files changed, 66 insertions, 66 deletions
diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.cc b/chrome/browser/sync/glue/autofill_data_type_controller.cc
index 87d7132..83729c5 100644
--- a/chrome/browser/sync/glue/autofill_data_type_controller.cc
+++ b/chrome/browser/sync/glue/autofill_data_type_controller.cc
@@ -40,25 +40,25 @@ syncer::ModelSafeGroup AutofillDataTypeController::model_safe_group() const {
}
void AutofillDataTypeController::WebDatabaseLoaded() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(MODEL_STARTING, state());
OnModelLoaded();
}
AutofillDataTypeController::~AutofillDataTypeController() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
bool AutofillDataTypeController::PostTaskOnBackendThread(
const tracked_objects::Location& from_here,
const base::Closure& task) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return BrowserThread::PostTask(BrowserThread::DB, from_here, task);
}
bool AutofillDataTypeController::StartModels() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(MODEL_STARTING, state());
autofill::AutofillWebDataService* web_data_service =
@@ -79,7 +79,7 @@ bool AutofillDataTypeController::StartModels() {
void AutofillDataTypeController::StartAssociating(
const StartCallback& start_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(state(), MODEL_LOADED);
ProfileSyncService* sync = ProfileSyncServiceFactory::GetForProfile(
profile_);
diff --git a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc
index ad0ec69..c1dc733 100644
--- a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc
+++ b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc
@@ -43,12 +43,12 @@ syncer::ModelSafeGroup
}
void AutofillProfileDataTypeController::WebDatabaseLoaded() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
OnModelLoaded();
}
void AutofillProfileDataTypeController::OnPersonalDataChanged() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(state(), MODEL_STARTING);
personal_data_->RemoveObserver(this);
@@ -73,12 +73,12 @@ AutofillProfileDataTypeController::~AutofillProfileDataTypeController() {}
bool AutofillProfileDataTypeController::PostTaskOnBackendThread(
const tracked_objects::Location& from_here,
const base::Closure& task) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return BrowserThread::PostTask(BrowserThread::DB, from_here, task);
}
bool AutofillProfileDataTypeController::StartModels() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(state(), MODEL_STARTING);
// Waiting for the personal data is subtle: we do this as the PDM resets
// its cache of unique IDs once it gets loaded. If we were to proceed with
@@ -110,7 +110,7 @@ bool AutofillProfileDataTypeController::StartModels() {
}
void AutofillProfileDataTypeController::StopModels() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
personal_data_->RemoveObserver(this);
}
diff --git a/chrome/browser/sync/glue/autofill_wallet_data_type_controller.cc b/chrome/browser/sync/glue/autofill_wallet_data_type_controller.cc
index 2f644ba..7975b26 100644
--- a/chrome/browser/sync/glue/autofill_wallet_data_type_controller.cc
+++ b/chrome/browser/sync/glue/autofill_wallet_data_type_controller.cc
@@ -34,7 +34,7 @@ AutofillWalletDataTypeController::AutofillWalletDataTypeController(
profile_(profile),
callback_registered_(false),
currently_enabled_(IsEnabled()) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
pref_registrar_.Init(profile->GetPrefs());
pref_registrar_.Add(
autofill::prefs::kAutofillWalletSyncExperimentEnabled,
@@ -61,12 +61,12 @@ syncer::ModelSafeGroup
bool AutofillWalletDataTypeController::PostTaskOnBackendThread(
const tracked_objects::Location& from_here,
const base::Closure& task) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return BrowserThread::PostTask(BrowserThread::DB, from_here, task);
}
bool AutofillWalletDataTypeController::StartModels() {
- DCHECK(content::BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(state(), MODEL_STARTING);
autofill::AutofillWebDataService* web_data_service =
@@ -89,7 +89,7 @@ bool AutofillWalletDataTypeController::StartModels() {
}
void AutofillWalletDataTypeController::StopModels() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// This function is called when shutting down (nothing is changing), when
// sync is disabled completely, or when wallet sync is disabled. In the
@@ -115,7 +115,7 @@ void AutofillWalletDataTypeController::StopModels() {
}
bool AutofillWalletDataTypeController::ReadyForStart() const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return currently_enabled_;
}
@@ -124,7 +124,7 @@ void AutofillWalletDataTypeController::WebDatabaseLoaded() {
}
void AutofillWalletDataTypeController::OnSyncPrefChanged() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
bool new_enabled = IsEnabled();
if (currently_enabled_ == new_enabled)
@@ -154,7 +154,7 @@ void AutofillWalletDataTypeController::OnSyncPrefChanged() {
}
bool AutofillWalletDataTypeController::IsEnabled() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Require both the sync experiment and the user-visible pref to be
// enabled to sync Wallet data.
diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc
index ad7ab852..0336a78 100644
--- a/chrome/browser/sync/glue/bookmark_change_processor.cc
+++ b/chrome/browser/sync/glue/bookmark_change_processor.cc
@@ -54,7 +54,7 @@ BookmarkChangeProcessor::BookmarkChangeProcessor(
bookmark_model_(NULL),
profile_(profile),
model_associator_(model_associator) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(model_associator);
DCHECK(profile);
DCHECK(error_handler);
@@ -66,7 +66,7 @@ BookmarkChangeProcessor::~BookmarkChangeProcessor() {
}
void BookmarkChangeProcessor::StartImpl() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!bookmark_model_);
bookmark_model_ = BookmarkModelFactory::GetForProfile(profile_);
DCHECK(bookmark_model_->loaded());
@@ -524,7 +524,7 @@ void BookmarkChangeProcessor::ApplyChangesFromSyncModel(
const syncer::BaseTransaction* trans,
int64 model_version,
const syncer::ImmutableChangeRecordList& changes) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// A note about ordering. Sync backend is responsible for ordering the change
// records in the following order:
//
diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.cc b/chrome/browser/sync/glue/bookmark_data_type_controller.cc
index abed22c..45007a4 100644
--- a/chrome/browser/sync/glue/bookmark_data_type_controller.cc
+++ b/chrome/browser/sync/glue/bookmark_data_type_controller.cc
@@ -107,7 +107,7 @@ bool BookmarkDataTypeController::DependentsLoaded() {
void BookmarkDataTypeController::OnHistoryServiceLoaded(
history::HistoryService* service) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(state_, MODEL_STARTING);
history_service_observer_.RemoveAll();
diff --git a/chrome/browser/sync/glue/bookmark_model_associator.cc b/chrome/browser/sync/glue/bookmark_model_associator.cc
index 1d1d64b..d24a7e7 100644
--- a/chrome/browser/sync/glue/bookmark_model_associator.cc
+++ b/chrome/browser/sync/glue/bookmark_model_associator.cc
@@ -260,18 +260,18 @@ BookmarkModelAssociator::BookmarkModelAssociator(
unrecoverable_error_handler_(unrecoverable_error_handler),
expect_mobile_bookmarks_folder_(expect_mobile_bookmarks_folder),
weak_factory_(this) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(bookmark_model_);
DCHECK(user_share_);
DCHECK(unrecoverable_error_handler_);
}
BookmarkModelAssociator::~BookmarkModelAssociator() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
void BookmarkModelAssociator::UpdatePermanentNodeVisibility() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(bookmark_model_->loaded());
BookmarkNode::Type bookmark_node_types[] = {
@@ -323,7 +323,7 @@ bool BookmarkModelAssociator::InitSyncNodeFromChromeId(
void BookmarkModelAssociator::Associate(const BookmarkNode* node,
int64 sync_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
int64 node_id = node->id();
DCHECK_NE(sync_id, syncer::kInvalidId);
DCHECK(id_map_.find(node_id) == id_map_.end());
@@ -336,7 +336,7 @@ void BookmarkModelAssociator::Associate(const BookmarkNode* node,
}
void BookmarkModelAssociator::Disassociate(int64 sync_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
SyncIdToBookmarkNodeMap::iterator iter = id_map_inverse_.find(sync_id);
if (iter == id_map_inverse_.end())
return;
diff --git a/chrome/browser/sync/glue/extension_setting_data_type_controller.cc b/chrome/browser/sync/glue/extension_setting_data_type_controller.cc
index 9e015d9..8d269e5 100644
--- a/chrome/browser/sync/glue/extension_setting_data_type_controller.cc
+++ b/chrome/browser/sync/glue/extension_setting_data_type_controller.cc
@@ -29,7 +29,7 @@ ExtensionSettingDataTypeController::ExtensionSettingDataTypeController(
profile_sync_factory),
type_(type),
profile_(profile) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(type == syncer::EXTENSION_SETTINGS || type == syncer::APP_SETTINGS);
}
@@ -47,12 +47,12 @@ ExtensionSettingDataTypeController::~ExtensionSettingDataTypeController() {}
bool ExtensionSettingDataTypeController::PostTaskOnBackendThread(
const tracked_objects::Location& from_here,
const base::Closure& task) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return BrowserThread::PostTask(BrowserThread::FILE, from_here, task);
}
bool ExtensionSettingDataTypeController::StartModels() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
extensions::ExtensionSystem::Get(profile_)->InitForRegularProfile(true);
return true;
}
diff --git a/chrome/browser/sync/glue/frontend_data_type_controller.cc b/chrome/browser/sync/glue/frontend_data_type_controller.cc
index aee9f84..d987f74 100644
--- a/chrome/browser/sync/glue/frontend_data_type_controller.cc
+++ b/chrome/browser/sync/glue/frontend_data_type_controller.cc
@@ -35,7 +35,7 @@ FrontendDataTypeController::FrontendDataTypeController(
profile_(profile),
sync_service_(sync_service),
state_(NOT_RUNNING) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(profile_sync_factory);
DCHECK(profile);
DCHECK(sync_service);
@@ -43,7 +43,7 @@ FrontendDataTypeController::FrontendDataTypeController(
void FrontendDataTypeController::LoadModels(
const ModelLoadCallback& model_load_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
model_load_callback_ = model_load_callback;
if (state_ != NOT_RUNNING) {
@@ -68,7 +68,7 @@ void FrontendDataTypeController::LoadModels(
}
void FrontendDataTypeController::OnModelLoaded() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(state_, MODEL_STARTING);
state_ = MODEL_LOADED;
@@ -77,7 +77,7 @@ void FrontendDataTypeController::OnModelLoaded() {
void FrontendDataTypeController::StartAssociating(
const StartCallback& start_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!start_callback.is_null());
DCHECK_EQ(state_, MODEL_LOADED);
@@ -89,7 +89,7 @@ void FrontendDataTypeController::StartAssociating(
}
void FrontendDataTypeController::Stop() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (state_ == NOT_RUNNING)
return;
@@ -158,7 +158,7 @@ FrontendDataTypeController::FrontendDataTypeController()
}
FrontendDataTypeController::~FrontendDataTypeController() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
bool FrontendDataTypeController::StartModels() {
@@ -243,7 +243,7 @@ void FrontendDataTypeController::CleanUp() {
}
void FrontendDataTypeController::AbortModelLoad() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
CleanUp();
state_ = NOT_RUNNING;
}
@@ -252,7 +252,7 @@ void FrontendDataTypeController::StartDone(
ConfigureResult start_result,
const syncer::SyncMergeResult& local_merge_result,
const syncer::SyncMergeResult& syncer_merge_result) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!IsSuccessfulResult(start_result)) {
if (IsUnrecoverableResult(start_result))
RecordUnrecoverableError(FROM_HERE, "StartFailed");
@@ -270,7 +270,7 @@ void FrontendDataTypeController::StartDone(
}
void FrontendDataTypeController::RecordAssociationTime(base::TimeDelta time) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
#define PER_DATA_TYPE_MACRO(type_str) \
UMA_HISTOGRAM_TIMES("Sync." type_str "AssociationTime", time);
SYNC_DATA_TYPE_HISTOGRAM(type());
@@ -278,7 +278,7 @@ void FrontendDataTypeController::RecordAssociationTime(base::TimeDelta time) {
}
void FrontendDataTypeController::RecordStartFailure(ConfigureResult result) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeStartFailures",
ModelTypeToHistogramInt(type()),
syncer::MODEL_TYPE_COUNT);
diff --git a/chrome/browser/sync/glue/history_model_worker.cc b/chrome/browser/sync/glue/history_model_worker.cc
index 6cda56c..33a7334 100644
--- a/chrome/browser/sync/glue/history_model_worker.cc
+++ b/chrome/browser/sync/glue/history_model_worker.cc
@@ -70,7 +70,7 @@ void PostWorkerTask(
base::CancelableTaskTracker* cancelable_tracker,
WaitableEvent* done,
syncer::SyncerError* error) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (history_service.get()) {
scoped_ptr<history::HistoryDBTask> task(new WorkerTask(work, done, error));
history_service->ScheduleDBTask(task.Pass(), cancelable_tracker);
diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller.cc b/chrome/browser/sync/glue/non_frontend_data_type_controller.cc
index b37e96a..cab1037 100644
--- a/chrome/browser/sync/glue/non_frontend_data_type_controller.cc
+++ b/chrome/browser/sync/glue/non_frontend_data_type_controller.cc
@@ -53,7 +53,7 @@ BackendComponentsContainer::BackendComponentsContainer(
NonFrontendDataTypeController* controller)
: controller_(controller),
type_(controller->type()) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
controller_handle_ =
syncer::MakeWeakHandle(controller_->weak_ptr_factory_.GetWeakPtr());
}
@@ -173,7 +173,7 @@ NonFrontendDataTypeController::NonFrontendDataTypeController(
model_associator_(NULL),
change_processor_(NULL),
weak_ptr_factory_(this) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(profile_sync_factory_);
DCHECK(profile_);
DCHECK(profile_sync_service_);
@@ -181,7 +181,7 @@ NonFrontendDataTypeController::NonFrontendDataTypeController(
void NonFrontendDataTypeController::LoadModels(
const ModelLoadCallback& model_load_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
model_load_callback_ = model_load_callback;
if (state_ != NOT_RUNNING) {
model_load_callback.Run(type(),
@@ -218,7 +218,7 @@ void NonFrontendDataTypeController::OnModelLoaded() {
void NonFrontendDataTypeController::StartAssociating(
const StartCallback& start_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!start_callback.is_null());
DCHECK(!components_container_);
DCHECK_EQ(state_, MODEL_LOADED);
@@ -251,7 +251,7 @@ void DestroyComponentsInBackend(
}
void NonFrontendDataTypeController::Stop() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (state_ == NOT_RUNNING)
return;
@@ -313,13 +313,13 @@ NonFrontendDataTypeController::NonFrontendDataTypeController()
}
NonFrontendDataTypeController::~NonFrontendDataTypeController() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!change_processor_);
DCHECK(!model_associator_);
}
bool NonFrontendDataTypeController::StartModels() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(state_, MODEL_STARTING);
// By default, no additional services need to be started before we can proceed
// with model association, so do nothing.
@@ -334,7 +334,7 @@ void NonFrontendDataTypeController::StartDone(
DataTypeController::ConfigureResult start_result,
const syncer::SyncMergeResult& local_merge_result,
const syncer::SyncMergeResult& syncer_merge_result) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DataTypeController::State new_state;
if (IsSuccessfulResult(start_result)) {
@@ -354,7 +354,7 @@ void NonFrontendDataTypeController::StartDoneImpl(
DataTypeController::State new_state,
const syncer::SyncMergeResult& local_merge_result,
const syncer::SyncMergeResult& syncer_merge_result) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
state_ = new_state;
if (state_ != RUNNING) {
@@ -367,7 +367,7 @@ void NonFrontendDataTypeController::StartDoneImpl(
void NonFrontendDataTypeController::DisableImpl(
const syncer::SyncError& error) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!model_load_callback_.is_null()) {
model_load_callback_.Run(type(), error);
}
@@ -375,7 +375,7 @@ void NonFrontendDataTypeController::DisableImpl(
void NonFrontendDataTypeController::RecordAssociationTime(
base::TimeDelta time) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
#define PER_DATA_TYPE_MACRO(type_str) \
UMA_HISTOGRAM_TIMES("Sync." type_str "AssociationTime", time);
SYNC_DATA_TYPE_HISTOGRAM(type());
@@ -383,7 +383,7 @@ void NonFrontendDataTypeController::RecordAssociationTime(
}
void NonFrontendDataTypeController::RecordStartFailure(ConfigureResult result) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeStartFailures",
ModelTypeToHistogramInt(type()),
syncer::MODEL_TYPE_COUNT);
@@ -445,7 +445,7 @@ NonFrontendDataTypeController::GetChangeProcessor() const {
void NonFrontendDataTypeController::AssociationCallback(
AssociationResult result) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (result.needs_crypto) {
StartDone(NEEDS_CRYPTO,
diff --git a/chrome/browser/sync/glue/password_data_type_controller.cc b/chrome/browser/sync/glue/password_data_type_controller.cc
index 71b589a..44464f0 100644
--- a/chrome/browser/sync/glue/password_data_type_controller.cc
+++ b/chrome/browser/sync/glue/password_data_type_controller.cc
@@ -43,14 +43,14 @@ PasswordDataTypeController::~PasswordDataTypeController() {}
bool PasswordDataTypeController::PostTaskOnBackendThread(
const tracked_objects::Location& from_here,
const base::Closure& task) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!password_store_.get())
return false;
return password_store_->ScheduleTask(task);
}
bool PasswordDataTypeController::StartModels() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(MODEL_STARTING, state());
ProfileSyncService* profile_sync_service =
@@ -66,7 +66,7 @@ bool PasswordDataTypeController::StartModels() {
}
void PasswordDataTypeController::StopModels() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
ProfileSyncService* profile_sync_service =
ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_);
DCHECK(profile_sync_service);
diff --git a/chrome/browser/sync/glue/search_engine_data_type_controller.cc b/chrome/browser/sync/glue/search_engine_data_type_controller.cc
index 5ac663a..161909d 100644
--- a/chrome/browser/sync/glue/search_engine_data_type_controller.cc
+++ b/chrome/browser/sync/glue/search_engine_data_type_controller.cc
@@ -60,7 +60,7 @@ void SearchEngineDataTypeController::StopModels() {
}
void SearchEngineDataTypeController::OnTemplateURLServiceLoaded() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(state_, MODEL_STARTING);
template_url_subscription_.reset();
OnModelLoaded();
diff --git a/chrome/browser/sync/glue/sync_backend_host_impl.cc b/chrome/browser/sync/glue/sync_backend_host_impl.cc
index 26538eb..fa0ba02 100644
--- a/chrome/browser/sync/glue/sync_backend_host_impl.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_impl.cc
@@ -642,7 +642,7 @@ void SyncBackendHostImpl::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(type, chrome::NOTIFICATION_SYNC_REFRESH_LOCAL);
content::Details<const syncer::ModelTypeSet> state_details(details);
diff --git a/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc
index 00216ff..bbc5a4d 100644
--- a/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc
@@ -260,7 +260,7 @@ class SyncBackendHostTest : public testing::Test {
}
void IssueRefreshRequest(syncer::ModelTypeSet types) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_SYNC_REFRESH_LOCAL,
diff --git a/chrome/browser/sync/glue/sync_backend_registrar.cc b/chrome/browser/sync/glue/sync_backend_registrar.cc
index bcddbb2..d7b22c7 100644
--- a/chrome/browser/sync/glue/sync_backend_registrar.cc
+++ b/chrome/browser/sync/glue/sync_backend_registrar.cc
@@ -61,7 +61,7 @@ SyncBackendRegistrar::SyncBackendRegistrar(
scoped_ptr<base::Thread> sync_thread) :
name_(name),
profile_(profile) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
CHECK(profile_);
// TODO(pavely): Remove ScopedTracker below once crbug.com/426272 is fixed.
@@ -148,7 +148,7 @@ void SyncBackendRegistrar::SetInitialTypes(syncer::ModelTypeSet initial_types) {
}
bool SyncBackendRegistrar::IsNigoriEnabled() const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::AutoLock lock(lock_);
return routing_info_.find(syncer::NIGORI) != routing_info_.end();
}
@@ -203,7 +203,7 @@ syncer::ModelTypeSet SyncBackendRegistrar::GetLastConfiguredTypes() const {
}
void SyncBackendRegistrar::RequestWorkerStopOnUIThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::AutoLock lock(lock_);
for (WorkerMap::const_iterator it = workers_.begin();
it != workers_.end(); ++it) {
diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc
index f573315..49f07fe 100644
--- a/chrome/browser/sync/glue/typed_url_change_processor.cc
+++ b/chrome/browser/sync/glue/typed_url_change_processor.cc
@@ -323,7 +323,7 @@ void TypedUrlChangeProcessor::Disconnect() {
}
void TypedUrlChangeProcessor::StartImpl() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(history_backend_);
DCHECK(backend_loop_);
backend_loop_->PostTask(FROM_HERE,
diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.cc b/chrome/browser/sync/glue/typed_url_data_type_controller.cc
index ab2b1a5..cef7363 100644
--- a/chrome/browser/sync/glue/typed_url_data_type_controller.cc
+++ b/chrome/browser/sync/glue/typed_url_data_type_controller.cc
@@ -93,7 +93,7 @@ syncer::ModelSafeGroup TypedUrlDataTypeController::model_safe_group()
}
bool TypedUrlDataTypeController::ReadyForStart() const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return !profile()->GetPrefs()->GetBoolean(
prefs::kSavingBrowserHistoryDisabled);
}
@@ -104,7 +104,7 @@ void TypedUrlDataTypeController::SetBackend(history::HistoryBackend* backend) {
}
void TypedUrlDataTypeController::OnSavingBrowserHistoryDisabledChanged() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (profile()->GetPrefs()->GetBoolean(
prefs::kSavingBrowserHistoryDisabled)) {
// We've turned off history persistence, so if we are running,
@@ -124,7 +124,7 @@ void TypedUrlDataTypeController::OnSavingBrowserHistoryDisabledChanged() {
bool TypedUrlDataTypeController::PostTaskOnBackendThread(
const tracked_objects::Location& from_here,
const base::Closure& task) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
history::HistoryService* history = HistoryServiceFactory::GetForProfile(
profile(), ServiceAccessType::IMPLICIT_ACCESS);
if (history) {