Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: sync/internal_api/sync_manager.h

Issue 10520010: Not for review: Support sync init with missing or corrupt store (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Documentation Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_SYNC_MANAGER_H_ 5 #ifndef SYNC_INTERNAL_API_SYNC_MANAGER_H_
6 #define SYNC_INTERNAL_API_SYNC_MANAGER_H_ 6 #define SYNC_INTERNAL_API_SYNC_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 /** 358 /**
359 * Gets child ids for a given id. 359 * Gets child ids for a given id.
360 * 360 *
361 * @param {string} id 64-bit id in decimal string form of the parent 361 * @param {string} id 64-bit id in decimal string form of the parent
362 * node. 362 * node.
363 * @param {Array.<string>} callback Called with the (possibly empty) 363 * @param {Array.<string>} callback Called with the (possibly empty)
364 * list of child ids. 364 * list of child ids.
365 */ 365 */
366 // function getChildNodeIds(id); 366 // function getChildNodeIds(id);
367 367
368 // Informs observers that the SyncManager initialization is complete.
369 // Returns a boolean indicating whether or not the initialization was
370 // successful and a list of the types for which data was found in the
371 // local store.
368 virtual void OnInitializationComplete( 372 virtual void OnInitializationComplete(
369 const browser_sync::WeakHandle<browser_sync::JsBackend>& 373 const browser_sync::WeakHandle<browser_sync::JsBackend>& js_backend,
370 js_backend, bool success) = 0; 374 bool success, syncable::ModelTypeSet restored_types) = 0;
371 375
372 // We are no longer permitted to communicate with the server. Sync should 376 // We are no longer permitted to communicate with the server. Sync should
373 // be disabled and state cleaned up at once. This can happen for a number 377 // be disabled and state cleaned up at once. This can happen for a number
374 // of reasons, e.g. swapping from a test instance to production, or a 378 // of reasons, e.g. swapping from a test instance to production, or a
375 // global stop syncing operation has wiped the store. 379 // global stop syncing operation has wiped the store.
376 virtual void OnStopSyncingPermanently() = 0; 380 virtual void OnStopSyncingPermanently() = 0;
377 381
378 // After a request to clear server data, these callbacks are invoked to 382 // After a request to clear server data, these callbacks are invoked to
379 // indicate success or failure. 383 // indicate success or failure.
380 virtual void OnClearServerDataSucceeded() = 0; 384 virtual void OnClearServerDataSucceeded() = 0;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 // |sync_notifier| is owned and used to listen for notifications. 444 // |sync_notifier| is owned and used to listen for notifications.
441 // |report_unrecoverable_error_function| may be NULL. 445 // |report_unrecoverable_error_function| may be NULL.
442 bool Init(const FilePath& database_location, 446 bool Init(const FilePath& database_location,
443 const browser_sync::WeakHandle<browser_sync::JsEventHandler>& 447 const browser_sync::WeakHandle<browser_sync::JsEventHandler>&
444 event_handler, 448 event_handler,
445 const std::string& sync_server_and_path, 449 const std::string& sync_server_and_path,
446 int sync_server_port, 450 int sync_server_port,
447 bool use_ssl, 451 bool use_ssl,
448 const scoped_refptr<base::TaskRunner>& blocking_task_runner, 452 const scoped_refptr<base::TaskRunner>& blocking_task_runner,
449 HttpPostProviderFactory* post_factory, 453 HttpPostProviderFactory* post_factory,
450 const browser_sync::ModelSafeRoutingInfo& model_safe_routing_info,
451 const std::vector<browser_sync::ModelSafeWorker*>& workers, 454 const std::vector<browser_sync::ModelSafeWorker*>& workers,
452 browser_sync::ExtensionsActivityMonitor* 455 browser_sync::ExtensionsActivityMonitor*
453 extensions_activity_monitor, 456 extensions_activity_monitor,
454 ChangeDelegate* change_delegate, 457 ChangeDelegate* change_delegate,
455 const std::string& user_agent, 458 const std::string& user_agent,
456 const SyncCredentials& credentials, 459 const SyncCredentials& credentials,
457 sync_notifier::SyncNotifier* sync_notifier, 460 sync_notifier::SyncNotifier* sync_notifier,
458 const std::string& restored_key_for_bootstrapping, 461 const std::string& restored_key_for_bootstrapping,
459 TestingMode testing_mode, 462 TestingMode testing_mode,
460 browser_sync::Encryptor* encryptor, 463 browser_sync::Encryptor* encryptor,
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 base::ThreadChecker thread_checker_; 620 base::ThreadChecker thread_checker_;
618 621
619 // An opaque pointer to the nested private class. 622 // An opaque pointer to the nested private class.
620 SyncInternal* data_; 623 SyncInternal* data_;
621 624
622 DISALLOW_COPY_AND_ASSIGN(SyncManager); 625 DISALLOW_COPY_AND_ASSIGN(SyncManager);
623 }; 626 };
624 627
625 bool InitialSyncEndedForTypes(syncable::ModelTypeSet types, UserShare* share); 628 bool InitialSyncEndedForTypes(syncable::ModelTypeSet types, UserShare* share);
626 629
627 syncable::ModelTypeSet GetTypesWithEmptyProgressMarkerToken(
628 syncable::ModelTypeSet types,
629 sync_api::UserShare* share);
630
631 const char* ConnectionStatusToString(ConnectionStatus status); 630 const char* ConnectionStatusToString(ConnectionStatus status);
632 631
633 // Returns the string representation of a PassphraseRequiredReason value. 632 // Returns the string representation of a PassphraseRequiredReason value.
634 const char* PassphraseRequiredReasonToString(PassphraseRequiredReason reason); 633 const char* PassphraseRequiredReasonToString(PassphraseRequiredReason reason);
635 634
636 } // namespace sync_api 635 } // namespace sync_api
637 636
638 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_ 637 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698