summaryrefslogtreecommitdiffstats
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
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}
-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
-rw-r--r--chrome/browser/sync/profile_sync_service_android.cc70
-rw-r--r--chrome/browser/sync/profile_sync_service_autofill_unittest.cc2
-rw-r--r--chrome/browser/sync/profile_sync_test_util.cc2
-rw-r--r--chrome/browser/sync/profile_sync_test_util.h2
-rw-r--r--chrome/browser/sync/sessions/session_data_type_controller.cc10
-rw-r--r--chrome/browser/sync/test/integration/autofill_helper.cc4
-rw-r--r--chrome/browser/sync_file_system/local/local_file_sync_service.cc4
-rw-r--r--chrome/browser/sync_file_system/sync_file_system_service.cc12
25 files changed, 119 insertions, 119 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) {
diff --git a/chrome/browser/sync/profile_sync_service_android.cc b/chrome/browser/sync/profile_sync_service_android.cc
index c7350a8..2ea5d3e 100644
--- a/chrome/browser/sync/profile_sync_service_android.cc
+++ b/chrome/browser/sync/profile_sync_service_android.cc
@@ -114,7 +114,7 @@ void ProfileSyncServiceAndroid::OnStateChanged() {
}
void ProfileSyncServiceAndroid::EnableSync(JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Don't need to do anything if we're already enabled.
if (sync_prefs_->IsStartSuppressed())
sync_service_->UnsuppressAndStart();
@@ -123,7 +123,7 @@ void ProfileSyncServiceAndroid::EnableSync(JNIEnv* env, jobject) {
}
void ProfileSyncServiceAndroid::DisableSync(JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Don't need to do anything if we're already disabled.
if (!sync_prefs_->IsStartSuppressed()) {
sync_service_->StopAndSuppress();
@@ -134,7 +134,7 @@ void ProfileSyncServiceAndroid::DisableSync(JNIEnv* env, jobject) {
}
void ProfileSyncServiceAndroid::SignInSync(JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Just return if sync already has everything it needs to start up (sync
// should start up automatically as long as it has credentials). This can
// happen normally if (for example) the user closes and reopens the sync
@@ -151,7 +151,7 @@ void ProfileSyncServiceAndroid::SignInSync(JNIEnv* env, jobject) {
}
void ProfileSyncServiceAndroid::SignOutSync(JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(profile_);
sync_service_->DisableForUser();
@@ -160,13 +160,13 @@ void ProfileSyncServiceAndroid::SignOutSync(JNIEnv* env, jobject) {
}
void ProfileSyncServiceAndroid::FlushDirectory(JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
sync_service_->FlushDirectory();
}
ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::QuerySyncStatusSummary(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(profile_);
std::string status(sync_service_->QuerySyncStatusSummaryString());
return ConvertUTF8ToJavaString(env, status);
@@ -174,7 +174,7 @@ ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::QuerySyncStatusSummary(
jboolean ProfileSyncServiceAndroid::SetSyncSessionsId(
JNIEnv* env, jobject obj, jstring tag) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(profile_);
std::string machine_tag = ConvertJavaStringToUTF8(env, tag);
sync_prefs_->SetSyncSessionsGUID(machine_tag);
@@ -182,41 +182,41 @@ jboolean ProfileSyncServiceAndroid::SetSyncSessionsId(
}
jint ProfileSyncServiceAndroid::GetAuthError(JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return sync_service_->GetAuthError().state();
}
jboolean ProfileSyncServiceAndroid::IsEncryptEverythingEnabled(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return sync_service_->EncryptEverythingEnabled();
}
jboolean ProfileSyncServiceAndroid::IsSyncInitialized(JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return sync_service_->backend_initialized();
}
jboolean ProfileSyncServiceAndroid::IsFirstSetupInProgress(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return sync_service_->FirstSetupInProgress();
}
jboolean ProfileSyncServiceAndroid::IsEncryptEverythingAllowed(
JNIEnv* env, jobject obj) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return sync_service_->EncryptEverythingAllowed();
}
jboolean ProfileSyncServiceAndroid::IsPassphraseRequired(JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return sync_service_->IsPassphraseRequired();
}
jboolean ProfileSyncServiceAndroid::IsPassphraseRequiredForDecryption(
JNIEnv* env, jobject obj) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// In case of CUSTOM_PASSPHRASE we always sync passwords. Prompt the user for
// a passphrase if cryptographer has any pending keys.
if (sync_service_->GetPassphraseType() == syncer::CUSTOM_PASSPHRASE) {
@@ -237,27 +237,27 @@ jboolean ProfileSyncServiceAndroid::IsPassphraseRequiredForDecryption(
jboolean ProfileSyncServiceAndroid::IsPassphraseRequiredForExternalType(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return
sync_service_->passphrase_required_reason() == syncer::REASON_DECRYPTION;
}
jboolean ProfileSyncServiceAndroid::IsUsingSecondaryPassphrase(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return sync_service_->IsUsingSecondaryPassphrase();
}
jboolean ProfileSyncServiceAndroid::SetDecryptionPassphrase(
JNIEnv* env, jobject obj, jstring passphrase) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::string key = ConvertJavaStringToUTF8(env, passphrase);
return sync_service_->SetDecryptionPassphrase(key);
}
void ProfileSyncServiceAndroid::SetEncryptionPassphrase(
JNIEnv* env, jobject obj, jstring passphrase, jboolean is_gaia) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::string key = ConvertJavaStringToUTF8(env, passphrase);
sync_service_->SetEncryptionPassphrase(
key,
@@ -270,20 +270,20 @@ jboolean ProfileSyncServiceAndroid::IsCryptographerReady(JNIEnv* env, jobject) {
}
jint ProfileSyncServiceAndroid::GetPassphraseType(JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return sync_service_->GetPassphraseType();
}
jboolean ProfileSyncServiceAndroid::HasExplicitPassphraseTime(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::Time passphrase_time = sync_service_->GetExplicitPassphraseTime();
return !passphrase_time.is_null();
}
jlong ProfileSyncServiceAndroid::GetExplicitPassphraseTime(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::Time passphrase_time = sync_service_->GetExplicitPassphraseTime();
return passphrase_time.ToJavaTime();
}
@@ -291,7 +291,7 @@ jlong ProfileSyncServiceAndroid::GetExplicitPassphraseTime(
ScopedJavaLocalRef<jstring>
ProfileSyncServiceAndroid::GetSyncEnterGooglePassphraseBodyWithDateText(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::Time passphrase_time = sync_service_->GetExplicitPassphraseTime();
base::string16 passphrase_time_str =
base::TimeFormatShortDate(passphrase_time);
@@ -304,7 +304,7 @@ ScopedJavaLocalRef<jstring>
ScopedJavaLocalRef<jstring>
ProfileSyncServiceAndroid::GetSyncEnterCustomPassphraseBodyWithDateText(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::Time passphrase_time = sync_service_->GetExplicitPassphraseTime();
base::string16 passphrase_time_str =
base::TimeFormatShortDate(passphrase_time);
@@ -316,7 +316,7 @@ ScopedJavaLocalRef<jstring>
ScopedJavaLocalRef<jstring>
ProfileSyncServiceAndroid::GetCurrentSignedInAccountText(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
const std::string& sync_username =
SigninManagerFactory::GetForProfile(profile_)->GetAuthenticatedUsername();
return base::android::ConvertUTF16ToJavaString(env,
@@ -328,14 +328,14 @@ ScopedJavaLocalRef<jstring>
ScopedJavaLocalRef<jstring>
ProfileSyncServiceAndroid::GetSyncEnterCustomPassphraseBodyText(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return ConvertUTF8ToJavaString(
env, l10n_util::GetStringUTF8(IDS_SYNC_ENTER_PASSPHRASE_BODY));
}
jboolean ProfileSyncServiceAndroid::IsSyncKeystoreMigrationDone(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
syncer::SyncStatus status;
bool is_status_valid = sync_service_->QueryDetailedSyncStatus(&status);
return is_status_valid && !status.keystore_migration_time.is_null();
@@ -359,7 +359,7 @@ void ProfileSyncServiceAndroid::SetPreferredDataTypes(
JNIEnv* env, jobject obj,
jboolean sync_everything,
jlong model_type_selection) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
syncer::ModelTypeSet types;
// Note: only user selectable types should be included here.
if (model_type_selection & AUTOFILL)
@@ -378,49 +378,49 @@ void ProfileSyncServiceAndroid::SetPreferredDataTypes(
void ProfileSyncServiceAndroid::SetSetupInProgress(
JNIEnv* env, jobject obj, jboolean in_progress) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
sync_service_->SetSetupInProgress(in_progress);
}
void ProfileSyncServiceAndroid::SetSyncSetupCompleted(
JNIEnv* env, jobject obj) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
sync_service_->SetSyncSetupCompleted();
}
jboolean ProfileSyncServiceAndroid::HasSyncSetupCompleted(
JNIEnv* env, jobject obj) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return sync_service_->HasSyncSetupCompleted();
}
jboolean ProfileSyncServiceAndroid::IsStartSuppressed(
JNIEnv* env, jobject obj) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return sync_prefs_->IsStartSuppressed();
}
void ProfileSyncServiceAndroid::EnableEncryptEverything(
JNIEnv* env, jobject obj) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
sync_service_->EnableEncryptEverything();
}
jboolean ProfileSyncServiceAndroid::HasKeepEverythingSynced(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return sync_prefs_->HasKeepEverythingSynced();
}
jboolean ProfileSyncServiceAndroid::HasUnrecoverableError(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return sync_service_->HasUnrecoverableError();
}
ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::GetAboutInfoForTest(
JNIEnv* env, jobject) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_ptr<base::DictionaryValue> about_info =
sync_ui_util::ConstructAboutInformation(sync_service_);
diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
index 25082eb..e011045 100644
--- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
@@ -173,7 +173,7 @@ class MockAutofillBackend : public autofill::AutofillWebDataBackend {
autofill::AutofillWebDataServiceObserverOnDBThread* observer) override {}
void RemoveExpiredFormElements() override {}
void NotifyOfMultipleAutofillChanges() override {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ DCHECK_CURRENTLY_ON(BrowserThread::DB);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, on_changed_);
}
diff --git a/chrome/browser/sync/profile_sync_test_util.cc b/chrome/browser/sync/profile_sync_test_util.cc
index 565c5ad8..087a4d2 100644
--- a/chrome/browser/sync/profile_sync_test_util.cc
+++ b/chrome/browser/sync/profile_sync_test_util.cc
@@ -27,7 +27,7 @@ void ThreadNotifier::Notify(int type,
void ThreadNotifier::Notify(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
notify_thread_->message_loop()->PostTask(
FROM_HERE,
base::Bind(&ThreadNotifier::NotifyTask, this, type, source, details));
diff --git a/chrome/browser/sync/profile_sync_test_util.h b/chrome/browser/sync/profile_sync_test_util.h
index b2692df..2fb4274 100644
--- a/chrome/browser/sync/profile_sync_test_util.h
+++ b/chrome/browser/sync/profile_sync_test_util.h
@@ -29,7 +29,7 @@ ACTION_P(Notify, type) {
}
ACTION(QuitUIMessageLoop) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
base::MessageLoop::current()->Quit();
}
diff --git a/chrome/browser/sync/sessions/session_data_type_controller.cc b/chrome/browser/sync/sessions/session_data_type_controller.cc
index f3d43ba..9eb90ae 100644
--- a/chrome/browser/sync/sessions/session_data_type_controller.cc
+++ b/chrome/browser/sync/sessions/session_data_type_controller.cc
@@ -46,7 +46,7 @@ SessionDataTypeController::SessionDataTypeController(
SessionDataTypeController::~SessionDataTypeController() {}
bool SessionDataTypeController::StartModels() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::set<const browser_sync::SyncedWindowDelegate*> window =
synced_window_getter_->GetSyncedWindowDelegates();
for (std::set<const browser_sync::SyncedWindowDelegate*>::const_iterator i =
@@ -77,7 +77,7 @@ void SessionDataTypeController::StopModels() {
}
bool SessionDataTypeController::ReadyForStart() const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return !profile_->GetPrefs()->GetBoolean(
prefs::kSavingBrowserHistoryDisabled);
}
@@ -96,7 +96,7 @@ void SessionDataTypeController::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(chrome::NOTIFICATION_SESSION_RESTORE_COMPLETE, type);
DCHECK_EQ(profile_, content::Source<Profile>(source).ptr());
notification_registrar_.RemoveAll();
@@ -106,7 +106,7 @@ void SessionDataTypeController::Observe(
}
void SessionDataTypeController::OnLocalDeviceInfoInitialized() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
subscription_.reset();
waiting_on_local_device_info_ = false;
@@ -114,7 +114,7 @@ void SessionDataTypeController::OnLocalDeviceInfoInitialized() {
}
void SessionDataTypeController::OnSavingBrowserHistoryPrefChanged() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled)) {
// If history and tabs persistence is turned off then generate an
// unrecoverable error. SESSIONS won't be a registered type on the next
diff --git a/chrome/browser/sync/test/integration/autofill_helper.cc b/chrome/browser/sync/test/integration/autofill_helper.cc
index b5877fc..957de84 100644
--- a/chrome/browser/sync/test/integration/autofill_helper.cc
+++ b/chrome/browser/sync/test/integration/autofill_helper.cc
@@ -101,14 +101,14 @@ void RemoveKeyDontBlockForSync(int profile, const AutofillKey& key) {
void GetAllAutofillEntriesOnDBThread(AutofillWebDataService* wds,
std::vector<AutofillEntry>* entries) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ DCHECK_CURRENTLY_ON(BrowserThread::DB);
AutofillTable::FromWebDatabase(
wds->GetDatabase())->GetAllAutofillEntries(entries);
}
std::vector<AutofillEntry> GetAllAutofillEntries(AutofillWebDataService* wds) {
std::vector<AutofillEntry> entries;
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
RunOnDBThreadAndBlock(Bind(&GetAllAutofillEntriesOnDBThread,
Unretained(wds),
&entries));
diff --git a/chrome/browser/sync_file_system/local/local_file_sync_service.cc b/chrome/browser/sync_file_system/local/local_file_sync_service.cc
index 51ab55a..b9c76f7 100644
--- a/chrome/browser/sync_file_system/local/local_file_sync_service.cc
+++ b/chrome/browser/sync_file_system/local/local_file_sync_service.cc
@@ -120,7 +120,7 @@ scoped_ptr<LocalFileSyncService> LocalFileSyncService::CreateForTesting(
}
LocalFileSyncService::~LocalFileSyncService() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
void LocalFileSyncService::Shutdown() {
@@ -350,7 +350,7 @@ LocalFileSyncService::LocalFileSyncService(Profile* profile,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)
.get())),
local_change_processor_(nullptr) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
sync_context_->AddOriginChangeObserver(this);
}
diff --git a/chrome/browser/sync_file_system/sync_file_system_service.cc b/chrome/browser/sync_file_system/sync_file_system_service.cc
index 777c8c5..804eccf 100644
--- a/chrome/browser/sync_file_system/sync_file_system_service.cc
+++ b/chrome/browser/sync_file_system/sync_file_system_service.cc
@@ -158,7 +158,7 @@ class LocalSyncRunner : public SyncProcessRunner,
// LocalFileSyncService::Observer overrides.
void OnLocalChangeAvailable(int64 pending_changes) override {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
OnChangesUpdated(pending_changes);
@@ -208,7 +208,7 @@ class RemoteSyncRunner : public SyncProcessRunner,
// RemoteFileSyncService::Observer overrides.
void OnRemoteChangeQueueUpdated(int64 pending_changes) override {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
OnChangesUpdated(pending_changes);
@@ -251,7 +251,7 @@ class RemoteSyncRunner : public SyncProcessRunner,
// SyncFileSystemService
void SyncFileSystemService::Shutdown() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
local_sync_runners_.clear();
remote_sync_runners_.clear();
@@ -272,7 +272,7 @@ void SyncFileSystemService::Shutdown() {
}
SyncFileSystemService::~SyncFileSystemService() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!profile_);
}
@@ -446,7 +446,7 @@ SyncFileSystemService::SyncFileSystemService(Profile* profile)
void SyncFileSystemService::Initialize(
scoped_ptr<LocalFileSyncService> local_service,
scoped_ptr<RemoteFileSyncService> remote_service) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(local_service);
DCHECK(remote_service);
DCHECK(profile_);
@@ -635,7 +635,7 @@ void SyncFileSystemService::DidGetLocalChangeStatus(
void SyncFileSystemService::OnRemoteServiceStateUpdated(
RemoteServiceState state,
const std::string& description) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
util::Log(logging::LOG_VERBOSE, FROM_HERE,
"OnRemoteServiceStateChanged: %d %s", state, description.c_str());