Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8596)

Unified Diff: components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc

Issue 375933002: Remove cloud policy refresh rate limit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc
diff --git a/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc
index ea4d53d6b49df9b8c041739f0350ee12b63cd004..77f86c2823948565b8c5f9dc9039d2ca6d38b821 100644
--- a/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc
+++ b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc
@@ -11,19 +11,10 @@
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
#include "base/sequenced_task_runner.h"
-#include "base/time/default_tick_clock.h"
-#include "base/time/tick_clock.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
namespace policy {
-namespace {
-
-// The maximum rate at which to refresh policies.
-const size_t kMaxRefreshesPerHour = 5;
-
-} // namespace
-
#if defined(OS_ANDROID) || defined(OS_IOS)
const int64 CloudPolicyRefreshScheduler::kDefaultRefreshDelayMs =
@@ -73,12 +64,6 @@ CloudPolicyRefreshScheduler::CloudPolicyRefreshScheduler(
task_runner_(task_runner),
error_retry_delay_ms_(kInitialErrorRetryDelayMs),
refresh_delay_ms_(kDefaultRefreshDelayMs),
- rate_limiter_(kMaxRefreshesPerHour,
- base::TimeDelta::FromHours(1),
- base::Bind(&CloudPolicyRefreshScheduler::RefreshNow,
- base::Unretained(this)),
- task_runner_,
- scoped_ptr<base::TickClock>(new base::DefaultTickClock())),
invalidations_available_(false),
creation_time_(base::Time::NowFromSystemTime()) {
client_->AddObserver(this);
@@ -102,7 +87,7 @@ void CloudPolicyRefreshScheduler::SetRefreshDelay(int64 refresh_delay) {
}
void CloudPolicyRefreshScheduler::RefreshSoon() {
- rate_limiter_.PostRequest();
+ RefreshNow();
}
void CloudPolicyRefreshScheduler::SetInvalidationServiceAvailability(

Powered by Google App Engine
This is Rietveld 408576698