Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_ |
| 6 #define COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_ | 6 #define COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 325 browser_sync::ProtocolEventObserver* observer) override; | 325 browser_sync::ProtocolEventObserver* observer) override; |
| 326 void RemoveProtocolEventObserver( | 326 void RemoveProtocolEventObserver( |
| 327 browser_sync::ProtocolEventObserver* observer) override; | 327 browser_sync::ProtocolEventObserver* observer) override; |
| 328 void AddTypeDebugInfoObserver( | 328 void AddTypeDebugInfoObserver( |
| 329 syncer::TypeDebugInfoObserver* observer) override; | 329 syncer::TypeDebugInfoObserver* observer) override; |
| 330 void RemoveTypeDebugInfoObserver( | 330 void RemoveTypeDebugInfoObserver( |
| 331 syncer::TypeDebugInfoObserver* observer) override; | 331 syncer::TypeDebugInfoObserver* observer) override; |
| 332 base::WeakPtr<syncer::JsController> GetJsController() override; | 332 base::WeakPtr<syncer::JsController> GetJsController() override; |
| 333 void GetAllNodes(const base::Callback<void(std::unique_ptr<base::ListValue>)>& | 333 void GetAllNodes(const base::Callback<void(std::unique_ptr<base::ListValue>)>& |
| 334 callback) override; | 334 callback) override; |
| 335 // Returns a ListValue representing all nodes for the specified types through | |
| 336 // |callback| on this thread. | |
| 337 void AllNodesForTypes( | |
| 338 syncer::ModelTypeSet types, | |
| 339 base::Callback<void(const syncer::ModelType, | |
| 340 ScopedVector<base::ListValue>)> type); | |
| 341 | |
| 342 void GetAllNodesForTypes( | |
|
pavely
2016/08/26 23:17:09
I think you only have/use GetAllNodesForTypes in i
Gang Wu
2016/08/29 20:07:41
Done.
| |
| 343 syncer::ModelTypeSet types, | |
| 344 base::Callback<void(const syncer::ModelType type, | |
| 345 std::unique_ptr<base::ListValue>)> callback); | |
| 346 std::unique_ptr<base::ListValue> GetAllNodesForType(syncer::ModelType type); | |
| 335 | 347 |
| 336 // Add a sync type preference provider. Each provider may only be added once. | 348 // Add a sync type preference provider. Each provider may only be added once. |
| 337 void AddPreferenceProvider(SyncTypePreferenceProvider* provider); | 349 void AddPreferenceProvider(SyncTypePreferenceProvider* provider); |
| 338 // Remove a sync type preference provider. May only be called for providers | 350 // Remove a sync type preference provider. May only be called for providers |
| 339 // that have been added. Providers must not remove themselves while being | 351 // that have been added. Providers must not remove themselves while being |
| 340 // called back. | 352 // called back. |
| 341 void RemovePreferenceProvider(SyncTypePreferenceProvider* provider); | 353 void RemovePreferenceProvider(SyncTypePreferenceProvider* provider); |
| 342 // Check whether a given sync type preference provider has been added. | 354 // Check whether a given sync type preference provider has been added. |
| 343 bool HasPreferenceProvider(SyncTypePreferenceProvider* provider) const; | 355 bool HasPreferenceProvider(SyncTypePreferenceProvider* provider) const; |
| 344 | 356 |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 932 // Sync's internal debug info listener. Used to record datatype configuration | 944 // Sync's internal debug info listener. Used to record datatype configuration |
| 933 // and association information. | 945 // and association information. |
| 934 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; | 946 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; |
| 935 | 947 |
| 936 // A thread where all the sync operations happen. | 948 // A thread where all the sync operations happen. |
| 937 // OWNERSHIP Notes: | 949 // OWNERSHIP Notes: |
| 938 // * Created when backend starts for the first time. | 950 // * Created when backend starts for the first time. |
| 939 // * If sync is disabled, PSS claims ownership from backend. | 951 // * If sync is disabled, PSS claims ownership from backend. |
| 940 // * If sync is reenabled, PSS passes ownership to new backend. | 952 // * If sync is reenabled, PSS passes ownership to new backend. |
| 941 std::unique_ptr<base::Thread> sync_thread_; | 953 std::unique_ptr<base::Thread> sync_thread_; |
| 954 base::Thread* sync_thread_test_; | |
|
pavely
2016/08/26 23:17:09
Cleanup.
Gang Wu
2016/08/29 20:07:41
I dont know where this line come from, will delete
Gang Wu
2016/08/29 20:07:41
Done.
| |
| 942 | 955 |
| 943 // ProfileSyncService uses this service to get access tokens. | 956 // ProfileSyncService uses this service to get access tokens. |
| 944 ProfileOAuth2TokenService* const oauth2_token_service_; | 957 ProfileOAuth2TokenService* const oauth2_token_service_; |
| 945 | 958 |
| 946 // ProfileSyncService needs to remember access token in order to invalidate it | 959 // ProfileSyncService needs to remember access token in order to invalidate it |
| 947 // with OAuth2TokenService. | 960 // with OAuth2TokenService. |
| 948 std::string access_token_; | 961 std::string access_token_; |
| 949 | 962 |
| 950 // ProfileSyncService needs to hold reference to access_token_request_ for | 963 // ProfileSyncService needs to hold reference to access_token_request_ for |
| 951 // the duration of request in order to receive callbacks. | 964 // the duration of request in order to receive callbacks. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1020 base::WeakPtrFactory<ProfileSyncService> weak_factory_; | 1033 base::WeakPtrFactory<ProfileSyncService> weak_factory_; |
| 1021 | 1034 |
| 1022 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 1035 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 1023 }; | 1036 }; |
| 1024 | 1037 |
| 1025 bool ShouldShowActionOnUI( | 1038 bool ShouldShowActionOnUI( |
| 1026 const syncer::SyncProtocolError& error); | 1039 const syncer::SyncProtocolError& error); |
| 1027 | 1040 |
| 1028 | 1041 |
| 1029 #endif // COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_ | 1042 #endif // COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |