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 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_GET_UPDATES_PROCESSOR_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_GET_UPDATES_PROCESSOR_H_ |
6 #define COMPONENTS_SYNC_ENGINE_IMPL_GET_UPDATES_PROCESSOR_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_GET_UPDATES_PROCESSOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "components/sync/base/model_type.h" | 13 #include "components/sync/base/model_type.h" |
14 #include "components/sync/base/sync_export.h" | |
15 #include "components/sync/engine/model_safe_worker.h" | 14 #include "components/sync/engine/model_safe_worker.h" |
16 #include "components/sync/protocol/sync.pb.h" | 15 #include "components/sync/protocol/sync.pb.h" |
17 #include "components/sync/sessions_impl/model_type_registry.h" | 16 #include "components/sync/sessions_impl/model_type_registry.h" |
18 | 17 |
19 namespace sync_pb { | 18 namespace sync_pb { |
20 class GetUpdatesMessage; | 19 class GetUpdatesMessage; |
21 class GetUpdatesResponse; | 20 class GetUpdatesResponse; |
22 } // namespace sync_pb | 21 } // namespace sync_pb |
23 | 22 |
24 namespace syncer { | 23 namespace syncer { |
(...skipping 10 matching lines...) Expand all Loading... |
35 } // namespace syncable | 34 } // namespace syncable |
36 | 35 |
37 class GetUpdatesDelegate; | 36 class GetUpdatesDelegate; |
38 | 37 |
39 // This class manages the set of per-type syncer objects. | 38 // This class manages the set of per-type syncer objects. |
40 // | 39 // |
41 // It owns these types and hides the details of iterating over all of them. | 40 // It owns these types and hides the details of iterating over all of them. |
42 // Most methods allow the caller to specify a subset of types on which the | 41 // Most methods allow the caller to specify a subset of types on which the |
43 // operation is to be applied. It is a logic error if the supplied set of types | 42 // operation is to be applied. It is a logic error if the supplied set of types |
44 // contains a type which was not previously registered with the manager. | 43 // contains a type which was not previously registered with the manager. |
45 class SYNC_EXPORT GetUpdatesProcessor { | 44 class GetUpdatesProcessor { |
46 public: | 45 public: |
47 explicit GetUpdatesProcessor(UpdateHandlerMap* update_handler_map, | 46 explicit GetUpdatesProcessor(UpdateHandlerMap* update_handler_map, |
48 const GetUpdatesDelegate& delegate); | 47 const GetUpdatesDelegate& delegate); |
49 ~GetUpdatesProcessor(); | 48 ~GetUpdatesProcessor(); |
50 | 49 |
51 // Downloads and processes a batch of updates for the specified types. | 50 // Downloads and processes a batch of updates for the specified types. |
52 // | 51 // |
53 // Returns SYNCER_OK if the download succeeds, SERVER_MORE_TO_DOWNLOAD if the | 52 // Returns SYNCER_OK if the download succeeds, SERVER_MORE_TO_DOWNLOAD if the |
54 // download succeeded but there are still some updates left to fetch on the | 53 // download succeeded but there are still some updates left to fetch on the |
55 // server, or an appropriate error value in case of failure. | 54 // server, or an appropriate error value in case of failure. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 UpdateHandlerMap* update_handler_map_; | 106 UpdateHandlerMap* update_handler_map_; |
108 | 107 |
109 const GetUpdatesDelegate& delegate_; | 108 const GetUpdatesDelegate& delegate_; |
110 | 109 |
111 DISALLOW_COPY_AND_ASSIGN(GetUpdatesProcessor); | 110 DISALLOW_COPY_AND_ASSIGN(GetUpdatesProcessor); |
112 }; | 111 }; |
113 | 112 |
114 } // namespace syncer | 113 } // namespace syncer |
115 | 114 |
116 #endif // COMPONENTS_SYNC_ENGINE_IMPL_GET_UPDATES_PROCESSOR_H_ | 115 #endif // COMPONENTS_SYNC_ENGINE_IMPL_GET_UPDATES_PROCESSOR_H_ |
OLD | NEW |