| 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 #include "chrome/browser/policy/async_policy_loader.h" | 5 #include "chrome/browser/policy/async_policy_loader.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
| 10 #include "chrome/browser/policy/policy_bundle.h" | 10 #include "components/policy/core/common/policy_bundle.h" |
| 11 | 11 |
| 12 using base::Time; | 12 using base::Time; |
| 13 using base::TimeDelta; | 13 using base::TimeDelta; |
| 14 | 14 |
| 15 namespace policy { | 15 namespace policy { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 // Amount of time to wait for the files on disk to settle before trying to load | 19 // Amount of time to wait for the files on disk to settle before trying to load |
| 20 // them. This alleviates the problem of reading partially written files and | 20 // them. This alleviates the problem of reading partially written files and |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 const TimeDelta age = now - last_modification_clock_; | 129 const TimeDelta age = now - last_modification_clock_; |
| 130 if (age < kSettleInterval) { | 130 if (age < kSettleInterval) { |
| 131 *delay = kSettleInterval - age; | 131 *delay = kSettleInterval - age; |
| 132 return false; | 132 return false; |
| 133 } | 133 } |
| 134 | 134 |
| 135 return true; | 135 return true; |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace policy | 138 } // namespace policy |
| OLD | NEW |