Chromium Code Reviews| Index: chrome/browser/sync/glue/model_associator.h |
| diff --git a/chrome/browser/sync/glue/model_associator.h b/chrome/browser/sync/glue/model_associator.h |
| index eaa2a45e3021c159c3e39514b6e73fd937914310..f64cef1982694cf3578ef1bbaf8720a37d2a0f59 100644 |
| --- a/chrome/browser/sync/glue/model_associator.h |
| +++ b/chrome/browser/sync/glue/model_associator.h |
| @@ -7,14 +7,14 @@ |
| #pragma once |
| #include "base/basictypes.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "chrome/browser/sync/engine/syncapi.h" |
| #include "chrome/browser/sync/syncable/model_type.h" |
| -namespace sync_api { |
| -class BaseNode; |
| -} |
| - |
| namespace browser_sync { |
| +class ChangeProcessor; |
| + |
| // This represents the fundamental operations used for model association that |
| // are common to all ModelAssociators and do not depend on types of the models |
| // being associated. |
| @@ -85,6 +85,34 @@ class PerDataTypeAssociatorInterface : public AssociatorInterface { |
| virtual void Disassociate(int64 sync_id) = 0; |
| }; |
| +// TODO(zea): Have this replace the normal AssociatorInterface. |
| +class NewAssociatorInterface : public AssociatorInterface, |
| + public base::RefCounted<NewAssociatorInterface> { |
|
tim (not reviewing)
2011/04/28 21:51:44
Why RefCounted?
Nicolas Zea
2011/05/03 18:59:36
Done.
|
| + public: |
| + // The model type of the associator. |
| + virtual syncable::ModelType model_type() const { |
| + return syncable::UNSPECIFIED; |
| + } |
| + |
| + // Sets the model associator's change processor. This is called by the |
| + // ProfileSyncService and gives the associator an interface to the SyncApi. |
| + virtual void set_change_processor(ChangeProcessor* processor) {} |
| + |
| + // Returns the model associator's current change processor. |
| + virtual ChangeProcessor* change_processor() { return NULL; } |
| + |
| + // TODO(zea): Change the format of this to pass all specifics information |
| + // in by reference. |
| + virtual void ApplyChangesFromSync( |
| + const sync_api::BaseTransaction* trans, |
| + const sync_api::SyncManager::ChangeRecord* changes, |
| + int change_count) {} |
| + protected: |
| + friend class base::RefCounted<NewAssociatorInterface>; |
| + |
| + virtual ~NewAssociatorInterface() {} |
| +}; |
| + |
| } // namespace browser_sync |
| #endif // CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCIATOR_H_ |