| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file defines the "sync API", an interface to the syncer | 5 // This file defines the "sync API", an interface to the syncer |
| 6 // backend that exposes (1) the core functionality of maintaining a consistent | 6 // backend that exposes (1) the core functionality of maintaining a consistent |
| 7 // local snapshot of a hierarchical object set; (2) a means to transactionally | 7 // local snapshot of a hierarchical object set; (2) a means to transactionally |
| 8 // access and modify those objects; (3) a means to control client/server | 8 // access and modify those objects; (3) a means to control client/server |
| 9 // synchronization tasks, namely: pushing local object modifications to a | 9 // synchronization tasks, namely: pushing local object modifications to a |
| 10 // server, pulling nonlocal object modifications from a server to this client, | 10 // server, pulling nonlocal object modifications from a server to this client, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 namespace browser_sync { | 59 namespace browser_sync { |
| 60 class JsBackend; | 60 class JsBackend; |
| 61 class ModelSafeWorkerRegistrar; | 61 class ModelSafeWorkerRegistrar; |
| 62 | 62 |
| 63 namespace sessions { | 63 namespace sessions { |
| 64 struct SyncSessionSnapshot; | 64 struct SyncSessionSnapshot; |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 namespace notifier { | |
| 69 struct NotifierOptions; | |
| 70 } | |
| 71 | |
| 72 // Forward declarations of internal class types so that sync API objects | 68 // Forward declarations of internal class types so that sync API objects |
| 73 // may have opaque pointers to these types. | 69 // may have opaque pointers to these types. |
| 74 namespace syncable { | 70 namespace syncable { |
| 75 class BaseTransaction; | 71 class BaseTransaction; |
| 76 class DirectoryManager; | 72 class DirectoryManager; |
| 77 class Entry; | 73 class Entry; |
| 78 class MutableEntry; | 74 class MutableEntry; |
| 79 class ReadTransaction; | 75 class ReadTransaction; |
| 80 class ScopedDirLookup; | 76 class ScopedDirLookup; |
| 81 class WriteTransaction; | 77 class WriteTransaction; |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 // HTTP header. Used internally when collecting stats to classify clients. | 842 // HTTP header. Used internally when collecting stats to classify clients. |
| 847 // |notifier_options| contains options specific to sync notifications. | 843 // |notifier_options| contains options specific to sync notifications. |
| 848 bool Init(const FilePath& database_location, | 844 bool Init(const FilePath& database_location, |
| 849 const char* sync_server_and_path, | 845 const char* sync_server_and_path, |
| 850 int sync_server_port, | 846 int sync_server_port, |
| 851 bool use_ssl, | 847 bool use_ssl, |
| 852 HttpPostProviderFactory* post_factory, | 848 HttpPostProviderFactory* post_factory, |
| 853 browser_sync::ModelSafeWorkerRegistrar* registrar, | 849 browser_sync::ModelSafeWorkerRegistrar* registrar, |
| 854 const char* user_agent, | 850 const char* user_agent, |
| 855 const SyncCredentials& credentials, | 851 const SyncCredentials& credentials, |
| 856 const notifier::NotifierOptions& notifier_options, | |
| 857 const std::string& restored_key_for_bootstrapping, | 852 const std::string& restored_key_for_bootstrapping, |
| 858 bool setup_for_test_mode); | 853 bool setup_for_test_mode); |
| 859 | 854 |
| 860 // Returns the username last used for a successful authentication. | 855 // Returns the username last used for a successful authentication. |
| 861 // Returns empty if there is no such username. | 856 // Returns empty if there is no such username. |
| 862 const std::string& GetAuthenticatedUsername(); | 857 const std::string& GetAuthenticatedUsername(); |
| 863 | 858 |
| 864 // Check if the database has been populated with a full "initial" download of | 859 // Check if the database has been populated with a full "initial" download of |
| 865 // sync items for each data type currently present in the routing info. | 860 // sync items for each data type currently present in the routing info. |
| 866 // Prerequisite for calling this is that OnInitializationComplete has been | 861 // Prerequisite for calling this is that OnInitializationComplete has been |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 // This allows actual HttpPostProvider subclass implementations to be | 1084 // This allows actual HttpPostProvider subclass implementations to be |
| 1090 // reference counted, which is useful if a particular implementation uses | 1085 // reference counted, which is useful if a particular implementation uses |
| 1091 // multiple threads to serve network requests. | 1086 // multiple threads to serve network requests. |
| 1092 virtual void Destroy(HttpPostProviderInterface* http) = 0; | 1087 virtual void Destroy(HttpPostProviderInterface* http) = 0; |
| 1093 virtual ~HttpPostProviderFactory() { } | 1088 virtual ~HttpPostProviderFactory() { } |
| 1094 }; | 1089 }; |
| 1095 | 1090 |
| 1096 } // namespace sync_api | 1091 } // namespace sync_api |
| 1097 | 1092 |
| 1098 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 1093 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
| OLD | NEW |