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_DRIVER_NON_BLOCKING_DATA_TYPE_MANAGER_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_NON_BLOCKING_DATA_TYPE_MANAGER_H_ |
6 #define COMPONENTS_SYNC_DRIVER_NON_BLOCKING_DATA_TYPE_MANAGER_H_ | 6 #define COMPONENTS_SYNC_DRIVER_NON_BLOCKING_DATA_TYPE_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "sync/internal_api/public/base/model_type.h" | 14 #include "sync/internal_api/public/base/model_type.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class SequencedTaskRunner; | 17 class SequencedTaskRunner; |
18 } // namespace base | 18 } // namespace base |
19 | 19 |
20 namespace syncer { | 20 namespace syncer { |
21 class ModelTypeSyncProxyImpl; | 21 class ModelTypeSyncProxyImpl; |
22 class SyncContextProxy; | 22 class SyncContextProxy; |
23 } //namespace syncer | 23 } //namespace syncer |
24 | 24 |
25 namespace browser_sync { | 25 namespace sync_driver { |
26 | 26 |
27 class NonBlockingDataTypeController; | 27 class NonBlockingDataTypeController; |
28 | 28 |
29 // Manages a set of NonBlockingDataTypeControllers. | 29 // Manages a set of NonBlockingDataTypeControllers. |
30 // | 30 // |
31 // Each NonBlockingDataTypeController instance handles the logic around | 31 // Each NonBlockingDataTypeController instance handles the logic around |
32 // enabling and disabling sync for a particular non-blocking type. This class | 32 // enabling and disabling sync for a particular non-blocking type. This class |
33 // manages all the controllers. | 33 // manages all the controllers. |
34 class NonBlockingDataTypeManager { | 34 class NonBlockingDataTypeManager { |
35 public: | 35 public: |
(...skipping 24 matching lines...) Expand all Loading... |
60 | 60 |
61 // Updates the set of types the user wants to have synced. | 61 // Updates the set of types the user wants to have synced. |
62 void SetPreferredTypes(syncer::ModelTypeSet types); | 62 void SetPreferredTypes(syncer::ModelTypeSet types); |
63 | 63 |
64 // Returns the list of all known non-blocking sync types that registered with | 64 // Returns the list of all known non-blocking sync types that registered with |
65 // RegisterType. | 65 // RegisterType. |
66 syncer::ModelTypeSet GetRegisteredTypes() const; | 66 syncer::ModelTypeSet GetRegisteredTypes() const; |
67 | 67 |
68 private: | 68 private: |
69 typedef | 69 typedef |
70 std::map<syncer::ModelType, browser_sync::NonBlockingDataTypeController*> | 70 std::map<syncer::ModelType, NonBlockingDataTypeController*> |
71 NonBlockingDataTypeControllerMap; | 71 NonBlockingDataTypeControllerMap; |
72 | 72 |
73 // List of data type controllers for non-blocking types. | 73 // List of data type controllers for non-blocking types. |
74 NonBlockingDataTypeControllerMap non_blocking_data_type_controllers_; | 74 NonBlockingDataTypeControllerMap non_blocking_data_type_controllers_; |
75 | 75 |
76 // Deleter for elements of the non-blocking data types controller map. | 76 // Deleter for elements of the non-blocking data types controller map. |
77 STLValueDeleter<NonBlockingDataTypeControllerMap> | 77 STLValueDeleter<NonBlockingDataTypeControllerMap> |
78 non_blocking_data_type_controllers_deleter_; | 78 non_blocking_data_type_controllers_deleter_; |
79 }; | 79 }; |
80 | 80 |
81 } // namespace browser_sync | 81 } // namespace sync_driver |
82 | 82 |
83 #endif // COMPONENTS_SYNC_DRIVER_NON_BLOCKING_DATA_TYPE_MANAGER_H_ | 83 #endif // COMPONENTS_SYNC_DRIVER_NON_BLOCKING_DATA_TYPE_MANAGER_H_ |
OLD | NEW |