diff options
Diffstat (limited to 'chrome/browser/sync/engine')
6 files changed, 36 insertions, 21 deletions
diff --git a/chrome/browser/sync/engine/model_changing_syncer_command.cc b/chrome/browser/sync/engine/model_changing_syncer_command.cc index b2131b4..cc2a8eb 100644 --- a/chrome/browser/sync/engine/model_changing_syncer_command.cc +++ b/chrome/browser/sync/engine/model_changing_syncer_command.cc @@ -29,4 +29,9 @@ void ModelChangingSyncerCommand::ExecuteImpl(sessions::SyncSession* session) { } } +bool ModelChangingSyncerCommand::ModelNeutralExecuteImpl( + sessions::SyncSession* session) { + return true; +} + } // namespace browser_sync diff --git a/chrome/browser/sync/engine/model_changing_syncer_command.h b/chrome/browser/sync/engine/model_changing_syncer_command.h index ae59272..f6d6a43 100644 --- a/chrome/browser/sync/engine/model_changing_syncer_command.h +++ b/chrome/browser/sync/engine/model_changing_syncer_command.h @@ -42,9 +42,7 @@ class ModelChangingSyncerCommand : public SyncerCommand { // *without* a ModelSafeGroup restriction in place on the SyncSession. // Returns true on success, false on failure. // TODO(tim): Remove this (bug 36594). - virtual bool ModelNeutralExecuteImpl(sessions::SyncSession* session) { - return true; - } + virtual bool ModelNeutralExecuteImpl(sessions::SyncSession* session); // Abstract method to be implemented by subclasses to handle logic that // operates on the model. This is invoked with a SyncSession ModelSafeGroup diff --git a/chrome/browser/sync/engine/net/server_connection_manager.cc b/chrome/browser/sync/engine/net/server_connection_manager.cc index 41e79f4..20776fe 100644 --- a/chrome/browser/sync/engine/net/server_connection_manager.cc +++ b/chrome/browser/sync/engine/net/server_connection_manager.cc @@ -329,6 +329,10 @@ std::string ServerConnectionManager::GetServerHost() const { return gurl.host(); } +ServerConnectionManager::Post* ServerConnectionManager::MakePost() { + return NULL; // For testing. +} + bool FillMessageWithShareDetails(sync_pb::ClientToServerMessage* csm, syncable::DirectoryManager* manager, const std::string& share) { diff --git a/chrome/browser/sync/engine/net/server_connection_manager.h b/chrome/browser/sync/engine/net/server_connection_manager.h index 0363993..6380151 100644 --- a/chrome/browser/sync/engine/net/server_connection_manager.h +++ b/chrome/browser/sync/engine/net/server_connection_manager.h @@ -275,9 +275,7 @@ class ServerConnectionManager { // Factory method to create a Post object we can use for communication with // the server. - virtual Post* MakePost() { - return NULL; // For testing. - }; + virtual Post* MakePost(); void set_client_id(const std::string& client_id) { DCHECK(client_id_.empty()); diff --git a/chrome/browser/sync/engine/syncer_thread.cc b/chrome/browser/sync/engine/syncer_thread.cc index 12b3435..501577dd 100644 --- a/chrome/browser/sync/engine/syncer_thread.cc +++ b/chrome/browser/sync/engine/syncer_thread.cc @@ -364,6 +364,22 @@ void SyncerThread::ThreadMainLoop() { #endif } +void SyncerThread::SetConnected(bool connected) { + DCHECK(!thread_.IsRunning()); + vault_.connected_ = connected; +} + +void SyncerThread::SetSyncerPollingInterval(base::TimeDelta interval) { + // TODO(timsteele): Use TimeDelta internally. + syncer_polling_interval_ = static_cast<int>(interval.InSeconds()); +} + +void SyncerThread::SetSyncerShortPollInterval(base::TimeDelta interval) { + // TODO(timsteele): Use TimeDelta internally. + syncer_short_poll_interval_seconds_ = + static_cast<int>(interval.InSeconds()); +} + void SyncerThread::WaitUntilConnectedOrQuit() { VLOG(1) << "Syncer thread waiting for connection."; Notify(SyncEngineEvent::SYNCER_THREAD_WAITING_FOR_CONNECTION); @@ -428,6 +444,10 @@ void SyncerThread::ExitPausedState() { Notify(SyncEngineEvent::SYNCER_THREAD_RESUMED); } +void SyncerThread::DisableIdleDetection() { + disable_idle_detection_ = true; +} + // We check how long the user's been idle and sync less often if the machine is // not in use. The aim is to reduce server load. SyncerThread::WaitInterval SyncerThread::CalculatePollingWaitTime( diff --git a/chrome/browser/sync/engine/syncer_thread.h b/chrome/browser/sync/engine/syncer_thread.h index b079c55..6681225 100644 --- a/chrome/browser/sync/engine/syncer_thread.h +++ b/chrome/browser/sync/engine/syncer_thread.h @@ -151,20 +151,10 @@ class SyncerThread : public base::RefCountedThreadSafe<SyncerThread>, virtual void ThreadMain(); void ThreadMainLoop(); - virtual void SetConnected(bool connected) { - DCHECK(!thread_.IsRunning()); - vault_.connected_ = connected; - } - - virtual void SetSyncerPollingInterval(base::TimeDelta interval) { - // TODO(timsteele): Use TimeDelta internally. - syncer_polling_interval_ = static_cast<int>(interval.InSeconds()); - } - virtual void SetSyncerShortPollInterval(base::TimeDelta interval) { - // TODO(timsteele): Use TimeDelta internally. - syncer_short_poll_interval_seconds_ = - static_cast<int>(interval.InSeconds()); - } + virtual void SetConnected(bool connected); + + virtual void SetSyncerPollingInterval(base::TimeDelta interval); + virtual void SetSyncerShortPollInterval(base::TimeDelta interval); // Needed to emulate the behavior of pthread_create, which synchronously // started the thread and set the value of thread_running_ to true. @@ -305,7 +295,7 @@ class SyncerThread : public base::RefCountedThreadSafe<SyncerThread>, void ExitPausedState(); // For unit tests only. - virtual void DisableIdleDetection() { disable_idle_detection_ = true; } + virtual void DisableIdleDetection(); // This sets all conditions for syncer thread termination but does not // actually join threads. It is expected that Stop will be called at some |