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_FILE_BASED_POLICY_LOADER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_FILE_BASED_POLICY_LOADER_H_ |
6 #define CHROME_BROWSER_POLICY_FILE_BASED_POLICY_LOADER_H_ | 6 #define CHROME_BROWSER_POLICY_FILE_BASED_POLICY_LOADER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // A customized asynchronous policy loader that handles loading policy from a | 26 // A customized asynchronous policy loader that handles loading policy from a |
27 // file using a FilePathWatcher. The loader creates a fallback task to load | 27 // file using a FilePathWatcher. The loader creates a fallback task to load |
28 // policy periodically in case the watcher fails and retries policy loads when | 28 // policy periodically in case the watcher fails and retries policy loads when |
29 // the watched file is in flux. | 29 // the watched file is in flux. |
30 class FileBasedPolicyLoader : public AsynchronousPolicyLoader { | 30 class FileBasedPolicyLoader : public AsynchronousPolicyLoader { |
31 public: | 31 public: |
32 explicit FileBasedPolicyLoader( | 32 explicit FileBasedPolicyLoader( |
33 FileBasedPolicyProvider::ProviderDelegate* provider_delegate); | 33 FileBasedPolicyProvider::ProviderDelegate* provider_delegate); |
34 | 34 |
35 // AsynchronousPolicyLoader overrides: | 35 // AsynchronousPolicyLoader overrides: |
36 virtual void Reload(bool force) OVERRIDE; | 36 virtual void Reload(const base::Closure& callback, bool force) OVERRIDE; |
37 | 37 |
38 void OnFilePathChanged(const FilePath& path); | 38 void OnFilePathChanged(const FilePath& path); |
39 void OnFilePathError(const FilePath& path); | 39 void OnFilePathError(const FilePath& path); |
40 | 40 |
41 protected: | 41 protected: |
42 // FileBasedPolicyLoader objects should only be deleted by | 42 // FileBasedPolicyLoader objects should only be deleted by |
43 // RefCountedThreadSafe. | 43 // RefCountedThreadSafe. |
44 friend class base::RefCountedThreadSafe<AsynchronousPolicyLoader>; | 44 friend class base::RefCountedThreadSafe<AsynchronousPolicyLoader>; |
45 virtual ~FileBasedPolicyLoader(); | 45 virtual ~FileBasedPolicyLoader(); |
46 | 46 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // wall clock times come from the same source, just in case there is some | 80 // wall clock times come from the same source, just in case there is some |
81 // non-local filesystem involved. | 81 // non-local filesystem involved. |
82 base::Time last_modification_clock_; | 82 base::Time last_modification_clock_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(FileBasedPolicyLoader); | 84 DISALLOW_COPY_AND_ASSIGN(FileBasedPolicyLoader); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace policy | 87 } // namespace policy |
88 | 88 |
89 #endif // CHROME_BROWSER_POLICY_FILE_BASED_POLICY_LOADER_H_ | 89 #endif // CHROME_BROWSER_POLICY_FILE_BASED_POLICY_LOADER_H_ |
OLD | NEW |