Home | History | Annotate | Download | only in engine
      1 // Copyright 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef SYNC_ENGINE_GET_COMMIT_IDS_H_
      6 #define SYNC_ENGINE_GET_COMMIT_IDS_H_
      7 
      8 #include <vector>
      9 
     10 #include "sync/base/sync_export.h"
     11 #include "sync/internal_api/public/base/model_type.h"
     12 #include "sync/syncable/directory.h"
     13 
     14 using std::vector;
     15 
     16 namespace syncer {
     17 
     18 namespace syncable {
     19 class BaseTransaction;
     20 }
     21 
     22 // Returns up to |max_entries| metahandles of entries that belong to the
     23 // specified |type| and are ready for commit.
     24 //
     25 // This function returns handles in "commit order".  A valid commit ordering is
     26 // one where server-unknown items are committed parents-first, and deletions
     27 // are committed children-first.
     28 //
     29 // This function also enforces some position ordering constraints that are no
     30 // longer necessary.  We should relax those constraints.  See crbug.com/287938.
     31 SYNC_EXPORT_PRIVATE void GetCommitIdsForType(
     32     syncable::BaseTransaction* trans,
     33     ModelType type,
     34     size_t max_entries,
     35     std::vector<int64>* out);
     36 
     37 }  // namespace syncer
     38 
     39 #endif  // SYNC_ENGINE_GET_COMMIT_IDS_H_
     40