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

Unified Diff: chrome/browser/policy/cloud_policy_controller.cc

Issue 7941008: Cosmetic cleanups in chrome/browser/policy/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload was broken? Created 9 years, 3 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: chrome/browser/policy/cloud_policy_controller.cc
diff --git a/chrome/browser/policy/cloud_policy_controller.cc b/chrome/browser/policy/cloud_policy_controller.cc
index 0d454a6338db62f295412a487323f49c283554b3..09371b34053e8b71cbdc0729c40a24921fd9544c 100644
--- a/chrome/browser/policy/cloud_policy_controller.cc
+++ b/chrome/browser/policy/cloud_policy_controller.cc
@@ -5,21 +5,41 @@
#include "chrome/browser/policy/cloud_policy_controller.h"
#include <algorithm>
+#include <string>
#include "base/bind.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/rand_util.h"
#include "base/string_util.h"
+#include "base/time.h"
#include "chrome/browser/policy/cloud_policy_cache_base.h"
#include "chrome/browser/policy/cloud_policy_subsystem.h"
+#include "chrome/browser/policy/delayed_work_scheduler.h"
#include "chrome/browser/policy/device_management_service.h"
+#include "chrome/browser/policy/device_token_fetcher.h"
#include "chrome/browser/policy/enterprise_metrics.h"
+#include "chrome/browser/policy/policy_notifier.h"
#include "chrome/browser/policy/proto/device_management_constants.h"
#include "chrome/common/guid.h"
namespace {
+// The maximum ratio in percent of the policy refresh rate we use for adjusting
+// the policy refresh time instant. The rationale is to avoid load spikes from
+// many devices that were set up in sync for some reason.
+const int kPolicyRefreshDeviationFactorPercent = 10;
+// Maximum deviation we are willing to accept.
+const int64 kPolicyRefreshDeviationMaxInMilliseconds = 30 * 60 * 1000;
+
+// These are the base values for delays before retrying after an error. They
+// will be doubled each time they are used.
+const int64 kPolicyRefreshErrorDelayInMilliseconds =
+ 5 * 60 * 1000; // 5 minutes.
+
+// Default value for the policy refresh rate.
+const int kPolicyRefreshRateInMilliseconds = 3 * 60 * 60 * 1000; // 3 hours.
+
// Domain names that are known not to be managed.
// We don't register the device when such a user logs in.
const char* kNonManagedDomains[] = {
@@ -44,28 +64,12 @@ bool CanBeInManagedDomain(const std::string& username) {
return true;
}
-}
+} // namespace
namespace policy {
namespace em = enterprise_management;
-// The maximum ratio in percent of the policy refresh rate we use for adjusting
-// the policy refresh time instant. The rationale is to avoid load spikes from
-// many devices that were set up in sync for some reason.
-static const int kPolicyRefreshDeviationFactorPercent = 10;
-// Maximum deviation we are willing to accept.
-static const int64 kPolicyRefreshDeviationMaxInMilliseconds = 30 * 60 * 1000;
-
-// These are the base values for delays before retrying after an error. They
-// will be doubled each time they are used.
-static const int64 kPolicyRefreshErrorDelayInMilliseconds =
- 5 * 60 * 1000; // 5 minutes
-
-// Default value for the policy refresh rate.
-static const int kPolicyRefreshRateInMilliseconds =
- 3 * 60 * 60 * 1000; // 3 hours.
-
CloudPolicyController::CloudPolicyController(
DeviceManagementService* service,
CloudPolicyCacheBase* cache,
« no previous file with comments | « chrome/browser/policy/cloud_policy_controller.h ('k') | chrome/browser/policy/cloud_policy_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698