OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SYNC_ENGINE_COMMIT_H_ | 5 #ifndef SYNC_ENGINE_COMMIT_H_ |
6 #define SYNC_ENGINE_COMMIT_H_ | 6 #define SYNC_ENGINE_COMMIT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 typedef std::map<ModelType, std::unique_ptr<CommitContribution>> | 44 typedef std::map<ModelType, std::unique_ptr<CommitContribution>> |
45 ContributionMap; | 45 ContributionMap; |
46 | 46 |
47 Commit(ContributionMap contributions, | 47 Commit(ContributionMap contributions, |
48 const sync_pb::ClientToServerMessage& message, | 48 const sync_pb::ClientToServerMessage& message, |
49 ExtensionsActivity::Records extensions_activity_buffer); | 49 ExtensionsActivity::Records extensions_activity_buffer); |
50 | 50 |
51 // This destructor will DCHECK if CleanUp() has not been called. | 51 // This destructor will DCHECK if CleanUp() has not been called. |
52 ~Commit(); | 52 ~Commit(); |
53 | 53 |
54 static Commit* Init( | 54 static Commit* Init(ModelTypeSet requested_types, |
55 ModelTypeSet requested_types, | 55 ModelTypeSet enabled_types, |
56 ModelTypeSet enabled_types, | 56 size_t max_entries, |
57 size_t max_entries, | 57 const std::string& account_name, |
58 const std::string& account_name, | 58 const std::string& cache_guid, |
59 const std::string& cache_guid, | 59 bool cookie_jar_mismatch, |
60 bool cookie_jar_mismatch, | 60 bool cookie_jar_empty, |
61 CommitProcessor* commit_processor, | 61 CommitProcessor* commit_processor, |
62 ExtensionsActivity* extensions_activity); | 62 ExtensionsActivity* extensions_activity); |
63 | 63 |
64 SyncerError PostAndProcessResponse(sessions::NudgeTracker* nudge_tracker, | 64 SyncerError PostAndProcessResponse(sessions::NudgeTracker* nudge_tracker, |
65 sessions::SyncSession* session, | 65 sessions::SyncSession* session, |
66 sessions::StatusController* status, | 66 sessions::StatusController* status, |
67 ExtensionsActivity* extensions_activity); | 67 ExtensionsActivity* extensions_activity); |
68 | 68 |
69 // Cleans up state associated with this commit. Must be called before the | 69 // Cleans up state associated with this commit. Must be called before the |
70 // destructor. | 70 // destructor. |
71 void CleanUp(); | 71 void CleanUp(); |
72 | 72 |
73 private: | 73 private: |
74 ContributionMap contributions_; | 74 ContributionMap contributions_; |
75 | 75 |
76 sync_pb::ClientToServerMessage message_; | 76 sync_pb::ClientToServerMessage message_; |
77 sync_pb::ClientToServerResponse response_; | 77 sync_pb::ClientToServerResponse response_; |
78 ExtensionsActivity::Records extensions_activity_buffer_; | 78 ExtensionsActivity::Records extensions_activity_buffer_; |
79 | 79 |
80 // Debug only flag used to indicate if it's safe to destruct the object. | 80 // Debug only flag used to indicate if it's safe to destruct the object. |
81 bool cleaned_up_; | 81 bool cleaned_up_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(Commit); | 83 DISALLOW_COPY_AND_ASSIGN(Commit); |
84 }; | 84 }; |
85 | 85 |
86 } // namespace syncer | 86 } // namespace syncer |
87 | 87 |
88 #endif // SYNC_ENGINE_COMMIT_H_ | 88 #endif // SYNC_ENGINE_COMMIT_H_ |
OLD | NEW |