Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: sync/engine/commit_contribution.h

Issue 161253002: sync: Add interfaces for per-type sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another win compile fix Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/engine/commit.cc ('k') | sync/engine/commit_contribution.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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_CONTRIBUTION_H_
6 #define SYNC_ENGINE_COMMIT_CONTRIBUTION_H_
7
8 #include "sync/base/sync_export.h"
9 #include "sync/internal_api/public/util/syncer_error.h"
10 #include "sync/protocol/sync.pb.h"
11 #include "sync/sessions/status_controller.h"
12
13 namespace syncer {
14
15 namespace sessions {
16 class StatusController;
17 } // namespace sessions
18
19 // This class represents a set of items belonging to a particular data type that
20 // have been selected from a CommitContributor and prepared for commit.
21 //
22 // This class handles the bookkeeping related to the commit of these items.
23 class SYNC_EXPORT_PRIVATE CommitContribution {
24 public:
25 CommitContribution();
26 virtual ~CommitContribution() = 0;
27
28 // Serialize this contribution's entries to the given commit request |msg|.
29 //
30 // This function is not const. It may update some state in this contribution
31 // that will be used when processing the associated commit response. This
32 // function should not be called more than once.
33 virtual void AddToCommitMessage(sync_pb::ClientToServerMessage* msg) = 0;
34
35 // Updates this contribution's contents in accordance with the provided
36 // |response|.
37 //
38 // It is not valid to call this function unless AddToCommitMessage() was
39 // called earlier. This function should not be called more than once.
40 virtual SyncerError ProcessCommitResponse(
41 const sync_pb::ClientToServerResponse& response,
42 sessions::StatusController* status) = 0;
43
44 // Cleans up any temproary state associated with the commit. Must be called
45 // before destruction.
46 virtual void CleanUp() = 0;
47
48 // Returns the number of entries included in this contribution.
49 virtual size_t GetNumEntries() const = 0;
50 };
51
52 } // namespace syncer
53
54 #endif // SYNC_ENGINE_COMMIT_CONTRIBUTION_H_
OLDNEW
« no previous file with comments | « sync/engine/commit.cc ('k') | sync/engine/commit_contribution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698