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

Side by Side Diff: chrome/browser/sync/profile_sync_service.h

Issue 217183003: Add non-blocking sync code to ProfileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PROFILE_SYNC_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 // to start up. Virtual to enable mocking in tests. 293 // to start up. Virtual to enable mocking in tests.
294 virtual bool IsOAuthRefreshTokenAvailable(); 294 virtual bool IsOAuthRefreshTokenAvailable();
295 295
296 // Registers a data type controller with the sync service. This 296 // Registers a data type controller with the sync service. This
297 // makes the data type controller available for use, it does not 297 // makes the data type controller available for use, it does not
298 // enable or activate the synchronization of the data type (see 298 // enable or activate the synchronization of the data type (see
299 // ActivateDataType). Takes ownership of the pointer. 299 // ActivateDataType). Takes ownership of the pointer.
300 void RegisterDataTypeController( 300 void RegisterDataTypeController(
301 browser_sync::DataTypeController* data_type_controller); 301 browser_sync::DataTypeController* data_type_controller);
302 302
303 // Registers a type whose sync storage will not be managed by the
304 // ProfileSyncService. It declares that this sync type may be activated at
305 // some point in the future. This function call does not enable or activate
306 // the syncing of this type
307 void RegisterNonBlockingType(syncer::ModelType type);
308
303 // Returns the session model associator associated with this type, but only if 309 // Returns the session model associator associated with this type, but only if
304 // the associator is running. If it is doing anything else, it will return 310 // the associator is running. If it is doing anything else, it will return
305 // null. 311 // null.
306 // 312 //
307 // *** DONT USE THIS ANYMORE! *** 313 // *** DONT USE THIS ANYMORE! ***
308 // If you think you want to use this, think again! Can you use 314 // If you think you want to use this, think again! Can you use
309 // GetOpenTabsUIDelegate instead? 315 // GetOpenTabsUIDelegate instead?
310 // TODO(tim): Remove this method. 316 // TODO(tim): Remove this method.
311 virtual browser_sync::SessionModelAssociator* 317 virtual browser_sync::SessionModelAssociator*
312 GetSessionModelAssociatorDeprecated(); 318 GetSessionModelAssociatorDeprecated();
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 // If it is running, the DataTypeManager will be instructed to reconfigure 577 // If it is running, the DataTypeManager will be instructed to reconfigure
572 // the sync backend so that exactly these datatypes are actively synced. See 578 // the sync backend so that exactly these datatypes are actively synced. See
573 // class comment for more on what it means for a datatype to be Preferred. 579 // class comment for more on what it means for a datatype to be Preferred.
574 virtual void ChangePreferredDataTypes( 580 virtual void ChangePreferredDataTypes(
575 syncer::ModelTypeSet preferred_types); 581 syncer::ModelTypeSet preferred_types);
576 582
577 // Returns the set of types which are preferred for enabling. This is a 583 // Returns the set of types which are preferred for enabling. This is a
578 // superset of the active types (see GetActiveDataTypes()). 584 // superset of the active types (see GetActiveDataTypes()).
579 virtual syncer::ModelTypeSet GetPreferredDataTypes() const; 585 virtual syncer::ModelTypeSet GetPreferredDataTypes() const;
580 586
587 // Returns the set of directory types which are preferred for enabling.
588 virtual syncer::ModelTypeSet GetPreferredDirectoryDataTypes() const;
589
590 // Returns the set of off-thread types which are preferred for enabling.
591 virtual syncer::ModelTypeSet GetPreferredNonBlockingDataTypes() const;
592
581 // Gets the set of all data types that could be allowed (the set that 593 // Gets the set of all data types that could be allowed (the set that
582 // should be advertised to the user). These will typically only change 594 // should be advertised to the user). These will typically only change
583 // via a command-line option. See class comment for more on what it means 595 // via a command-line option. See class comment for more on what it means
584 // for a datatype to be Registered. 596 // for a datatype to be Registered.
585 virtual syncer::ModelTypeSet GetRegisteredDataTypes() const; 597 virtual syncer::ModelTypeSet GetRegisteredDataTypes() const;
586 598
599 // Gets the set of directory types which could be allowed.
600 virtual syncer::ModelTypeSet GetRegisteredDirectoryDataTypes() const;
601
602 // Gets the set of off-thread types which could be allowed.
603 virtual syncer::ModelTypeSet GetRegisteredNonBlockingDataTypes() const;
604
587 // Checks whether the Cryptographer is ready to encrypt and decrypt updates 605 // Checks whether the Cryptographer is ready to encrypt and decrypt updates
588 // for sensitive data types. Caller must be holding a 606 // for sensitive data types. Caller must be holding a
589 // syncapi::BaseTransaction to ensure thread safety. 607 // syncapi::BaseTransaction to ensure thread safety.
590 virtual bool IsCryptographerReady( 608 virtual bool IsCryptographerReady(
591 const syncer::BaseTransaction* trans) const; 609 const syncer::BaseTransaction* trans) const;
592 610
593 // Returns true if a secondary (explicit) passphrase is being used. It is not 611 // Returns true if a secondary (explicit) passphrase is being used. It is not
594 // legal to call this method before the backend is initialized. 612 // legal to call this method before the backend is initialized.
595 virtual bool IsUsingSecondaryPassphrase() const; 613 virtual bool IsUsingSecondaryPassphrase() const;
596 614
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 // OnConfigureDone is called. 903 // OnConfigureDone is called.
886 base::Time sync_configure_start_time_; 904 base::Time sync_configure_start_time_;
887 905
888 // Indicates if this is the first time sync is being configured. This value 906 // Indicates if this is the first time sync is being configured. This value
889 // is equal to !HasSyncSetupCompleted() at the time of OnBackendInitialized(). 907 // is equal to !HasSyncSetupCompleted() at the time of OnBackendInitialized().
890 bool is_first_time_sync_configure_; 908 bool is_first_time_sync_configure_;
891 909
892 // List of available data type controllers. 910 // List of available data type controllers.
893 browser_sync::DataTypeController::TypeMap data_type_controllers_; 911 browser_sync::DataTypeController::TypeMap data_type_controllers_;
894 912
913 // List of registered types that use the non-blocking API.
914 syncer::ModelTypeSet non_blocking_types_;
915
895 // Whether the SyncBackendHost has been initialized. 916 // Whether the SyncBackendHost has been initialized.
896 bool backend_initialized_; 917 bool backend_initialized_;
897 918
898 // Set when sync receives DISABLED_BY_ADMIN error from server. Prevents 919 // Set when sync receives DISABLED_BY_ADMIN error from server. Prevents
899 // ProfileSyncService from starting backend till browser restarted or user 920 // ProfileSyncService from starting backend till browser restarted or user
900 // signed out. 921 // signed out.
901 bool sync_disabled_by_admin_; 922 bool sync_disabled_by_admin_;
902 923
903 // Set to true if a signin has completed but we're still waiting for the 924 // Set to true if a signin has completed but we're still waiting for the
904 // backend to refresh its credentials. 925 // backend to refresh its credentials.
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 browser_sync::StartupController startup_controller_; 1035 browser_sync::StartupController startup_controller_;
1015 1036
1016 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 1037 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
1017 }; 1038 };
1018 1039
1019 bool ShouldShowActionOnUI( 1040 bool ShouldShowActionOnUI(
1020 const syncer::SyncProtocolError& error); 1041 const syncer::SyncProtocolError& error);
1021 1042
1022 1043
1023 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 1044 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host_mock.cc ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698