Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / sync / engine / directory_commit_contribution.h
index 508ac7c..d8d6aa9 100644 (file)
@@ -14,6 +14,7 @@
 #include "sync/internal_api/public/base/model_type.h"
 #include "sync/internal_api/public/util/syncer_error.h"
 #include "sync/protocol/sync.pb.h"
+#include "sync/sessions/directory_type_debug_info_emitter.h"
 #include "sync/sessions/status_controller.h"
 
 namespace syncer {
@@ -36,7 +37,7 @@ class SYNC_EXPORT_PRIVATE DirectoryCommitContribution
     : public CommitContribution {
  public:
   // This destructor will DCHECK if UnsetSyncingBits() has not been called yet.
-  virtual ~DirectoryCommitContribution();
+  ~DirectoryCommitContribution() override;
 
   // Build a CommitContribution from the IS_UNSYNCED items in |dir| with the
   // given |type|.  The contribution will include at most |max_items| entries.
@@ -47,14 +48,15 @@ class SYNC_EXPORT_PRIVATE DirectoryCommitContribution
   static scoped_ptr<DirectoryCommitContribution> Build(
       syncable::Directory* dir,
       ModelType type,
-      size_t max_items);
+      size_t max_items,
+      DirectoryTypeDebugInfoEmitter* debug_info_emitter);
 
   // Serialize this contribution's entries to the given commit request |msg|.
   //
   // This function is not const.  It will update some state in this contribution
   // that will be used when processing the associated commit response.  This
   // function should not be called more than once.
-  virtual void AddToCommitMessage(sync_pb::ClientToServerMessage* msg) OVERRIDE;
+  void AddToCommitMessage(sync_pb::ClientToServerMessage* msg) override;
 
   // Updates this contribution's contents in accordance with the provided
   // |response|.
@@ -62,16 +64,16 @@ class SYNC_EXPORT_PRIVATE DirectoryCommitContribution
   // This function may make model-neutral changes to the directory.  It is not
   // valid to call this function unless AddToCommitMessage() was called earlier.
   // This function should not be called more than once.
-  virtual SyncerError ProcessCommitResponse(
+  SyncerError ProcessCommitResponse(
       const sync_pb::ClientToServerResponse& response,
-      sessions::StatusController* status) OVERRIDE;
+      sessions::StatusController* status) override;
 
-  // Cleans up any temproary state associated with the commit.  Must be called
+  // Cleans up any temporary state associated with the commit.  Must be called
   // before destruction.
-  virtual void CleanUp() OVERRIDE;
+  void CleanUp() override;
 
   // Returns the number of entries included in this contribution.
-  virtual size_t GetNumEntries() const OVERRIDE;
+  size_t GetNumEntries() const override;
 
  private:
   class DirectoryCommitContributionTest;
@@ -82,13 +84,16 @@ class SYNC_EXPORT_PRIVATE DirectoryCommitContribution
   DirectoryCommitContribution(
       const std::vector<int64>& metahandles,
       const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>& entities,
-      syncable::Directory* directory);
+      const sync_pb::DataTypeContext& context,
+      syncable::Directory* directory,
+      DirectoryTypeDebugInfoEmitter* debug_info_emitter);
 
   void UnsetSyncingBits();
 
   syncable::Directory* dir_;
   const std::vector<int64> metahandles_;
   const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity> entities_;
+  sync_pb::DataTypeContext context_;
   size_t entries_start_index_;
 
   // This flag is tracks whether or not the directory entries associated with
@@ -97,6 +102,9 @@ class SYNC_EXPORT_PRIVATE DirectoryCommitContribution
   // called.  This flag must be unset by the time our destructor is called.
   bool syncing_bits_set_;
 
+  // A pointer to the commit counters of our parent CommitContributor.
+  DirectoryTypeDebugInfoEmitter* debug_info_emitter_;
+
   DISALLOW_COPY_AND_ASSIGN(DirectoryCommitContribution);
 };