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

Side by Side Diff: components/policy/core/common/cloud/cloud_policy_validator.cc

Issue 794683005: replace COMPILE_ASSERT with static_assert in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting fixup Created 6 years 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 unified diff | Download patch
OLDNEW
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/message_loop/message_loop.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"
(...skipping 18 matching lines...) Expand all
29 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00 29 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00
30 }; 30 };
31 31
32 // DER-encoded ASN.1 object identifier for the SHA256-RSA signature algorithm 32 // DER-encoded ASN.1 object identifier for the SHA256-RSA signature algorithm
33 // (source: http://tools.ietf.org/html/rfc5754 section 3.2). 33 // (source: http://tools.ietf.org/html/rfc5754 section 3.2).
34 const uint8 kSHA256SignatureAlgorithm[] = { 34 const uint8 kSHA256SignatureAlgorithm[] = {
35 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 35 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
36 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00 36 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00
37 }; 37 };
38 38
39 COMPILE_ASSERT(sizeof(kSHA256SignatureAlgorithm) == 39 static_assert(sizeof(kSHA256SignatureAlgorithm) ==
40 sizeof(kSHA1SignatureAlgorithm), invalid_algorithm_size); 40 sizeof(kSHA1SignatureAlgorithm),
41 "kSHA256SignatureAlgorithm must be the same size as "
42 "kSHA1SignatureAlgorithm");
41 43
42 const int kSignatureAlgorithmSize = sizeof(kSHA1SignatureAlgorithm); 44 const int kSignatureAlgorithmSize = sizeof(kSHA1SignatureAlgorithm);
43 45
44 const char kMetricPolicyKeyVerification[] = "Enterprise.PolicyKeyVerification"; 46 const char kMetricPolicyKeyVerification[] = "Enterprise.PolicyKeyVerification";
45 47
46 enum MetricPolicyKeyVerification { 48 enum MetricPolicyKeyVerification {
47 // UMA metric recorded when the client has no verification key. 49 // UMA metric recorded when the client has no verification key.
48 METRIC_POLICY_KEY_VERIFICATION_KEY_MISSING, 50 METRIC_POLICY_KEY_VERIFICATION_KEY_MISSING,
49 // Recorded when the policy being verified has no key signature (e.g. policy 51 // Recorded when the policy being verified has no key signature (e.g. policy
50 // fetched before the server supported the verification key). 52 // fetched before the server supported the verification key).
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 return verifier.VerifyFinal(); 549 return verifier.VerifyFinal();
548 } 550 }
549 551
550 template class CloudPolicyValidator<em::CloudPolicySettings>; 552 template class CloudPolicyValidator<em::CloudPolicySettings>;
551 553
552 #if !defined(OS_ANDROID) && !defined(OS_IOS) 554 #if !defined(OS_ANDROID) && !defined(OS_IOS)
553 template class CloudPolicyValidator<em::ExternalPolicyData>; 555 template class CloudPolicyValidator<em::ExternalPolicyData>;
554 #endif 556 #endif
555 557
556 } // namespace policy 558 } // namespace policy
OLDNEW
« no previous file with comments | « components/omnibox/autocomplete_match_type.cc ('k') | components/proximity_auth/wire_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698