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 <map> | 8 #include <map> |
9 | 9 |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 #include "sync/base/sync_export.h" | 11 #include "sync/base/sync_export.h" |
12 #include "sync/engine/commit_contribution.h" | 12 #include "sync/engine/commit_contribution.h" |
13 #include "sync/internal_api/public/base/model_type.h" | 13 #include "sync/internal_api/public/base/model_type.h" |
14 #include "sync/internal_api/public/engine/model_safe_worker.h" | 14 #include "sync/internal_api/public/engine/model_safe_worker.h" |
15 #include "sync/internal_api/public/util/syncer_error.h" | 15 #include "sync/internal_api/public/util/syncer_error.h" |
16 #include "sync/protocol/sync.pb.h" | 16 #include "sync/protocol/sync.pb.h" |
17 #include "sync/sessions/nudge_tracker.h" | |
18 #include "sync/util/extensions_activity.h" | 17 #include "sync/util/extensions_activity.h" |
19 | 18 |
20 namespace syncer { | 19 namespace syncer { |
21 | 20 |
22 namespace sessions { | 21 namespace sessions { |
23 class StatusController; | 22 class StatusController; |
24 class SyncSession; | 23 class SyncSession; |
25 } | 24 } |
26 | 25 |
27 class CommitProcessor; | 26 class CommitProcessor; |
(...skipping 20 matching lines...) Expand all Loading... |
48 | 47 |
49 static Commit* Init( | 48 static Commit* Init( |
50 ModelTypeSet requested_types, | 49 ModelTypeSet requested_types, |
51 ModelTypeSet enabled_types, | 50 ModelTypeSet enabled_types, |
52 size_t max_entries, | 51 size_t max_entries, |
53 const std::string& account_name, | 52 const std::string& account_name, |
54 const std::string& cache_guid, | 53 const std::string& cache_guid, |
55 CommitProcessor* commit_processor, | 54 CommitProcessor* commit_processor, |
56 ExtensionsActivity* extensions_activity); | 55 ExtensionsActivity* extensions_activity); |
57 | 56 |
58 SyncerError PostAndProcessResponse(sessions::NudgeTracker* nudge_tracker, | 57 SyncerError PostAndProcessResponse( |
59 sessions::SyncSession* session, | 58 sessions::SyncSession* session, |
60 sessions::StatusController* status, | 59 sessions::StatusController* status, |
61 ExtensionsActivity* extensions_activity); | 60 ExtensionsActivity* extensions_activity); |
62 | 61 |
63 // Cleans up state associated with this commit. Must be called before the | 62 // Cleans up state associated with this commit. Must be called before the |
64 // destructor. | 63 // destructor. |
65 void CleanUp(); | 64 void CleanUp(); |
66 | 65 |
67 private: | 66 private: |
68 typedef std::map<ModelType, CommitContribution*> ContributionMap; | 67 typedef std::map<ModelType, CommitContribution*> ContributionMap; |
69 | 68 |
70 ContributionMap contributions_; | 69 ContributionMap contributions_; |
71 STLValueDeleter<ContributionMap> deleter_; | 70 STLValueDeleter<ContributionMap> deleter_; |
72 | 71 |
73 sync_pb::ClientToServerMessage message_; | 72 sync_pb::ClientToServerMessage message_; |
74 sync_pb::ClientToServerResponse response_; | 73 sync_pb::ClientToServerResponse response_; |
75 ExtensionsActivity::Records extensions_activity_buffer_; | 74 ExtensionsActivity::Records extensions_activity_buffer_; |
76 | 75 |
77 // Debug only flag used to indicate if it's safe to destruct the object. | 76 // Debug only flag used to indicate if it's safe to destruct the object. |
78 bool cleaned_up_; | 77 bool cleaned_up_; |
79 }; | 78 }; |
80 | 79 |
81 } // namespace syncer | 80 } // namespace syncer |
82 | 81 |
83 #endif // SYNC_ENGINE_COMMIT_H_ | 82 #endif // SYNC_ENGINE_COMMIT_H_ |
OLD | NEW |