| 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 #ifndef IOS_WEB_NET_CERT_VERIFIER_BLOCK_ADAPTER_H_ | 5 #ifndef IOS_WEB_NET_CERT_VERIFIER_BLOCK_ADAPTER_H_ |
| 6 #define IOS_WEB_NET_CERT_VERIFIER_BLOCK_ADAPTER_H_ | 6 #define IOS_WEB_NET_CERT_VERIFIER_BLOCK_ADAPTER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // Type of verification completion block. If cert is successfully validated | 65 // Type of verification completion block. If cert is successfully validated |
| 66 // |error| is OK, otherwise |error| is a net error code. | 66 // |error| is OK, otherwise |error| is a net error code. |
| 67 typedef void (^CompletionHandler)(net::CertVerifyResult result, int error); | 67 typedef void (^CompletionHandler)(net::CertVerifyResult result, int error); |
| 68 | 68 |
| 69 // Verifies certificate with given |params|. |completion_handler| must not be | 69 // Verifies certificate with given |params|. |completion_handler| must not be |
| 70 // null and can be called either synchronously (in the same runloop) or | 70 // null and can be called either synchronously (in the same runloop) or |
| 71 // asynchronously. | 71 // asynchronously. |
| 72 void Verify(const Params& params, CompletionHandler completion_handler); | 72 void Verify(const Params& params, CompletionHandler completion_handler); |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 // Pending verification requests. Request must be alive until verification is | |
| 76 // completed, otherwise verification operation will be cancelled. | |
| 77 ScopedVector<net::CertVerifier::Request> pending_requests_; | |
| 78 // Underlying unowned CertVerifier. | 75 // Underlying unowned CertVerifier. |
| 79 net::CertVerifier* cert_verifier_; | 76 net::CertVerifier* cert_verifier_; |
| 80 // Unowned NetLog required by CertVerifier. | 77 // Unowned NetLog required by CertVerifier. |
| 81 net::NetLog* net_log_; | 78 net::NetLog* net_log_; |
| 82 // CertVerifierBlockAdapter should be used on the same thread where it was | 79 // CertVerifierBlockAdapter should be used on the same thread where it was |
| 83 // created. | 80 // created. |
| 84 base::ThreadChecker thread_checker_; | 81 base::ThreadChecker thread_checker_; |
| 85 }; | 82 }; |
| 86 | 83 |
| 87 } // namespace web | 84 } // namespace web |
| 88 | 85 |
| 89 #endif // IOS_WEB_NET_CERT_VERIFIER_BLOCK_ADAPTER_H_ | 86 #endif // IOS_WEB_NET_CERT_VERIFIER_BLOCK_ADAPTER_H_ |
| OLD | NEW |