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 "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/location.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/thread_task_runner_handle.h" |
13 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 14 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
14 #include "crypto/signature_verifier.h" | 15 #include "crypto/signature_verifier.h" |
15 #include "google_apis/gaia/gaia_auth_util.h" | 16 #include "google_apis/gaia/gaia_auth_util.h" |
16 #include "policy/proto/device_management_backend.pb.h" | 17 #include "policy/proto/device_management_backend.pb.h" |
17 | 18 |
18 namespace em = enterprise_management; | 19 namespace em = enterprise_management; |
19 | 20 |
20 namespace policy { | 21 namespace policy { |
21 | 22 |
22 namespace { | 23 namespace { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 canonicalize_user_(false), | 179 canonicalize_user_(false), |
179 allow_key_rotation_(false), | 180 allow_key_rotation_(false), |
180 background_task_runner_(background_task_runner) {} | 181 background_task_runner_(background_task_runner) {} |
181 | 182 |
182 void CloudPolicyValidatorBase::PostValidationTask( | 183 void CloudPolicyValidatorBase::PostValidationTask( |
183 const base::Closure& completion_callback) { | 184 const base::Closure& completion_callback) { |
184 background_task_runner_->PostTask( | 185 background_task_runner_->PostTask( |
185 FROM_HERE, | 186 FROM_HERE, |
186 base::Bind(&CloudPolicyValidatorBase::PerformValidation, | 187 base::Bind(&CloudPolicyValidatorBase::PerformValidation, |
187 base::Passed(scoped_ptr<CloudPolicyValidatorBase>(this)), | 188 base::Passed(scoped_ptr<CloudPolicyValidatorBase>(this)), |
188 base::MessageLoop::current()->message_loop_proxy(), | 189 base::ThreadTaskRunnerHandle::Get(), completion_callback)); |
189 completion_callback)); | |
190 } | 190 } |
191 | 191 |
192 // static | 192 // static |
193 void CloudPolicyValidatorBase::PerformValidation( | 193 void CloudPolicyValidatorBase::PerformValidation( |
194 scoped_ptr<CloudPolicyValidatorBase> self, | 194 scoped_ptr<CloudPolicyValidatorBase> self, |
195 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 195 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
196 const base::Closure& completion_callback) { | 196 const base::Closure& completion_callback) { |
197 // Run the validation activities on this thread. | 197 // Run the validation activities on this thread. |
198 self->RunValidation(); | 198 self->RunValidation(); |
199 | 199 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 return verifier.VerifyFinal(); | 549 return verifier.VerifyFinal(); |
550 } | 550 } |
551 | 551 |
552 template class CloudPolicyValidator<em::CloudPolicySettings>; | 552 template class CloudPolicyValidator<em::CloudPolicySettings>; |
553 | 553 |
554 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 554 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
555 template class CloudPolicyValidator<em::ExternalPolicyData>; | 555 template class CloudPolicyValidator<em::ExternalPolicyData>; |
556 #endif | 556 #endif |
557 | 557 |
558 } // namespace policy | 558 } // namespace policy |
OLD | NEW |