| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 SERVICES_PREFERENCES_PUBLIC_CPP_PREF_STORE_MANAGER_IMPL_H_ | 5 #ifndef SERVICES_PREFERENCES_PUBLIC_CPP_PREF_STORE_MANAGER_IMPL_H_ |
| 6 #define SERVICES_PREFERENCES_PUBLIC_CPP_PREF_STORE_MANAGER_IMPL_H_ | 6 #define SERVICES_PREFERENCES_PUBLIC_CPP_PREF_STORE_MANAGER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <unordered_map> | 10 #include <unordered_map> |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 // Have all the expected PrefStores connected? | 91 // Have all the expected PrefStores connected? |
| 92 bool AllConnected() const; | 92 bool AllConnected() const; |
| 93 | 93 |
| 94 // PrefStores that need to register before replying to any Connect calls. | 94 // PrefStores that need to register before replying to any Connect calls. |
| 95 PrefStoreTypes expected_pref_stores_; | 95 PrefStoreTypes expected_pref_stores_; |
| 96 | 96 |
| 97 // Registered pref stores. | 97 // Registered pref stores. |
| 98 PrefStorePtrs pref_store_ptrs_; | 98 PrefStorePtrs pref_store_ptrs_; |
| 99 | 99 |
| 100 // We hold on to the connection request callbacks until all expected |
| 101 // PrefStores have registered. |
| 102 std::vector<ConnectCallback> pending_callbacks_; |
| 103 |
| 100 mojo::BindingSet<mojom::PrefStoreConnector> connector_bindings_; | 104 mojo::BindingSet<mojom::PrefStoreConnector> connector_bindings_; |
| 101 mojo::BindingSet<mojom::PrefStoreRegistry> registry_bindings_; | 105 mojo::BindingSet<mojom::PrefStoreRegistry> registry_bindings_; |
| 102 std::unique_ptr<PersistentPrefStoreImpl> persistent_pref_store_; | 106 std::unique_ptr<PersistentPrefStoreImpl> persistent_pref_store_; |
| 103 mojo::BindingSet<mojom::PersistentPrefStoreConnector> | 107 mojo::BindingSet<mojom::PersistentPrefStoreConnector> |
| 104 persistent_pref_store_bindings_; | 108 persistent_pref_store_bindings_; |
| 105 mojo::Binding<mojom::PrefServiceControl> init_binding_; | 109 mojo::Binding<mojom::PrefServiceControl> init_binding_; |
| 106 | 110 |
| 107 // Requests made to connect to the service before it has been initialized. | 111 // Requests made to connect to the service before it has been initialized. |
| 108 // These will be handled when initialization completes. | 112 // These will be handled when initialization completes. |
| 109 std::vector<mojom::PersistentPrefStoreConnectorRequest> | 113 std::vector<mojom::PersistentPrefStoreConnectorRequest> |
| 110 pending_persistent_pref_store_requests_; | 114 pending_persistent_pref_store_requests_; |
| 111 | 115 |
| 112 scoped_refptr<base::SequencedWorkerPool> worker_pool_; | 116 scoped_refptr<base::SequencedWorkerPool> worker_pool_; |
| 113 | 117 |
| 114 // We hold on to the connection request callbacks until all expected | |
| 115 // PrefStores have registered. | |
| 116 std::vector<ConnectCallback> pending_callbacks_; | |
| 117 | |
| 118 DISALLOW_COPY_AND_ASSIGN(PrefStoreManagerImpl); | 118 DISALLOW_COPY_AND_ASSIGN(PrefStoreManagerImpl); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 } // namespace prefs | 121 } // namespace prefs |
| 122 | 122 |
| 123 #endif // SERVICES_PREFERENCES_PUBLIC_CPP_PREF_STORE_MANAGER_IMPL_H_ | 123 #endif // SERVICES_PREFERENCES_PUBLIC_CPP_PREF_STORE_MANAGER_IMPL_H_ |
| OLD | NEW |