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. |
Nico
2016/04/04 17:53:45
why is this a .mm file now?
| |
4 | 4 |
5 #include "ios/web/net/cert_verifier_block_adapter.h" | 5 #include "ios/web/net/cert_verifier_block_adapter.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/mac/bind_objc_block.h" | 9 #include "base/mac/bind_objc_block.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
11 #include "net/cert/crl_set.h" | 11 #include "net/cert/crl_set.h" |
12 #include "net/cert/x509_certificate.h" | 12 #include "net/cert/x509_certificate.h" |
13 #include "net/log/net_log.h" | 13 #include "net/log/net_log.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 | 59 |
60 CertVerifierBlockAdapter::~CertVerifierBlockAdapter() { | 60 CertVerifierBlockAdapter::~CertVerifierBlockAdapter() { |
61 DCHECK(thread_checker_.CalledOnValidThread()); | 61 DCHECK(thread_checker_.CalledOnValidThread()); |
62 } | 62 } |
63 | 63 |
64 CertVerifierBlockAdapter::Params::Params( | 64 CertVerifierBlockAdapter::Params::Params( |
65 const scoped_refptr<net::X509Certificate>& cert, | 65 const scoped_refptr<net::X509Certificate>& cert, |
66 const std::string& hostname) | 66 const std::string& hostname) |
67 : cert(cert), hostname(hostname), flags(0) {} | 67 : cert(cert), hostname(hostname), flags(0) {} |
68 | 68 |
69 CertVerifierBlockAdapter::Params::~Params() { | 69 CertVerifierBlockAdapter::Params::~Params() {} |
70 } | |
71 | 70 |
72 void CertVerifierBlockAdapter::Verify( | 71 void CertVerifierBlockAdapter::Verify( |
73 const Params& params, | 72 const Params& params, |
74 void (^completion_handler)(net::CertVerifyResult, int)) { | 73 void (^completion_handler)(net::CertVerifyResult, int)) { |
75 DCHECK(thread_checker_.CalledOnValidThread()); | 74 DCHECK(thread_checker_.CalledOnValidThread()); |
76 DCHECK(completion_handler); | 75 DCHECK(completion_handler); |
77 if (!params.cert || params.hostname.empty()) { | 76 if (!params.cert || params.hostname.empty()) { |
78 completion_handler(net::CertVerifyResult(), net::ERR_INVALID_ARGUMENT); | 77 completion_handler(net::CertVerifyResult(), net::ERR_INVALID_ARGUMENT); |
79 return; | 78 return; |
80 } | 79 } |
(...skipping 19 matching lines...) Expand all Loading... | |
100 // Completion handler will be called from |callback| when verification | 99 // Completion handler will be called from |callback| when verification |
101 // request is completed. | 100 // request is completed. |
102 return; | 101 return; |
103 } | 102 } |
104 | 103 |
105 // Verification has either failed or result was retrieved from the cache. | 104 // Verification has either failed or result was retrieved from the cache. |
106 completion_handler(context->result, error); | 105 completion_handler(context->result, error); |
107 } | 106 } |
108 | 107 |
109 } // namespace web | 108 } // namespace web |
OLD | NEW |