OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "sync/engine/get_updates_processor.h" | 5 #include "sync/engine/get_updates_processor.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "sync/engine/get_updates_delegate.h" | 9 #include "sync/engine/get_updates_delegate.h" |
10 #include "sync/engine/sync_directory_update_handler.h" | 10 #include "sync/engine/update_handler.h" |
11 #include "sync/protocol/sync.pb.h" | 11 #include "sync/protocol/sync.pb.h" |
12 | 12 |
| 13 typedef std::vector<const sync_pb::SyncEntity*> SyncEntityList; |
| 14 typedef std::map<syncer::ModelType, SyncEntityList> TypeSyncEntityMap; |
| 15 |
13 namespace syncer { | 16 namespace syncer { |
14 | 17 |
15 typedef std::map<ModelType, size_t> TypeToIndexMap; | 18 typedef std::map<ModelType, size_t> TypeToIndexMap; |
16 | 19 |
17 namespace { | 20 namespace { |
18 | 21 |
19 // Given a GetUpdates response, iterates over all the returned items and | 22 // Given a GetUpdates response, iterates over all the returned items and |
20 // divides them according to their type. Outputs a map from model types to | 23 // divides them according to their type. Outputs a map from model types to |
21 // received SyncEntities. The output map will have entries (possibly empty) | 24 // received SyncEntities. The output map will have entries (possibly empty) |
22 // for all types in |requested_types|. | 25 // for all types in |requested_types|. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 142 |
140 return true; | 143 return true; |
141 } | 144 } |
142 | 145 |
143 void GetUpdatesProcessor::ApplyUpdates( | 146 void GetUpdatesProcessor::ApplyUpdates( |
144 sessions::StatusController* status_controller) { | 147 sessions::StatusController* status_controller) { |
145 delegate_.ApplyUpdates(status_controller, update_handler_map_); | 148 delegate_.ApplyUpdates(status_controller, update_handler_map_); |
146 } | 149 } |
147 | 150 |
148 } // namespace syncer | 151 } // namespace syncer |
OLD | NEW |