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/cloud_policy_refresh_scheduler.h" | 5 #include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/task_runner.h" | 9 #include "base/task_runner.h" |
10 #include "chrome/browser/policy/cloud_policy_constants.h" | 10 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" |
11 #include "chrome/common/chrome_notification_types.h" | 11 #include "chrome/common/chrome_notification_types.h" |
12 #include "content/public/browser/notification_details.h" | 12 #include "content/public/browser/notification_details.h" |
13 | 13 |
14 namespace policy { | 14 namespace policy { |
15 | 15 |
16 const int64 CloudPolicyRefreshScheduler::kDefaultRefreshDelayMs = | 16 const int64 CloudPolicyRefreshScheduler::kDefaultRefreshDelayMs = |
17 3 * 60 * 60 * 1000; // 3 hours. | 17 3 * 60 * 60 * 1000; // 3 hours. |
18 const int64 CloudPolicyRefreshScheduler::kUnmanagedRefreshDelayMs = | 18 const int64 CloudPolicyRefreshScheduler::kUnmanagedRefreshDelayMs = |
19 24 * 60 * 60 * 1000; // 1 day. | 19 24 * 60 * 60 * 1000; // 1 day. |
20 const int64 CloudPolicyRefreshScheduler::kInitialErrorRetryDelayMs = | 20 const int64 CloudPolicyRefreshScheduler::kInitialErrorRetryDelayMs = |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 base::TimeDelta delay = | 197 base::TimeDelta delay = |
198 std::max((last_refresh_ + delta) - base::Time::NowFromSystemTime(), | 198 std::max((last_refresh_ + delta) - base::Time::NowFromSystemTime(), |
199 base::TimeDelta()); | 199 base::TimeDelta()); |
200 refresh_callback_.Reset( | 200 refresh_callback_.Reset( |
201 base::Bind(&CloudPolicyRefreshScheduler::PerformRefresh, | 201 base::Bind(&CloudPolicyRefreshScheduler::PerformRefresh, |
202 base::Unretained(this))); | 202 base::Unretained(this))); |
203 task_runner_->PostDelayedTask(FROM_HERE, refresh_callback_.callback(), delay); | 203 task_runner_->PostDelayedTask(FROM_HERE, refresh_callback_.callback(), delay); |
204 } | 204 } |
205 | 205 |
206 } // namespace policy | 206 } // namespace policy |
OLD | NEW |