Chromium Code Reviews| Index: sync/engine/commit_queue_impl.h |
| diff --git a/sync/engine/model_type_sync_worker_impl.h b/sync/engine/commit_queue_impl.h |
| similarity index 83% |
| rename from sync/engine/model_type_sync_worker_impl.h |
| rename to sync/engine/commit_queue_impl.h |
| index 47156439aeec8f76d61c2f09f9bb69055ed1ec19..c7feadfc411c94fd4e0a41c0d9cd03cce284b46e 100644 |
| --- a/sync/engine/model_type_sync_worker_impl.h |
| +++ b/sync/engine/commit_queue_impl.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef SYNC_ENGINE_MODEL_TYPE_SYNC_WORKER_IMPL_H_ |
| -#define SYNC_ENGINE_MODEL_TYPE_SYNC_WORKER_IMPL_H_ |
| +#ifndef SYNC_ENGINE_COMMIT_QUEUE_IMPL_H_ |
| +#define SYNC_ENGINE_COMMIT_QUEUE_IMPL_H_ |
| #include "base/containers/scoped_ptr_map.h" |
| #include "base/memory/scoped_ptr.h" |
| @@ -11,7 +11,7 @@ |
| #include "base/threading/non_thread_safe.h" |
| #include "sync/base/sync_export.h" |
| #include "sync/engine/commit_contributor.h" |
| -#include "sync/engine/model_type_sync_worker.h" |
| +#include "sync/engine/commit_queue.h" |
| #include "sync/engine/nudge_handler.h" |
| #include "sync/engine/update_handler.h" |
| #include "sync/internal_api/public/base/model_type.h" |
| @@ -26,7 +26,7 @@ class SingleThreadTaskRunner; |
| namespace syncer_v2 { |
| -class ModelTypeSyncProxy; |
| +class ModelTypeProcessor; |
| class EntityTracker; |
| // A smart cache for sync types that use message passing (rather than |
| @@ -49,18 +49,18 @@ class EntityTracker; |
| // example, if the sync server sends down an update for a sync entity that is |
| // currently pending for commit, this object will detect this condition and |
| // cancel the pending commit. |
| -class SYNC_EXPORT ModelTypeSyncWorkerImpl : public syncer::UpdateHandler, |
| - public syncer::CommitContributor, |
| - public ModelTypeSyncWorker, |
| - public base::NonThreadSafe { |
| +class SYNC_EXPORT CommitQueueImpl : public syncer::UpdateHandler, |
|
stanisc
2015/08/29 00:10:00
Not the right name.
This is ModelTypeWorker since
Gang Wu
2015/08/29 05:03:02
Done.
|
| + public syncer::CommitContributor, |
| + public CommitQueue, |
| + public base::NonThreadSafe { |
| public: |
| - ModelTypeSyncWorkerImpl(syncer::ModelType type, |
| - const DataTypeState& initial_state, |
| - const UpdateResponseDataList& saved_pending_updates, |
| - scoped_ptr<syncer::Cryptographer> cryptographer, |
| - syncer::NudgeHandler* nudge_handler, |
| - scoped_ptr<ModelTypeSyncProxy> type_sync_proxy); |
| - ~ModelTypeSyncWorkerImpl() override; |
| + CommitQueueImpl(syncer::ModelType type, |
| + const DataTypeState& initial_state, |
| + const UpdateResponseDataList& saved_pending_updates, |
| + scoped_ptr<syncer::Cryptographer> cryptographer, |
| + syncer::NudgeHandler* nudge_handler, |
| + scoped_ptr<ModelTypeProcessor> type_sync_proxy); |
| + ~CommitQueueImpl() override; |
| syncer::ModelType GetModelType() const; |
| @@ -79,7 +79,7 @@ class SYNC_EXPORT ModelTypeSyncWorkerImpl : public syncer::UpdateHandler, |
| void ApplyUpdates(syncer::sessions::StatusController* status) override; |
| void PassiveApplyUpdates(syncer::sessions::StatusController* status) override; |
| - // ModelTypeSyncWorker implementation. |
| + // CommitQueue implementation. |
| void EnqueueForCommit(const CommitRequestDataList& request_list) override; |
| // CommitContributor implementation. |
| @@ -89,7 +89,7 @@ class SYNC_EXPORT ModelTypeSyncWorkerImpl : public syncer::UpdateHandler, |
| // Callback for when our contribution gets a response. |
| void OnCommitResponse(const CommitResponseDataList& response_list); |
| - base::WeakPtr<ModelTypeSyncWorkerImpl> AsWeakPtr(); |
| + base::WeakPtr<CommitQueueImpl> AsWeakPtr(); |
| private: |
| typedef base::ScopedPtrMap<std::string, scoped_ptr<EntityTracker>> EntityMap; |
| @@ -137,9 +137,9 @@ class SYNC_EXPORT ModelTypeSyncWorkerImpl : public syncer::UpdateHandler, |
| // State that applies to the entire model type. |
| DataTypeState data_type_state_; |
| - // Pointer to the ModelTypeSyncProxy associated with this worker. |
| + // Pointer to the ModelTypeProcessor associated with this worker. |
| // This is NULL when no proxy is connected.. |
| - scoped_ptr<ModelTypeSyncProxy> type_sync_proxy_; |
| + scoped_ptr<ModelTypeProcessor> type_sync_proxy_; |
| // A private copy of the most recent cryptographer known to sync. |
| // Initialized at construction time and updated with UpdateCryptographer(). |
| @@ -162,9 +162,9 @@ class SYNC_EXPORT ModelTypeSyncWorkerImpl : public syncer::UpdateHandler, |
| // the steady state. |
| EntityMap entities_; |
| - base::WeakPtrFactory<ModelTypeSyncWorkerImpl> weak_ptr_factory_; |
| + base::WeakPtrFactory<CommitQueueImpl> weak_ptr_factory_; |
| }; |
| } // namespace syncer |
| -#endif // SYNC_ENGINE_MODEL_TYPE_SYNC_WORKER_IMPL_H_ |
| +#endif // SYNC_ENGINE_COMMIT_QUEUE_IMPL_H_ |