OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #import "ios/web/net/crw_cert_verification_controller.h" | 5 #import "ios/web/net/crw_cert_verification_controller.h" |
6 | 6 |
7 #include "base/ios/block_types.h" | 7 #include "base/ios/block_types.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/mac/bind_objc_block.h" | 9 #include "base/mac/bind_objc_block.h" |
10 #include "base/mac/scoped_block.h" | 10 #include "base/mac/scoped_block.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 }; | 117 }; |
118 | 118 |
119 typedef scoped_refptr<BlockHolder<web::PolicyDecisionHandler>> | 119 typedef scoped_refptr<BlockHolder<web::PolicyDecisionHandler>> |
120 PolicyDecisionHandlerHolder; | 120 PolicyDecisionHandlerHolder; |
121 | 121 |
122 } // namespace | 122 } // namespace |
123 | 123 |
124 @interface CRWCertVerificationController () { | 124 @interface CRWCertVerificationController () { |
125 // Cert verification object which wraps |net::CertVerifier|. Must be created, | 125 // Cert verification object which wraps |net::CertVerifier|. Must be created, |
126 // used and destroyed on IO Thread. | 126 // used and destroyed on IO Thread. |
127 scoped_ptr<web::CertVerifierBlockAdapter> _certVerifier; | 127 std::unique_ptr<web::CertVerifierBlockAdapter> _certVerifier; |
128 | 128 |
129 // URLRequestContextGetter for obtaining net layer objects. | 129 // URLRequestContextGetter for obtaining net layer objects. |
130 net::URLRequestContextGetter* _contextGetter; | 130 net::URLRequestContextGetter* _contextGetter; |
131 | 131 |
132 // Used to remember user exceptions to invalid certs. | 132 // Used to remember user exceptions to invalid certs. |
133 scoped_refptr<web::CertificatePolicyCache> _certPolicyCache; | 133 scoped_refptr<web::CertificatePolicyCache> _certPolicyCache; |
134 } | 134 } |
135 | 135 |
136 // Cert verification flags. Must be used on IO Thread. | 136 // Cert verification flags. Must be used on IO Thread. |
137 @property(nonatomic, readonly) int certVerifyFlags; | 137 @property(nonatomic, readonly) int certVerifyFlags; |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 web::CertPolicy::Judgment judgment = _certPolicyCache->QueryPolicy( | 483 web::CertPolicy::Judgment judgment = _certPolicyCache->QueryPolicy( |
484 leafCert.get(), base::SysNSStringToUTF8(host), | 484 leafCert.get(), base::SysNSStringToUTF8(host), |
485 certVerifierResult.cert_status); | 485 certVerifierResult.cert_status); |
486 | 486 |
487 return (judgment == web::CertPolicy::ALLOWED) | 487 return (judgment == web::CertPolicy::ALLOWED) |
488 ? web::CERT_ACCEPT_POLICY_RECOVERABLE_ERROR_ACCEPTED_BY_USER | 488 ? web::CERT_ACCEPT_POLICY_RECOVERABLE_ERROR_ACCEPTED_BY_USER |
489 : web::CERT_ACCEPT_POLICY_RECOVERABLE_ERROR_UNDECIDED_BY_USER; | 489 : web::CERT_ACCEPT_POLICY_RECOVERABLE_ERROR_UNDECIDED_BY_USER; |
490 } | 490 } |
491 | 491 |
492 @end | 492 @end |
OLD | NEW |