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

Unified Diff: components/password_manager/sync/browser/password_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/password_manager/sync/browser/password_data_type_controller.cc
diff --git a/components/password_manager/sync/browser/password_data_type_controller.cc b/components/password_manager/sync/browser/password_data_type_controller.cc
index 32a1a72b454b31f8c340d743678e4ca47e4a95c5..12cb98d1310a52a3aa9c8762225e35bd69a8b7e4 100644
--- a/components/password_manager/sync/browser/password_data_type_controller.cc
+++ b/components/password_manager/sync/browser/password_data_type_controller.cc
@@ -13,20 +13,15 @@
namespace browser_sync {
PasswordDataTypeController::PasswordDataTypeController(
- const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread,
- const base::Closure& error_callback,
+ const base::Closure& dump_stack,
sync_driver::SyncClient* sync_client,
const base::Closure& state_changed_callback,
const scoped_refptr<password_manager::PasswordStore>& password_store)
- : NonUIDataTypeController(ui_thread, error_callback, sync_client),
+ : NonUIDataTypeController(syncer::PASSWORDS, dump_stack, sync_client),
sync_client_(sync_client),
state_changed_callback_(state_changed_callback),
password_store_(password_store) {}
-syncer::ModelType PasswordDataTypeController::type() const {
- return syncer::PASSWORDS;
-}
-
syncer::ModelSafeGroup PasswordDataTypeController::model_safe_group() const {
return syncer::GROUP_PASSWORD;
}
@@ -36,14 +31,14 @@ PasswordDataTypeController::~PasswordDataTypeController() {}
bool PasswordDataTypeController::PostTaskOnBackendThread(
const tracked_objects::Location& from_here,
const base::Closure& task) {
- DCHECK(ui_thread()->BelongsToCurrentThread());
+ DCHECK(CalledOnValidThread());
if (!password_store_.get())
return false;
return password_store_->ScheduleTask(task);
}
bool PasswordDataTypeController::StartModels() {
- DCHECK(ui_thread()->BelongsToCurrentThread());
+ DCHECK(CalledOnValidThread());
DCHECK_EQ(MODEL_STARTING, state());
sync_client_->GetSyncService()->AddObserver(this);
@@ -54,11 +49,12 @@ bool PasswordDataTypeController::StartModels() {
}
void PasswordDataTypeController::StopModels() {
- DCHECK(ui_thread()->BelongsToCurrentThread());
+ DCHECK(CalledOnValidThread());
sync_client_->GetSyncService()->RemoveObserver(this);
}
void PasswordDataTypeController::OnStateChanged() {
+ DCHECK(CalledOnValidThread());
state_changed_callback_.Run();
}
« no previous file with comments | « components/password_manager/sync/browser/password_data_type_controller.h ('k') | components/search_engines/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698