OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_GLUE_NON_FRONTEND_DATA_TYPE_CONTROLLER_H__ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_NON_FRONTEND_DATA_TYPE_CONTROLLER_H__ |
6 #define CHROME_BROWSER_SYNC_GLUE_NON_FRONTEND_DATA_TYPE_CONTROLLER_H__ | 6 #define CHROME_BROWSER_SYNC_GLUE_NON_FRONTEND_DATA_TYPE_CONTROLLER_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 const std::string& message) = 0; | 126 const std::string& message) = 0; |
127 // Record association time. Called on Datatype's thread. | 127 // Record association time. Called on Datatype's thread. |
128 virtual void RecordAssociationTime(base::TimeDelta time) = 0; | 128 virtual void RecordAssociationTime(base::TimeDelta time) = 0; |
129 // Record causes of start failure. Called on UI thread. | 129 // Record causes of start failure. Called on UI thread. |
130 virtual void RecordStartFailure(StartResult result) = 0; | 130 virtual void RecordStartFailure(StartResult result) = 0; |
131 | 131 |
132 // Accessors and mutators used by derived classes. | 132 // Accessors and mutators used by derived classes. |
133 ProfileSyncFactory* profile_sync_factory() const; | 133 ProfileSyncFactory* profile_sync_factory() const; |
134 Profile* profile() const; | 134 Profile* profile() const; |
135 ProfileSyncService* profile_sync_service() const; | 135 ProfileSyncService* profile_sync_service() const; |
| 136 void set_start_callback(StartCallback* callback); |
136 void set_state(State state); | 137 void set_state(State state); |
137 void set_model_associator(AssociatorInterface* associator); | 138 |
138 void set_change_processor(ChangeProcessor* change_processor); | 139 virtual AssociatorInterface* associator() const; |
| 140 virtual void set_model_associator(AssociatorInterface* associator); |
| 141 virtual ChangeProcessor* change_processor() const; |
| 142 virtual void set_change_processor(ChangeProcessor* change_processor); |
139 | 143 |
140 private: | 144 private: |
141 ProfileSyncFactory* const profile_sync_factory_; | 145 ProfileSyncFactory* const profile_sync_factory_; |
142 Profile* const profile_; | 146 Profile* const profile_; |
143 ProfileSyncService* const profile_sync_service_; | 147 ProfileSyncService* const profile_sync_service_; |
144 | 148 |
145 State state_; | 149 State state_; |
146 | 150 |
147 scoped_ptr<StartCallback> start_callback_; | 151 scoped_ptr<StartCallback> start_callback_; |
148 scoped_ptr<AssociatorInterface> model_associator_; | 152 scoped_ptr<AssociatorInterface> model_associator_; |
149 scoped_ptr<ChangeProcessor> change_processor_; | 153 scoped_ptr<ChangeProcessor> change_processor_; |
150 | 154 |
151 // Locks/Barriers for aborting association early. | 155 // Locks/Barriers for aborting association early. |
152 base::Lock abort_association_lock_; | 156 base::Lock abort_association_lock_; |
153 bool abort_association_; | 157 bool abort_association_; |
154 base::WaitableEvent abort_association_complete_; | 158 base::WaitableEvent abort_association_complete_; |
155 | 159 |
156 // Barrier to ensure that the datatype has been stopped on the DB thread | 160 // Barrier to ensure that the datatype has been stopped on the DB thread |
157 // from the UI thread. | 161 // from the UI thread. |
158 base::WaitableEvent datatype_stopped_; | 162 base::WaitableEvent datatype_stopped_; |
159 | 163 |
160 DISALLOW_COPY_AND_ASSIGN(NonFrontendDataTypeController); | 164 DISALLOW_COPY_AND_ASSIGN(NonFrontendDataTypeController); |
161 }; | 165 }; |
162 | 166 |
163 } // namespace browser_sync | 167 } // namespace browser_sync |
164 | 168 |
165 #endif // CHROME_BROWSER_SYNC_GLUE_NON_FRONTEND_DATA_TYPE_CONTROLLER_H__ | 169 #endif // CHROME_BROWSER_SYNC_GLUE_NON_FRONTEND_DATA_TYPE_CONTROLLER_H__ |
OLD | NEW |