OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_ENGINE_GET_COMMIT_IDS_COMMAND_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_GET_COMMIT_IDS_COMMAND_H_ |
6 #define CHROME_BROWSER_SYNC_ENGINE_GET_COMMIT_IDS_COMMAND_H_ | 6 #define CHROME_BROWSER_SYNC_ENGINE_GET_COMMIT_IDS_COMMAND_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
| 12 #include "base/compiler_specific.h" |
12 #include "chrome/browser/sync/engine/syncer_command.h" | 13 #include "chrome/browser/sync/engine/syncer_command.h" |
13 #include "chrome/browser/sync/engine/syncer_util.h" | 14 #include "chrome/browser/sync/engine/syncer_util.h" |
14 #include "chrome/browser/sync/sessions/ordered_commit_set.h" | 15 #include "chrome/browser/sync/sessions/ordered_commit_set.h" |
15 #include "chrome/browser/sync/sessions/sync_session.h" | 16 #include "chrome/browser/sync/sessions/sync_session.h" |
16 | 17 |
17 using std::pair; | 18 using std::pair; |
18 using std::vector; | 19 using std::vector; |
19 | 20 |
20 namespace browser_sync { | 21 namespace browser_sync { |
21 | 22 |
22 class GetCommitIdsCommand : public SyncerCommand { | 23 class GetCommitIdsCommand : public SyncerCommand { |
23 friend class SyncerTest; | 24 friend class SyncerTest; |
24 | 25 |
25 public: | 26 public: |
26 explicit GetCommitIdsCommand(int commit_batch_size); | 27 explicit GetCommitIdsCommand(int commit_batch_size); |
27 virtual ~GetCommitIdsCommand(); | 28 virtual ~GetCommitIdsCommand(); |
28 | 29 |
29 // SyncerCommand implementation. | 30 // SyncerCommand implementation. |
30 virtual void ExecuteImpl(sessions::SyncSession* session); | 31 virtual void ExecuteImpl(sessions::SyncSession* session) OVERRIDE; |
31 | 32 |
32 // Builds a vector of IDs that should be committed. | 33 // Builds a vector of IDs that should be committed. |
33 void BuildCommitIds(const vector<int64>& unsynced_handles, | 34 void BuildCommitIds(const vector<int64>& unsynced_handles, |
34 syncable::WriteTransaction* write_transaction, | 35 syncable::WriteTransaction* write_transaction, |
35 const ModelSafeRoutingInfo& routes); | 36 const ModelSafeRoutingInfo& routes); |
36 | 37 |
37 // TODO(chron): Remove writes from this iterator. As a warning, this | 38 // TODO(chron): Remove writes from this iterator. As a warning, this |
38 // iterator causes writes to entries and so isn't a pure iterator. | 39 // iterator causes writes to entries and so isn't a pure iterator. |
39 // It will do Put(IS_UNSYNCED). Refactor this out later. | 40 // It will do Put(IS_UNSYNCED). Refactor this out later. |
40 class CommitMetahandleIterator { | 41 class CommitMetahandleIterator { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 int requested_commit_batch_size_; | 148 int requested_commit_batch_size_; |
148 bool passphrase_missing_; | 149 bool passphrase_missing_; |
149 syncable::ModelTypeSet encrypted_types_; | 150 syncable::ModelTypeSet encrypted_types_; |
150 | 151 |
151 DISALLOW_COPY_AND_ASSIGN(GetCommitIdsCommand); | 152 DISALLOW_COPY_AND_ASSIGN(GetCommitIdsCommand); |
152 }; | 153 }; |
153 | 154 |
154 } // namespace browser_sync | 155 } // namespace browser_sync |
155 | 156 |
156 #endif // CHROME_BROWSER_SYNC_ENGINE_GET_COMMIT_IDS_COMMAND_H_ | 157 #endif // CHROME_BROWSER_SYNC_ENGINE_GET_COMMIT_IDS_COMMAND_H_ |
OLD | NEW |