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 SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 276 |
277 // Initialize the sync manager. |database_location| specifies the path of | 277 // Initialize the sync manager. |database_location| specifies the path of |
278 // the directory in which to locate a sqlite repository storing the syncer | 278 // the directory in which to locate a sqlite repository storing the syncer |
279 // backend state. Initialization will open the database, or create it if it | 279 // backend state. Initialization will open the database, or create it if it |
280 // does not already exist. Returns false on failure. | 280 // does not already exist. Returns false on failure. |
281 // |event_handler| is the JsEventHandler used to propagate events to | 281 // |event_handler| is the JsEventHandler used to propagate events to |
282 // chrome://sync-internals. |event_handler| may be uninitialized. | 282 // chrome://sync-internals. |event_handler| may be uninitialized. |
283 // |sync_server_and_path| and |sync_server_port| represent the Chrome sync | 283 // |sync_server_and_path| and |sync_server_port| represent the Chrome sync |
284 // server to use, and |use_ssl| specifies whether to communicate securely; | 284 // server to use, and |use_ssl| specifies whether to communicate securely; |
285 // the default is false. | 285 // the default is false. |
286 // |blocking_task_runner| is a TaskRunner to be used for tasks that | |
287 // may block on disk I/O. | |
288 // |post_factory| will be owned internally and used to create | 286 // |post_factory| will be owned internally and used to create |
289 // instances of an HttpPostProvider. | 287 // instances of an HttpPostProvider. |
290 // |model_safe_worker| ownership is given to the SyncManager. | 288 // |model_safe_worker| ownership is given to the SyncManager. |
291 // |user_agent| is a 7-bit ASCII string suitable for use as the User-Agent | 289 // |user_agent| is a 7-bit ASCII string suitable for use as the User-Agent |
292 // HTTP header. Used internally when collecting stats to classify clients. | 290 // HTTP header. Used internally when collecting stats to classify clients. |
293 // |invalidator| is owned and used to listen for invalidations. | 291 // |invalidator| is owned and used to listen for invalidations. |
294 // |restored_key_for_bootstrapping| is the key used to boostrap the | 292 // |restored_key_for_bootstrapping| is the key used to boostrap the |
295 // cryptographer | 293 // cryptographer |
296 // |keystore_encryption_enabled| determines whether we enable the keystore | 294 // |keystore_encryption_enabled| determines whether we enable the keystore |
297 // encryption functionality in the cryptographer/nigori. | 295 // encryption functionality in the cryptographer/nigori. |
298 // |report_unrecoverable_error_function| may be NULL. | 296 // |report_unrecoverable_error_function| may be NULL. |
299 // | 297 // |
300 // TODO(akalin): Replace the |post_factory| parameter with a | 298 // TODO(akalin): Replace the |post_factory| parameter with a |
301 // URLFetcher parameter. | 299 // URLFetcher parameter. |
302 virtual void Init( | 300 virtual void Init( |
303 const FilePath& database_location, | 301 const FilePath& database_location, |
304 const WeakHandle<JsEventHandler>& event_handler, | 302 const WeakHandle<JsEventHandler>& event_handler, |
305 const std::string& sync_server_and_path, | 303 const std::string& sync_server_and_path, |
306 int sync_server_port, | 304 int sync_server_port, |
307 bool use_ssl, | 305 bool use_ssl, |
308 const scoped_refptr<base::TaskRunner>& blocking_task_runner, | |
309 scoped_ptr<HttpPostProviderFactory> post_factory, | 306 scoped_ptr<HttpPostProviderFactory> post_factory, |
310 const std::vector<ModelSafeWorker*>& workers, | 307 const std::vector<ModelSafeWorker*>& workers, |
311 ExtensionsActivityMonitor* extensions_activity_monitor, | 308 ExtensionsActivityMonitor* extensions_activity_monitor, |
312 ChangeDelegate* change_delegate, | 309 ChangeDelegate* change_delegate, |
313 const SyncCredentials& credentials, | 310 const SyncCredentials& credentials, |
314 scoped_ptr<Invalidator> invalidator, | 311 scoped_ptr<Invalidator> invalidator, |
315 const std::string& restored_key_for_bootstrapping, | 312 const std::string& restored_key_for_bootstrapping, |
316 const std::string& restored_keystore_key_for_bootstrapping, | 313 const std::string& restored_keystore_key_for_bootstrapping, |
317 scoped_ptr<InternalComponentsFactory> internal_components_factory, | 314 scoped_ptr<InternalComponentsFactory> internal_components_factory, |
318 Encryptor* encryptor, | 315 Encryptor* encryptor, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 // any remaining unsynced items. May be called on any thread. | 413 // any remaining unsynced items. May be called on any thread. |
417 virtual bool HasUnsyncedItems() = 0; | 414 virtual bool HasUnsyncedItems() = 0; |
418 | 415 |
419 // Returns the SyncManager's encryption handler. | 416 // Returns the SyncManager's encryption handler. |
420 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; | 417 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; |
421 }; | 418 }; |
422 | 419 |
423 } // namespace syncer | 420 } // namespace syncer |
424 | 421 |
425 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 422 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
OLD | NEW |