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/ocsp/nss_ocsp.h" | 5 #include "net/ocsp/nss_ocsp.h" |
6 | 6 |
7 #include <certt.h> | 7 #include <certt.h> |
8 #include <certdb.h> | 8 #include <certdb.h> |
9 #include <ocsp.h> | 9 #include <ocsp.h> |
10 #include <nspr.h> | 10 #include <nspr.h> |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 bool shutdown_; // Protected by |lock_|. | 80 bool shutdown_; // Protected by |lock_|. |
81 std::set<OCSPRequestSession*> requests_; // Protected by |lock_|. | 81 std::set<OCSPRequestSession*> requests_; // Protected by |lock_|. |
82 bool used_; // Protected by |lock_|. | 82 bool used_; // Protected by |lock_|. |
83 // This should not be modified after |used_|. | 83 // This should not be modified after |used_|. |
84 MessageLoopForIO* io_loop_; // Protected by |lock_|. | 84 MessageLoopForIO* io_loop_; // Protected by |lock_|. |
85 base::ThreadChecker thread_checker_; | 85 base::ThreadChecker thread_checker_; |
86 | 86 |
87 DISALLOW_COPY_AND_ASSIGN(OCSPIOLoop); | 87 DISALLOW_COPY_AND_ASSIGN(OCSPIOLoop); |
88 }; | 88 }; |
89 | 89 |
90 base::LazyInstance<OCSPIOLoop, base::LeakyLazyInstanceTraits<OCSPIOLoop> > | 90 base::LazyInstance<OCSPIOLoop>::Leaky |
91 g_ocsp_io_loop = LAZY_INSTANCE_INITIALIZER; | 91 g_ocsp_io_loop = LAZY_INSTANCE_INITIALIZER; |
92 | 92 |
93 const int kRecvBufferSize = 4096; | 93 const int kRecvBufferSize = 4096; |
94 | 94 |
95 // All OCSP handlers should be called in the context of | 95 // All OCSP handlers should be called in the context of |
96 // CertVerifier's thread (i.e. worker pool, not on the I/O thread). | 96 // CertVerifier's thread (i.e. worker pool, not on the I/O thread). |
97 // It supports blocking mode only. | 97 // It supports blocking mode only. |
98 | 98 |
99 SECStatus OCSPCreateSession(const char* host, PRUint16 portnum, | 99 SECStatus OCSPCreateSession(const char* host, PRUint16 portnum, |
100 SEC_HTTP_SERVER_SESSION* pSession); | 100 SEC_HTTP_SERVER_SESSION* pSession); |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 void SetURLRequestContextForOCSP(URLRequestContext* request_context) { | 938 void SetURLRequestContextForOCSP(URLRequestContext* request_context) { |
939 pthread_mutex_lock(&g_request_context_lock); | 939 pthread_mutex_lock(&g_request_context_lock); |
940 if (request_context) { | 940 if (request_context) { |
941 DCHECK(!g_request_context); | 941 DCHECK(!g_request_context); |
942 } | 942 } |
943 g_request_context = request_context; | 943 g_request_context = request_context; |
944 pthread_mutex_unlock(&g_request_context_lock); | 944 pthread_mutex_unlock(&g_request_context_lock); |
945 } | 945 } |
946 | 946 |
947 } // namespace net | 947 } // namespace net |
OLD | NEW |