OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/policy/core/common/cloud/cloud_policy_validator.h" | 5 #include "components/policy/core/common/cloud/cloud_policy_validator.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> |
8 | 9 |
9 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
10 #include "base/location.h" | 11 #include "base/location.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/metrics/histogram_macros.h" | 13 #include "base/metrics/histogram_macros.h" |
13 #include "base/sequenced_task_runner.h" | 14 #include "base/sequenced_task_runner.h" |
14 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
15 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
16 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
17 #include "build/build_config.h" | 18 #include "build/build_config.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 ValidateTimestamp(last_policy_timestamp, base::Time::NowFromSystemTime(), | 165 ValidateTimestamp(last_policy_timestamp, base::Time::NowFromSystemTime(), |
165 timestamp_option); | 166 timestamp_option); |
166 ValidateDMToken(expected_dm_token, dm_token_option); | 167 ValidateDMToken(expected_dm_token, dm_token_option); |
167 } | 168 } |
168 | 169 |
169 CloudPolicyValidatorBase::CloudPolicyValidatorBase( | 170 CloudPolicyValidatorBase::CloudPolicyValidatorBase( |
170 scoped_ptr<em::PolicyFetchResponse> policy_response, | 171 scoped_ptr<em::PolicyFetchResponse> policy_response, |
171 google::protobuf::MessageLite* payload, | 172 google::protobuf::MessageLite* payload, |
172 scoped_refptr<base::SequencedTaskRunner> background_task_runner) | 173 scoped_refptr<base::SequencedTaskRunner> background_task_runner) |
173 : status_(VALIDATION_OK), | 174 : status_(VALIDATION_OK), |
174 policy_(policy_response.Pass()), | 175 policy_(std::move(policy_response)), |
175 payload_(payload), | 176 payload_(payload), |
176 validation_flags_(0), | 177 validation_flags_(0), |
177 timestamp_not_before_(0), | 178 timestamp_not_before_(0), |
178 timestamp_not_after_(0), | 179 timestamp_not_after_(0), |
179 timestamp_option_(TIMESTAMP_REQUIRED), | 180 timestamp_option_(TIMESTAMP_REQUIRED), |
180 dm_token_option_(DM_TOKEN_REQUIRED), | 181 dm_token_option_(DM_TOKEN_REQUIRED), |
181 canonicalize_user_(false), | 182 canonicalize_user_(false), |
182 allow_key_rotation_(false), | 183 allow_key_rotation_(false), |
183 background_task_runner_(background_task_runner) {} | 184 background_task_runner_(background_task_runner) {} |
184 | 185 |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 return verifier.VerifyFinal(); | 551 return verifier.VerifyFinal(); |
551 } | 552 } |
552 | 553 |
553 template class CloudPolicyValidator<em::CloudPolicySettings>; | 554 template class CloudPolicyValidator<em::CloudPolicySettings>; |
554 | 555 |
555 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 556 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
556 template class CloudPolicyValidator<em::ExternalPolicyData>; | 557 template class CloudPolicyValidator<em::ExternalPolicyData>; |
557 #endif | 558 #endif |
558 | 559 |
559 } // namespace policy | 560 } // namespace policy |
OLD | NEW |