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 #include "chrome/browser/policy/file_based_policy_loader.h" | 5 #include "chrome/browser/policy/file_based_policy_loader.h" |
6 | 6 |
| 7 #include "content/browser/browser_thread.h" |
| 8 |
7 namespace { | 9 namespace { |
8 | 10 |
9 // Amount of time we wait for the files on disk to settle before trying to load | 11 // Amount of time we wait for the files on disk to settle before trying to load |
10 // them. This alleviates the problem of reading partially written files and | 12 // them. This alleviates the problem of reading partially written files and |
11 // makes it possible to batch quasi-simultaneous changes. | 13 // makes it possible to batch quasi-simultaneous changes. |
12 const int kSettleIntervalSeconds = 5; | 14 const int kSettleIntervalSeconds = 5; |
13 | 15 |
14 // The time interval for rechecking policy. This is our fallback in case the | 16 // The time interval for rechecking policy. This is our fallback in case the |
15 // delegate never reports a change to the ReloadObserver. | 17 // delegate never reports a change to the ReloadObserver. |
16 const int kReloadIntervalMinutes = 15; | 18 const int kReloadIntervalMinutes = 15; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 base::TimeDelta age = now - last_modification_clock_; | 137 base::TimeDelta age = now - last_modification_clock_; |
136 if (age < settle_interval_) { | 138 if (age < settle_interval_) { |
137 *delay = settle_interval_ - age; | 139 *delay = settle_interval_ - age; |
138 return false; | 140 return false; |
139 } | 141 } |
140 | 142 |
141 return true; | 143 return true; |
142 } | 144 } |
143 | 145 |
144 } // namespace policy | 146 } // namespace policy |
OLD | NEW |