OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/rate_limiter.h" | 5 #include "components/policy/core/common/cloud/rate_limiter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/sequenced_task_runner.h" | 11 #include "base/sequenced_task_runner.h" |
12 #include "base/time/tick_clock.h" | 12 #include "base/time/tick_clock.h" |
13 | 13 |
14 namespace policy { | 14 namespace policy { |
15 | 15 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const base::TimeDelta time_until_next_callback = | 49 const base::TimeDelta time_until_next_callback = |
50 invocation_times_.front() - period_start; | 50 invocation_times_.front() - period_start; |
51 delayed_callback_.Reset( | 51 delayed_callback_.Reset( |
52 base::Bind(&RateLimiter::PostRequest, base::Unretained(this))); | 52 base::Bind(&RateLimiter::PostRequest, base::Unretained(this))); |
53 task_runner_->PostDelayedTask( | 53 task_runner_->PostDelayedTask( |
54 FROM_HERE, delayed_callback_.callback(), time_until_next_callback); | 54 FROM_HERE, delayed_callback_.callback(), time_until_next_callback); |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 } // namespace policy | 58 } // namespace policy |
OLD | NEW |