| Index: components/policy/core/common/cloud/cloud_policy_validator.cc
|
| diff --git a/components/policy/core/common/cloud/cloud_policy_validator.cc b/components/policy/core/common/cloud/cloud_policy_validator.cc
|
| index 3ac136b7cd6c4dc3e58038eb409f4adea49672c6..91056ada5c94575f2c37683d1895ad03427de455 100644
|
| --- a/components/policy/core/common/cloud/cloud_policy_validator.cc
|
| +++ b/components/policy/core/common/cloud/cloud_policy_validator.cc
|
| @@ -57,11 +57,10 @@ void CloudPolicyValidatorBase::ValidateTimestamp(
|
| base::Time now,
|
| ValidateTimestampOption timestamp_option) {
|
| validation_flags_ |= VALIDATE_TIMESTAMP;
|
| - timestamp_not_before_ =
|
| - (not_before - base::Time::UnixEpoch()).InMilliseconds();
|
| + timestamp_not_before_ = not_before.ToJavaTime();
|
| timestamp_not_after_ =
|
| - ((now + base::TimeDelta::FromHours(kTimestampGraceIntervalHours)) -
|
| - base::Time::UnixEpoch()).InMillisecondsRoundedUp();
|
| + (now + base::TimeDelta::FromHours(kTimestampGraceIntervalHours))
|
| + .ToJavaTime();
|
| timestamp_option_ = timestamp_option;
|
| }
|
|
|
| @@ -153,9 +152,7 @@ void CloudPolicyValidatorBase::ValidateAgainstCurrentPolicy(
|
| std::string expected_dm_token;
|
| std::string expected_device_id;
|
| if (policy_data) {
|
| - last_policy_timestamp =
|
| - base::Time::UnixEpoch() +
|
| - base::TimeDelta::FromMilliseconds(policy_data->timestamp());
|
| + last_policy_timestamp = base::Time::FromJavaTime(policy_data->timestamp());
|
| expected_dm_token = policy_data->request_token();
|
| expected_device_id = policy_data->device_id();
|
| }
|
|
|