| 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_SYNC_BACKEND_HOST_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 void Shutdown(bool sync_disabled); | 189 void Shutdown(bool sync_disabled); |
| 190 | 190 |
| 191 // Changes the set of data types that are currently being synced. | 191 // Changes the set of data types that are currently being synced. |
| 192 // The ready_task will be run when configuration is done with the | 192 // The ready_task will be run when configuration is done with the |
| 193 // set of all types that failed configuration (i.e., if its argument | 193 // set of all types that failed configuration (i.e., if its argument |
| 194 // is non-empty, then an error was encountered). | 194 // is non-empty, then an error was encountered). |
| 195 virtual void ConfigureDataTypes( | 195 virtual void ConfigureDataTypes( |
| 196 const syncable::ModelTypeSet& types_to_add, | 196 const syncable::ModelTypeSet& types_to_add, |
| 197 const syncable::ModelTypeSet& types_to_remove, | 197 const syncable::ModelTypeSet& types_to_remove, |
| 198 sync_api::ConfigureReason reason, | 198 sync_api::ConfigureReason reason, |
| 199 base::Callback<void(const syncable::ModelTypeSet&)> ready_task, | 199 base::Callback<void(syncable::ModelEnumSet)> ready_task, |
| 200 bool enable_nigori); | 200 bool enable_nigori); |
| 201 | 201 |
| 202 // Makes an asynchronous call to syncer to switch to config mode. When done | 202 // Makes an asynchronous call to syncer to switch to config mode. When done |
| 203 // syncer will call us back on FinishConfigureDataTypes. | 203 // syncer will call us back on FinishConfigureDataTypes. |
| 204 virtual void StartConfiguration(const base::Closure& callback); | 204 virtual void StartConfiguration(const base::Closure& callback); |
| 205 | 205 |
| 206 // Turns on encryption of all present and future sync data. | 206 // Turns on encryption of all present and future sync data. |
| 207 virtual void EnableEncryptEverything(); | 207 virtual void EnableEncryptEverything(); |
| 208 | 208 |
| 209 // Activates change processing for the given data type. This must | 209 // Activates change processing for the given data type. This must |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 // Called to handle updating frontend thread components whenever we may | 410 // Called to handle updating frontend thread components whenever we may |
| 411 // need to alert the frontend that the backend is intialized. | 411 // need to alert the frontend that the backend is intialized. |
| 412 void HandleInitializationCompletedOnFrontendLoop( | 412 void HandleInitializationCompletedOnFrontendLoop( |
| 413 const WeakHandle<JsBackend>& js_backend, | 413 const WeakHandle<JsBackend>& js_backend, |
| 414 bool success); | 414 bool success); |
| 415 | 415 |
| 416 // Called when configuration of the Nigori node has completed as | 416 // Called when configuration of the Nigori node has completed as |
| 417 // part of the initialization process. | 417 // part of the initialization process. |
| 418 void HandleNigoriConfigurationCompletedOnFrontendLoop( | 418 void HandleNigoriConfigurationCompletedOnFrontendLoop( |
| 419 const WeakHandle<JsBackend>& js_backend, | 419 const WeakHandle<JsBackend>& js_backend, |
| 420 const syncable::ModelTypeSet& failed_configuration_types); | 420 syncable::ModelEnumSet failed_configuration_types); |
| 421 | 421 |
| 422 private: | 422 private: |
| 423 friend class base::RefCountedThreadSafe<SyncBackendHost::Core>; | 423 friend class base::RefCountedThreadSafe<SyncBackendHost::Core>; |
| 424 friend class SyncBackendHostForProfileSyncTest; | 424 friend class SyncBackendHostForProfileSyncTest; |
| 425 | 425 |
| 426 virtual ~Core(); | 426 virtual ~Core(); |
| 427 | 427 |
| 428 // Invoked when initialization of syncapi is complete and we can start | 428 // Invoked when initialization of syncapi is complete and we can start |
| 429 // our timer. | 429 // our timer. |
| 430 // This must be called from the thread on which SaveChanges is intended to | 430 // This must be called from the thread on which SaveChanges is intended to |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 InitializationState initialization_state_; | 539 InitializationState initialization_state_; |
| 540 | 540 |
| 541 private: | 541 private: |
| 542 struct PendingConfigureDataTypesState { | 542 struct PendingConfigureDataTypesState { |
| 543 PendingConfigureDataTypesState(); | 543 PendingConfigureDataTypesState(); |
| 544 ~PendingConfigureDataTypesState(); | 544 ~PendingConfigureDataTypesState(); |
| 545 | 545 |
| 546 // The ready_task will be run when configuration is done with the | 546 // The ready_task will be run when configuration is done with the |
| 547 // set of all types that failed configuration (i.e., if its | 547 // set of all types that failed configuration (i.e., if its |
| 548 // argument is non-empty, then an error was encountered). | 548 // argument is non-empty, then an error was encountered). |
| 549 base::Callback<void(const syncable::ModelTypeSet&)> ready_task; | 549 base::Callback<void(syncable::ModelEnumSet)> ready_task; |
| 550 | 550 |
| 551 // The set of types that we are waiting to be initially synced in a | 551 // The set of types that we are waiting to be initially synced in a |
| 552 // configuration cycle. | 552 // configuration cycle. |
| 553 syncable::ModelTypeSet types_to_add; | 553 syncable::ModelTypeSet types_to_add; |
| 554 | 554 |
| 555 // Additional details about which types were added. | 555 // Additional details about which types were added. |
| 556 syncable::ModelTypeSet added_types; | 556 syncable::ModelTypeSet added_types; |
| 557 sync_api::ConfigureReason reason; | 557 sync_api::ConfigureReason reason; |
| 558 }; | 558 }; |
| 559 | 559 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 | 600 |
| 601 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. | 601 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. |
| 602 scoped_ptr<sessions::SyncSessionSnapshot> last_snapshot_; | 602 scoped_ptr<sessions::SyncSessionSnapshot> last_snapshot_; |
| 603 | 603 |
| 604 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 604 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
| 605 }; | 605 }; |
| 606 | 606 |
| 607 } // namespace browser_sync | 607 } // namespace browser_sync |
| 608 | 608 |
| 609 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 609 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| OLD | NEW |