OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_SYNC_DRIVER_NON_BLOCKING_DATA_TYPE_CONTROLLER_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_NON_BLOCKING_DATA_TYPE_CONTROLLER_H_ |
6 #define COMPONENTS_SYNC_DRIVER_NON_BLOCKING_DATA_TYPE_CONTROLLER_H_ | 6 #define COMPONENTS_SYNC_DRIVER_NON_BLOCKING_DATA_TYPE_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 // - RunOnModelThread | 29 // - RunOnModelThread |
30 // - RunOnUIThread | 30 // - RunOnUIThread |
31 class NonBlockingDataTypeController : public sync_driver::DataTypeController { | 31 class NonBlockingDataTypeController : public sync_driver::DataTypeController { |
32 public: | 32 public: |
33 // |dump_stack| is called when an unrecoverable error occurs. | 33 // |dump_stack| is called when an unrecoverable error occurs. |
34 NonBlockingDataTypeController(syncer::ModelType type, | 34 NonBlockingDataTypeController(syncer::ModelType type, |
35 const base::Closure& dump_stack, | 35 const base::Closure& dump_stack, |
36 sync_driver::SyncClient* sync_client); | 36 sync_driver::SyncClient* sync_client); |
37 ~NonBlockingDataTypeController() override; | 37 ~NonBlockingDataTypeController() override; |
38 | 38 |
39 // DataTypeController interface. | 39 // DataTypeController implementation. |
40 bool ShouldLoadModelBeforeConfigure() const override; | 40 bool ShouldLoadModelBeforeConfigure() const override; |
41 void LoadModels(const ModelLoadCallback& model_load_callback) override; | 41 void LoadModels(const ModelLoadCallback& model_load_callback) override; |
42 void GetAllNodes(const AllNodesCallback& callback) override; | 42 void GetAllNodes(const AllNodesCallback& callback) override; |
43 | 43 |
44 // Registers non-blocking data type with sync backend. In the process the | 44 // Registers non-blocking data type with sync backend. In the process the |
45 // activation context is passed to ModelTypeRegistry, where ModelTypeWorker | 45 // activation context is passed to ModelTypeRegistry, where ModelTypeWorker |
46 // gets created and connected with ModelTypeProcessor. | 46 // gets created and connected with ModelTypeProcessor. |
47 void RegisterWithBackend( | 47 void RegisterWithBackend( |
48 sync_driver::BackendDataTypeConfigurer* configurer) override; | 48 sync_driver::BackendDataTypeConfigurer* configurer) override; |
49 void StartAssociating(const StartCallback& start_callback) override; | 49 void StartAssociating(const StartCallback& start_callback) override; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // something the first time after the type is enabled. | 102 // something the first time after the type is enabled. |
103 // TODO(crbug.com/647505): Remove this once the DTM handles things better. | 103 // TODO(crbug.com/647505): Remove this once the DTM handles things better. |
104 bool activated_ = false; | 104 bool activated_ = false; |
105 | 105 |
106 DISALLOW_COPY_AND_ASSIGN(NonBlockingDataTypeController); | 106 DISALLOW_COPY_AND_ASSIGN(NonBlockingDataTypeController); |
107 }; | 107 }; |
108 | 108 |
109 } // namespace sync_driver_v2 | 109 } // namespace sync_driver_v2 |
110 | 110 |
111 #endif // COMPONENTS_SYNC_DRIVER_NON_BLOCKING_DATA_TYPE_CONTROLLER_H_ | 111 #endif // COMPONENTS_SYNC_DRIVER_NON_BLOCKING_DATA_TYPE_CONTROLLER_H_ |
OLD | NEW |