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

Unified Diff: components/history/core/browser/history_delete_directives_data_type_controller.cc

Issue 2289143003: [Sync] Convert DTCs to be not RefCounted and NonThreadSafe. (Closed)
Patch Set: Rebase. Created 4 years, 3 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: components/history/core/browser/history_delete_directives_data_type_controller.cc
diff --git a/components/history/core/browser/history_delete_directives_data_type_controller.cc b/components/history/core/browser/history_delete_directives_data_type_controller.cc
index 27ff7be3547f9f0a5939c9bee829fce2dc34966f..cf07a935a1ac567c79aa006a22dc59f3739a277b 100644
--- a/components/history/core/browser/history_delete_directives_data_type_controller.cc
+++ b/components/history/core/browser/history_delete_directives_data_type_controller.cc
@@ -11,12 +11,10 @@ namespace browser_sync {
HistoryDeleteDirectivesDataTypeController::
HistoryDeleteDirectivesDataTypeController(
- const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread,
- const base::Closure& error_callback,
+ const base::Closure& dump_stack,
sync_driver::SyncClient* sync_client)
- : sync_driver::UIDataTypeController(ui_thread,
- error_callback,
- syncer::HISTORY_DELETE_DIRECTIVES,
+ : sync_driver::UIDataTypeController(syncer::HISTORY_DELETE_DIRECTIVES,
+ dump_stack,
sync_client),
sync_client_(sync_client) {}
@@ -25,10 +23,12 @@ HistoryDeleteDirectivesDataTypeController::
}
bool HistoryDeleteDirectivesDataTypeController::ReadyForStart() const {
+ DCHECK(CalledOnValidThread());
return !sync_client_->GetSyncService()->IsEncryptEverythingEnabled();
}
bool HistoryDeleteDirectivesDataTypeController::StartModels() {
+ DCHECK(CalledOnValidThread());
if (DisableTypeIfNecessary())
return false;
sync_client_->GetSyncService()->AddObserver(this);
@@ -36,6 +36,7 @@ bool HistoryDeleteDirectivesDataTypeController::StartModels() {
}
void HistoryDeleteDirectivesDataTypeController::StopModels() {
+ DCHECK(CalledOnValidThread());
if (sync_client_->GetSyncService()->HasObserver(this))
sync_client_->GetSyncService()->RemoveObserver(this);
}
@@ -45,6 +46,7 @@ void HistoryDeleteDirectivesDataTypeController::OnStateChanged() {
}
bool HistoryDeleteDirectivesDataTypeController::DisableTypeIfNecessary() {
+ DCHECK(CalledOnValidThread());
if (!sync_client_->GetSyncService()->IsSyncActive())
return false;
@@ -58,7 +60,7 @@ bool HistoryDeleteDirectivesDataTypeController::DisableTypeIfNecessary() {
syncer::SyncError::DATATYPE_POLICY_ERROR,
"Delete directives not supported with encryption.",
type());
- OnSingleDataTypeUnrecoverableError(error);
+ CreateErrorHandler()->OnUnrecoverableError(error);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698