OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ |
6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 17 #include "base/threading/thread_checker.h" |
17 #include "components/policy/core/common/configuration_policy_provider.h" | 18 #include "components/policy/core/common/configuration_policy_provider.h" |
18 #include "components/policy/core/common/policy_bundle.h" | 19 #include "components/policy/core/common/policy_bundle.h" |
19 #include "components/policy/core/common/policy_service.h" | 20 #include "components/policy/core/common/policy_service.h" |
20 #include "components/policy/policy_export.h" | 21 #include "components/policy/policy_export.h" |
21 | 22 |
22 namespace policy { | 23 namespace policy { |
23 | 24 |
24 class PolicyMap; | 25 class PolicyMap; |
25 | 26 |
26 class POLICY_EXPORT PolicyServiceImpl | 27 class POLICY_EXPORT PolicyServiceImpl |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 std::set<ConfigurationPolicyProvider*> refresh_pending_; | 88 std::set<ConfigurationPolicyProvider*> refresh_pending_; |
88 | 89 |
89 // List of callbacks to invoke once all providers refresh after a | 90 // List of callbacks to invoke once all providers refresh after a |
90 // RefreshPolicies() call. | 91 // RefreshPolicies() call. |
91 std::vector<base::Closure> refresh_callbacks_; | 92 std::vector<base::Closure> refresh_callbacks_; |
92 | 93 |
93 // Used to create tasks to delay new policy updates while we may be already | 94 // Used to create tasks to delay new policy updates while we may be already |
94 // processing previous policy updates. | 95 // processing previous policy updates. |
95 base::WeakPtrFactory<PolicyServiceImpl> update_task_ptr_factory_; | 96 base::WeakPtrFactory<PolicyServiceImpl> update_task_ptr_factory_; |
96 | 97 |
| 98 // Used to verify thread-safe usage (mostly wrt observers_). |
| 99 base::ThreadChecker thread_checker_; |
| 100 |
97 DISALLOW_COPY_AND_ASSIGN(PolicyServiceImpl); | 101 DISALLOW_COPY_AND_ASSIGN(PolicyServiceImpl); |
98 }; | 102 }; |
99 | 103 |
100 } // namespace policy | 104 } // namespace policy |
101 | 105 |
102 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ | 106 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ |
OLD | NEW |