#include "chrome/browser/sync/glue/sync_backend_host_impl.h"
#include "components/sync_driver/system_encryptor.h"
#include "sync/internal_api/public/base/cancelation_signal.h"
+#include "sync/internal_api/public/sessions/type_debug_info_observer.h"
#include "sync/internal_api/public/sync_encryption_handler.h"
#include "url/gurl.h"
class SyncBackendHostCore
: public base::RefCountedThreadSafe<SyncBackendHostCore>,
public syncer::SyncEncryptionHandler::Observer,
- public syncer::SyncManager::Observer {
+ public syncer::SyncManager::Observer,
+ public syncer::TypeDebugInfoObserver {
public:
SyncBackendHostCore(const std::string& name,
const base::FilePath& sync_data_folder_path,
virtual void OnPassphraseTypeChanged(syncer::PassphraseType type,
base::Time passphrase_time) OVERRIDE;
+ // TypeDebugInfoObserver implementation
+ virtual void OnCommitCountersUpdated(
+ syncer::ModelType type,
+ const syncer::CommitCounters& counters) OVERRIDE;
+ virtual void OnUpdateCountersUpdated(
+ syncer::ModelType type,
+ const syncer::UpdateCounters& counters) OVERRIDE;
+ virtual void OnStatusCountersUpdated(
+ syncer::ModelType type,
+ const syncer::StatusCounters& counters) OVERRIDE;
+
// Forwards an invalidation state change to the sync manager.
void DoOnInvalidatorStateChange(syncer::InvalidatorState state);
return synced_device_tracker_.get();
}
- void SetForwardProtocolEvents(bool forward);
+ void SendBufferedProtocolEventsAndEnableForwarding();
+ void DisableProtocolEventForwarding();
+
+ // Enables the forwarding of directory type debug counters to the
+ // SyncBackendHost. Also requests that updates to all counters be
+ // emitted right away to initialize any new listeners' states.
+ void EnableDirectoryTypeDebugInfoForwarding();
+
+ // Disables forwarding of directory type debug counters.
+ void DisableDirectoryTypeDebugInfoForwarding();
// Delete the sync data folder to cleanup backend data. Happens the first
// time sync is enabled for a user (to prevent accidentally reusing old
return &release_request_context_signal_;
}
+ void GetAllNodesForTypes(
+ syncer::ModelTypeSet types,
+ scoped_refptr<base::SequencedTaskRunner> task_runner,
+ base::Callback<void(const std::vector<syncer::ModelType>& type,
+ ScopedVector<base::ListValue>) > callback);
+
private:
friend class base::RefCountedThreadSafe<SyncBackendHostCore>;
friend class SyncBackendHostForProfileSyncTest;