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

Unified Diff: components/autofill/core/browser/autofill_wallet_data_type_controller.h

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/autofill/core/browser/autofill_wallet_data_type_controller.h
diff --git a/components/autofill/core/browser/autofill_wallet_data_type_controller.h b/components/autofill/core/browser/autofill_wallet_data_type_controller.h
index c31af633dfd2137b39d6bbed5f2eb0bf0a36a981..25b0e3ad3057b95b9f2b466deaf5ae82d2b3a2d3 100644
--- a/components/autofill/core/browser/autofill_wallet_data_type_controller.h
+++ b/components/autofill/core/browser/autofill_wallet_data_type_controller.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_SYNC_DRIVER_GLUE_AUTOFILL_WALLET_DATA_TYPE_CONTROLLER_H_
-#define COMPONENTS_SYNC_DRIVER_GLUE_AUTOFILL_WALLET_DATA_TYPE_CONTROLLER_H_
+#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_WALLET_DATA_TYPE_CONTROLLER_H_
+#define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_WALLET_DATA_TYPE_CONTROLLER_H_
#include "base/macros.h"
#include "components/prefs/pref_change_registrar.h"
@@ -19,22 +19,19 @@ namespace browser_sync {
class AutofillWalletDataTypeController
: public sync_driver::NonUIDataTypeController {
public:
- // |model_type| should be either AUTOFILL_WALLET or AUTOFILL_WALLET_METADATA.
+ // |type| should be either AUTOFILL_WALLET or AUTOFILL_WALLET_METADATA.
+ // |dump_stack| is called when an unrecoverable error occurs.
AutofillWalletDataTypeController(
- const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread,
+ syncer::ModelType type,
const scoped_refptr<base::SingleThreadTaskRunner>& db_thread,
- const base::Closure& error_callback,
+ const base::Closure& dump_stack,
sync_driver::SyncClient* sync_client,
- syncer::ModelType model_type,
const scoped_refptr<autofill::AutofillWebDataService>& web_data_service);
+ ~AutofillWalletDataTypeController() override;
// NonUIDataTypeController implementation.
- syncer::ModelType type() const override;
syncer::ModelSafeGroup model_safe_group() const override;
- protected:
- ~AutofillWalletDataTypeController() override;
-
private:
// NonUIDataTypeController implementation.
bool PostTaskOnBackendThread(const tracked_objects::Location& from_here,
@@ -49,9 +46,6 @@ class AutofillWalletDataTypeController
// Returns true if the prefs are set such that wallet sync should be enabled.
bool IsEnabled();
- // A reference to the UI thread's task runner.
- const scoped_refptr<base::SingleThreadTaskRunner> ui_thread_;
-
// A reference to the DB thread's task runner.
const scoped_refptr<base::SingleThreadTaskRunner> db_thread_;
@@ -61,9 +55,6 @@ class AutofillWalletDataTypeController
// Whether the database loaded callback has been registered.
bool callback_registered_;
- // The model type for this DTC; can be AUTOFILL_WALLET_DATA or _METADATA.
- syncer::ModelType model_type_;
-
// A reference to the AutofillWebDataService for this controller.
scoped_refptr<autofill::AutofillWebDataService> web_data_service_;
@@ -79,4 +70,4 @@ class AutofillWalletDataTypeController
} // namespace browser_sync
-#endif // COMPONENTS_SYNC_DRIVER_GLUE_AUTOFILL_WALLET_DATA_TYPE_CONTROLLER_H_
+#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_WALLET_DATA_TYPE_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698