1 // Copyright (c) 2012 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_COMMIT_H_ 6 #define SYNC_ENGINE_COMMIT_H_ 7 8 #include "sync/internal_api/public/base/model_type.h" 9 #include "sync/internal_api/public/util/syncer_error.h" 10 11 namespace syncer { 12 13 namespace sessions { 14 class SyncSession; 15 } 16 17 class Syncer; 18 19 // This function will commit batches of unsynced items to the server until the 20 // number of unsynced and ready to commit items reaches zero or an error is 21 // encountered. A request to exit early will be treated as an error and will 22 // abort any blocking operations. 23 // 24 // The Syncer parameter is provided only for access to its ExitRequested() 25 // method. This is technically unnecessary since an early exit request should 26 // be detected as we attempt to contact the sync server. 27 // 28 // The SyncSession parameter contains pointers to various bits of state, 29 // including the syncable::Directory that contains all sync items and the 30 // ServerConnectionManager used to contact the server. 31 SyncerError BuildAndPostCommits( 32 ModelTypeSet request_types, 33 Syncer* syncer, 34 sessions::SyncSession* session); 35 36 } // namespace syncer 37 38 #endif // SYNC_ENGINE_COMMIT_H_ 39