| 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 "net/cert_net/nss_ocsp.h" | 5 #include "net/cert_net/nss_ocsp.h" |
| 6 | 6 |
| 7 #include <certt.h> | 7 #include <certt.h> |
| 8 #include <certdb.h> | 8 #include <certdb.h> |
| 9 #include <nspr.h> | 9 #include <nspr.h> |
| 10 #include <nss.h> | 10 #include <nss.h> |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // CalledOnValidThread is the only available API to reassociate | 99 // CalledOnValidThread is the only available API to reassociate |
| 100 // thread_checker_ with the current thread. Result ignored intentionally. | 100 // thread_checker_ with the current thread. Result ignored intentionally. |
| 101 ignore_result(thread_checker_.CalledOnValidThread()); | 101 ignore_result(thread_checker_.CalledOnValidThread()); |
| 102 shutdown_ = false; | 102 shutdown_ = false; |
| 103 used_ = false; | 103 used_ = false; |
| 104 } | 104 } |
| 105 StartUsing(); | 105 StartUsing(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 friend struct base::DefaultLazyInstanceTraits<OCSPIOLoop>; | 109 friend struct base::LazyInstanceTraitsBase<OCSPIOLoop>; |
| 110 | 110 |
| 111 OCSPIOLoop(); | 111 OCSPIOLoop(); |
| 112 | 112 |
| 113 void CancelAllRequests(); | 113 void CancelAllRequests(); |
| 114 | 114 |
| 115 mutable base::Lock lock_; | 115 mutable base::Lock lock_; |
| 116 bool shutdown_; // Protected by |lock_|. | 116 bool shutdown_; // Protected by |lock_|. |
| 117 std::set<OCSPRequestSession*> requests_; // Protected by |lock_|. | 117 std::set<OCSPRequestSession*> requests_; // Protected by |lock_|. |
| 118 bool used_; // Protected by |lock_|. | 118 bool used_; // Protected by |lock_|. |
| 119 // This should not be modified after |used_|. | 119 // This should not be modified after |used_|. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 const char** http_response_content_type, | 157 const char** http_response_content_type, |
| 158 const char** http_response_headers, | 158 const char** http_response_headers, |
| 159 const char** http_response_data, | 159 const char** http_response_data, |
| 160 PRUint32* http_response_data_len); | 160 PRUint32* http_response_data_len); |
| 161 SECStatus OCSPFree(SEC_HTTP_REQUEST_SESSION request); | 161 SECStatus OCSPFree(SEC_HTTP_REQUEST_SESSION request); |
| 162 | 162 |
| 163 char* GetAlternateOCSPAIAInfo(CERTCertificate *cert); | 163 char* GetAlternateOCSPAIAInfo(CERTCertificate *cert); |
| 164 | 164 |
| 165 class OCSPNSSInitialization { | 165 class OCSPNSSInitialization { |
| 166 private: | 166 private: |
| 167 friend struct base::DefaultLazyInstanceTraits<OCSPNSSInitialization>; | 167 friend struct base::LazyInstanceTraitsBase<OCSPNSSInitialization>; |
| 168 | 168 |
| 169 OCSPNSSInitialization(); | 169 OCSPNSSInitialization(); |
| 170 // This class is only instantiated as a leaky LazyInstance, so its destructor | 170 // This class is only instantiated as a leaky LazyInstance, so its destructor |
| 171 // is never called. | 171 // is never called. |
| 172 ~OCSPNSSInitialization() = delete; | 172 ~OCSPNSSInitialization() = delete; |
| 173 | 173 |
| 174 SEC_HttpClientFcn client_fcn_; | 174 SEC_HttpClientFcn client_fcn_; |
| 175 | 175 |
| 176 DISALLOW_COPY_AND_ASSIGN(OCSPNSSInitialization); | 176 DISALLOW_COPY_AND_ASSIGN(OCSPNSSInitialization); |
| 177 }; | 177 }; |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 void SetURLRequestContextForNSSHttpIO(URLRequestContext* request_context) { | 944 void SetURLRequestContextForNSSHttpIO(URLRequestContext* request_context) { |
| 945 pthread_mutex_lock(&g_request_context_lock); | 945 pthread_mutex_lock(&g_request_context_lock); |
| 946 if (request_context) { | 946 if (request_context) { |
| 947 DCHECK(!g_request_context); | 947 DCHECK(!g_request_context); |
| 948 } | 948 } |
| 949 g_request_context = request_context; | 949 g_request_context = request_context; |
| 950 pthread_mutex_unlock(&g_request_context_lock); | 950 pthread_mutex_unlock(&g_request_context_lock); |
| 951 } | 951 } |
| 952 | 952 |
| 953 } // namespace net | 953 } // namespace net |
| OLD | NEW |