| 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 CHROME_BROWSER_SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
| 6 #define CHROME_BROWSER_SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 6 #define CHROME_BROWSER_SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/task_runner.h" |
| 14 #include "base/time.h" | 16 #include "base/time.h" |
| 15 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
| 16 #include "chrome/browser/sync/internal_api/includes/report_unrecoverable_error_f
unction.h" | 18 #include "chrome/browser/sync/internal_api/includes/report_unrecoverable_error_f
unction.h" |
| 17 #include "chrome/browser/sync/internal_api/includes/unrecoverable_error_handler.
h" | 19 #include "chrome/browser/sync/internal_api/includes/unrecoverable_error_handler.
h" |
| 18 #include "chrome/browser/sync/internal_api/change_record.h" | 20 #include "chrome/browser/sync/internal_api/change_record.h" |
| 19 #include "chrome/browser/sync/internal_api/configure_reason.h" | 21 #include "chrome/browser/sync/internal_api/configure_reason.h" |
| 20 #include "chrome/browser/sync/protocol/sync_protocol_error.h" | 22 #include "chrome/browser/sync/protocol/sync_protocol_error.h" |
| 21 #include "chrome/browser/sync/syncable/model_type.h" | 23 #include "chrome/browser/sync/syncable/model_type.h" |
| 22 #include "chrome/browser/sync/util/weak_handle.h" | 24 #include "chrome/browser/sync/util/weak_handle.h" |
| 23 #include "chrome/common/net/gaia/google_service_auth_error.h" | 25 #include "chrome/common/net/gaia/google_service_auth_error.h" |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 | 434 |
| 433 // Initialize the sync manager. |database_location| specifies the path of | 435 // Initialize the sync manager. |database_location| specifies the path of |
| 434 // the directory in which to locate a sqlite repository storing the syncer | 436 // the directory in which to locate a sqlite repository storing the syncer |
| 435 // backend state. Initialization will open the database, or create it if it | 437 // backend state. Initialization will open the database, or create it if it |
| 436 // does not already exist. Returns false on failure. | 438 // does not already exist. Returns false on failure. |
| 437 // |event_handler| is the JsEventHandler used to propagate events to | 439 // |event_handler| is the JsEventHandler used to propagate events to |
| 438 // chrome://sync-internals. |event_handler| may be uninitialized. | 440 // chrome://sync-internals. |event_handler| may be uninitialized. |
| 439 // |sync_server_and_path| and |sync_server_port| represent the Chrome sync | 441 // |sync_server_and_path| and |sync_server_port| represent the Chrome sync |
| 440 // server to use, and |use_ssl| specifies whether to communicate securely; | 442 // server to use, and |use_ssl| specifies whether to communicate securely; |
| 441 // the default is false. | 443 // the default is false. |
| 444 // |blocking_task_runner| is a TaskRunner to be used for tasks that |
| 445 // may block on disk I/O. |
| 442 // |post_factory| will be owned internally and used to create | 446 // |post_factory| will be owned internally and used to create |
| 443 // instances of an HttpPostProvider. | 447 // instances of an HttpPostProvider. |
| 444 // |model_safe_worker| ownership is given to the SyncManager. | 448 // |model_safe_worker| ownership is given to the SyncManager. |
| 445 // |user_agent| is a 7-bit ASCII string suitable for use as the User-Agent | 449 // |user_agent| is a 7-bit ASCII string suitable for use as the User-Agent |
| 446 // HTTP header. Used internally when collecting stats to classify clients. | 450 // HTTP header. Used internally when collecting stats to classify clients. |
| 447 // |sync_notifier| is owned and used to listen for notifications. | 451 // |sync_notifier| is owned and used to listen for notifications. |
| 448 // |report_unrecoverable_error_function| may be NULL. | 452 // |report_unrecoverable_error_function| may be NULL. |
| 449 bool Init(const FilePath& database_location, | 453 bool Init(const FilePath& database_location, |
| 450 const browser_sync::WeakHandle<browser_sync::JsEventHandler>& | 454 const browser_sync::WeakHandle<browser_sync::JsEventHandler>& |
| 451 event_handler, | 455 event_handler, |
| 452 const std::string& sync_server_and_path, | 456 const std::string& sync_server_and_path, |
| 453 int sync_server_port, | 457 int sync_server_port, |
| 454 bool use_ssl, | 458 bool use_ssl, |
| 459 const scoped_refptr<base::TaskRunner>& blocking_task_runner, |
| 455 HttpPostProviderFactory* post_factory, | 460 HttpPostProviderFactory* post_factory, |
| 456 browser_sync::ModelSafeWorkerRegistrar* registrar, | 461 browser_sync::ModelSafeWorkerRegistrar* registrar, |
| 457 browser_sync::ExtensionsActivityMonitor* | 462 browser_sync::ExtensionsActivityMonitor* |
| 458 extensions_activity_monitor, | 463 extensions_activity_monitor, |
| 459 ChangeDelegate* change_delegate, | 464 ChangeDelegate* change_delegate, |
| 460 const std::string& user_agent, | 465 const std::string& user_agent, |
| 461 const SyncCredentials& credentials, | 466 const SyncCredentials& credentials, |
| 462 sync_notifier::SyncNotifier* sync_notifier, | 467 sync_notifier::SyncNotifier* sync_notifier, |
| 463 const std::string& restored_key_for_bootstrapping, | 468 const std::string& restored_key_for_bootstrapping, |
| 464 bool setup_for_test_mode, | 469 bool setup_for_test_mode, |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 syncable::ModelTypeSet GetTypesWithEmptyProgressMarkerToken( | 649 syncable::ModelTypeSet GetTypesWithEmptyProgressMarkerToken( |
| 645 syncable::ModelTypeSet types, | 650 syncable::ModelTypeSet types, |
| 646 sync_api::UserShare* share); | 651 sync_api::UserShare* share); |
| 647 | 652 |
| 648 // Returns the string representation of a PassphraseRequiredReason value. | 653 // Returns the string representation of a PassphraseRequiredReason value. |
| 649 std::string PassphraseRequiredReasonToString(PassphraseRequiredReason reason); | 654 std::string PassphraseRequiredReasonToString(PassphraseRequiredReason reason); |
| 650 | 655 |
| 651 } // namespace sync_api | 656 } // namespace sync_api |
| 652 | 657 |
| 653 #endif // CHROME_BROWSER_SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 658 #endif // CHROME_BROWSER_SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
| OLD | NEW |