| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SYNC_SERVICE_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_H_ | 6 #define COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 11 #include "base/location.h" | 12 #include "base/location.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "components/sync_driver/data_type_encryption_handler.h" | 16 #include "components/sync_driver/data_type_encryption_handler.h" |
| 17 #include "components/sync_driver/sync_service_observer.h" | 17 #include "components/sync_driver/sync_service_observer.h" |
| 18 #include "google_apis/gaia/google_service_auth_error.h" | 18 #include "google_apis/gaia/google_service_auth_error.h" |
| 19 #include "sync/internal_api/public/base/model_type.h" | 19 #include "sync/internal_api/public/base/model_type.h" |
| 20 #include "sync/internal_api/public/connection_status.h" | 20 #include "sync/internal_api/public/connection_status.h" |
| 21 | 21 |
| 22 class GoogleServiceAuthError; | 22 class GoogleServiceAuthError; |
| 23 | 23 |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 // Returns a weak pointer to the service's JsController. | 314 // Returns a weak pointer to the service's JsController. |
| 315 virtual base::WeakPtr<syncer::JsController> GetJsController() = 0; | 315 virtual base::WeakPtr<syncer::JsController> GetJsController() = 0; |
| 316 | 316 |
| 317 // Asynchronously fetches base::Value representations of all sync nodes and | 317 // Asynchronously fetches base::Value representations of all sync nodes and |
| 318 // returns them to the specified callback on this thread. | 318 // returns them to the specified callback on this thread. |
| 319 // | 319 // |
| 320 // These requests can live a long time and return when you least expect it. | 320 // These requests can live a long time and return when you least expect it. |
| 321 // For safety, the callback should be bound to some sort of WeakPtr<> or | 321 // For safety, the callback should be bound to some sort of WeakPtr<> or |
| 322 // scoped_refptr<>. | 322 // scoped_refptr<>. |
| 323 virtual void GetAllNodes( | 323 virtual void GetAllNodes( |
| 324 const base::Callback<void(scoped_ptr<base::ListValue>)>& callback) = 0; | 324 const base::Callback<void(std::unique_ptr<base::ListValue>)>& |
| 325 callback) = 0; |
| 325 | 326 |
| 326 protected: | 327 protected: |
| 327 SyncService() {} | 328 SyncService() {} |
| 328 | 329 |
| 329 private: | 330 private: |
| 330 DISALLOW_COPY_AND_ASSIGN(SyncService); | 331 DISALLOW_COPY_AND_ASSIGN(SyncService); |
| 331 }; | 332 }; |
| 332 | 333 |
| 333 } // namespace sync_driver | 334 } // namespace sync_driver |
| 334 | 335 |
| 335 #endif // COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_H_ | 336 #endif // COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_H_ |
| OLD | NEW |