Commit 90204716 authored by tzik's avatar tzik Committed by Commit Bot

Replace base::Timer with behavior-specific timers in enrollment/ and policy/

This CL replaces base::Timer with its subclasses.
As base::Timer changes its behavior subject to its construction time
flags, that makes hard to see the actual timer behavior, especially
it's unclear when a timer is injected from other components.
Also, that OnceCallback support of base::Timer is hard to implement on
the dynamically determined invocation pattern.

Bug: 850247
Change-Id: If83f289ad4c284f21d297b813d7ad25e68a2dd5b
Reviewed-on: https://chromium-review.googlesource.com/1130561Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573989}
parent 116d0c0a
...@@ -249,8 +249,7 @@ class AutoEnrollmentController::SystemClockSyncWaiter ...@@ -249,8 +249,7 @@ class AutoEnrollmentController::SystemClockSyncWaiter
// or a timeout has been reached. // or a timeout has been reached.
std::vector<SystemClockSyncCallback> system_clock_sync_callbacks_; std::vector<SystemClockSyncCallback> system_clock_sync_callbacks_;
base::Timer timeout_timer_{false /* retain_user_task */, base::OneShotTimer timeout_timer_;
false /* is_repeating */};
base::WeakPtrFactory<SystemClockSyncWaiter> weak_ptr_factory_{this}; base::WeakPtrFactory<SystemClockSyncWaiter> weak_ptr_factory_{this};
......
...@@ -237,8 +237,7 @@ class AutoEnrollmentController { ...@@ -237,8 +237,7 @@ class AutoEnrollmentController {
// something goes wrong, the timer will ensure that a decision gets made // something goes wrong, the timer will ensure that a decision gets made
// eventually, which is crucial to not block OOBE forever. See // eventually, which is crucial to not block OOBE forever. See
// http://crbug.com/433634 for background. // http://crbug.com/433634 for background.
base::Timer safeguard_timer_{false /* retain_user_task */, base::OneShotTimer safeguard_timer_;
false /* is_repeating */};
// Whether the forced re-enrollment check has to be applied. // Whether the forced re-enrollment check has to be applied.
FRERequirement fre_requirement_ = FRERequirement::kRequired; FRERequirement fre_requirement_ = FRERequirement::kRequired;
......
...@@ -175,8 +175,7 @@ class UserActiveDirectoryPolicyManager : public ActiveDirectoryPolicyManager { ...@@ -175,8 +175,7 @@ class UserActiveDirectoryPolicyManager : public ActiveDirectoryPolicyManager {
// A timer that puts a hard limit on the maximum time to wait for the initial // A timer that puts a hard limit on the maximum time to wait for the initial
// policy fetch/load. // policy fetch/load.
base::Timer initial_policy_timeout_{false /* retain_user_task */, base::OneShotTimer initial_policy_timeout_;
false /* is_repeating */};
// Callback to exit the session. // Callback to exit the session.
base::OnceClosure exit_session_; base::OnceClosure exit_session_;
......
...@@ -149,7 +149,7 @@ class PreSigninPolicyFetcher : public CloudPolicyClient::Observer { ...@@ -149,7 +149,7 @@ class PreSigninPolicyFetcher : public CloudPolicyClient::Observer {
// A timer that puts a hard limit on the maximum time to wait for the fresh // A timer that puts a hard limit on the maximum time to wait for the fresh
// policy fetch. // policy fetch.
base::Timer policy_fetch_timeout_{false, false}; base::OneShotTimer policy_fetch_timeout_;
// Used to load the policy key provided by session manager as a file. // Used to load the policy key provided by session manager as a file.
std::unique_ptr<CachedPolicyKeyLoaderChromeOS> cached_policy_key_loader_; std::unique_ptr<CachedPolicyKeyLoaderChromeOS> cached_policy_key_loader_;
......
...@@ -247,8 +247,7 @@ class UserCloudPolicyManagerChromeOS : public CloudPolicyManager, ...@@ -247,8 +247,7 @@ class UserCloudPolicyManagerChromeOS : public CloudPolicyManager,
// A timer that puts a hard limit on the maximum time to wait for a policy // A timer that puts a hard limit on the maximum time to wait for a policy
// refresh. // refresh.
base::Timer policy_refresh_timeout_{false /* retain_user_task */, base::OneShotTimer policy_refresh_timeout_;
false /* is_repeating */};
// The pref service to pass to the refresh scheduler on initialization. // The pref service to pass to the refresh scheduler on initialization.
PrefService* local_state_; PrefService* local_state_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment