| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ |
| 6 #define CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ | 6 #define CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 private: | 78 private: |
| 79 friend class AsynchronousPolicyLoaderTest; | 79 friend class AsynchronousPolicyLoaderTest; |
| 80 | 80 |
| 81 // Finishes loader initialization after the threading system has been fully | 81 // Finishes loader initialization after the threading system has been fully |
| 82 // intialized. | 82 // intialized. |
| 83 void InitAfterFileThreadAvailable(); | 83 void InitAfterFileThreadAvailable(); |
| 84 | 84 |
| 85 // Replaces the existing policy to value map with a new one, sending | 85 // Replaces the existing policy to value map with a new one, sending |
| 86 // notification to the observers if there is a policy change. Must be called | 86 // notification to the observers if there is a policy change. Must be called |
| 87 // on |origin_loop_| so that it's safe to call back into the provider, which | 87 // on |origin_loop_| so that it's safe to call back into the provider, which |
| 88 // is not thread-safe. Takes ownership of |new_policy|. | 88 // is not thread-safe. |
| 89 void UpdatePolicy(DictionaryValue* new_policy); | 89 void UpdatePolicy(scoped_ptr<DictionaryValue> new_policy); |
| 90 | 90 |
| 91 // Provides the low-level mechanics for loading policy. | 91 // Provides the low-level mechanics for loading policy. |
| 92 scoped_ptr<AsynchronousPolicyProvider::Delegate> delegate_; | 92 scoped_ptr<AsynchronousPolicyProvider::Delegate> delegate_; |
| 93 | 93 |
| 94 // Current policy. | 94 // Current policy. |
| 95 scoped_ptr<DictionaryValue> policy_; | 95 scoped_ptr<DictionaryValue> policy_; |
| 96 | 96 |
| 97 // Used to create and invalidate WeakPtrs on the FILE thread. These are only | 97 // Used to create and invalidate WeakPtrs on the FILE thread. These are only |
| 98 // used to post reload tasks that can be cancelled. | 98 // used to post reload tasks that can be cancelled. |
| 99 base::WeakPtrFactory<AsynchronousPolicyLoader> weak_ptr_factory_; | 99 base::WeakPtrFactory<AsynchronousPolicyLoader> weak_ptr_factory_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 111 | 111 |
| 112 // Callback to invoke on policy updates. | 112 // Callback to invoke on policy updates. |
| 113 base::Closure updates_callback_; | 113 base::Closure updates_callback_; |
| 114 | 114 |
| 115 DISALLOW_COPY_AND_ASSIGN(AsynchronousPolicyLoader); | 115 DISALLOW_COPY_AND_ASSIGN(AsynchronousPolicyLoader); |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 } // namespace policy | 118 } // namespace policy |
| 119 | 119 |
| 120 #endif // CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ | 120 #endif // CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ |
| OLD | NEW |