OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 void SetProvider(AsynchronousPolicyProvider* provider); | 38 void SetProvider(AsynchronousPolicyProvider* provider); |
39 | 39 |
40 const DictionaryValue* policy() const { return policy_.get(); } | 40 const DictionaryValue* policy() const { return policy_.get(); } |
41 | 41 |
42 protected: | 42 protected: |
43 friend class UpdatePolicyTask; | 43 friend class UpdatePolicyTask; |
44 | 44 |
45 // AsynchronousPolicyLoader objects should only be deleted by | 45 // AsynchronousPolicyLoader objects should only be deleted by |
46 // RefCountedThreadSafe. | 46 // RefCountedThreadSafe. |
47 friend class base::RefCountedThreadSafe<AsynchronousPolicyLoader>; | 47 friend class base::RefCountedThreadSafe<AsynchronousPolicyLoader>; |
48 virtual ~AsynchronousPolicyLoader() {} | 48 virtual ~AsynchronousPolicyLoader(); |
49 | 49 |
50 // Schedules a call to UpdatePolicy on |origin_loop_|. Takes ownership of | 50 // Schedules a call to UpdatePolicy on |origin_loop_|. Takes ownership of |
51 // |new_policy|. | 51 // |new_policy|. |
52 void PostUpdatePolicyTask(DictionaryValue* new_policy); | 52 void PostUpdatePolicyTask(DictionaryValue* new_policy); |
53 | 53 |
54 AsynchronousPolicyProvider::Delegate* delegate() { | 54 AsynchronousPolicyProvider::Delegate* delegate() { |
55 return delegate_.get(); | 55 return delegate_.get(); |
56 } | 56 } |
57 | 57 |
58 AsynchronousPolicyProvider* provider() { | 58 AsynchronousPolicyProvider* provider() { |
(...skipping 23 matching lines...) Expand all Loading... |
82 // it's possible to call back into the non thread safe provider to fire the | 82 // it's possible to call back into the non thread safe provider to fire the |
83 // notification. | 83 // notification. |
84 MessageLoop* origin_loop_; | 84 MessageLoop* origin_loop_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(AsynchronousPolicyLoader); | 86 DISALLOW_COPY_AND_ASSIGN(AsynchronousPolicyLoader); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace policy | 89 } // namespace policy |
90 | 90 |
91 #endif // CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ | 91 #endif // CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_LOADER_H_ |
OLD | NEW |