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 #ifndef NET_OCSP_NSS_OCSP_H_ | 5 #ifndef NET_OCSP_NSS_OCSP_H_ |
6 #define NET_OCSP_NSS_OCSP_H_ | 6 #define NET_OCSP_NSS_OCSP_H_ |
7 | 7 |
8 #include "net/base/net_export.h" | 8 #include "net/base/net_export.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
11 | 11 |
12 class URLRequestContext; | 12 class URLRequestContext; |
13 | 13 |
14 // Sets the MessageLoop for NSS's HTTP client functions (i.e. OCSP, CA | 14 // Sets the MessageLoop for NSS's HTTP client functions (i.e. OCSP, CA |
15 // certificate and CRL fetches) to the current message loop. This should be | 15 // certificate and CRL fetches) to the current message loop. This should be |
16 // called before EnsureNSSHttpIOInit() if you want to control the message loop. | 16 // called before EnsureNSSHttpIOInit() if you want to control the message loop. |
17 NET_EXPORT void SetMessageLoopForNSSHttpIO(); | 17 NET_EXPORT void SetMessageLoopForNSSHttpIO(); |
18 | 18 |
19 // Initializes HTTP client functions for NSS. This must be called before any | 19 // Initializes HTTP client functions for NSS. This must be called before any |
20 // certificate verification functions. This function is thread-safe, and HTTP | 20 // certificate verification functions. This function is thread-safe, and HTTP |
21 // handlers will only ever be initialized once. ShutdownNSSHttpIO() must be | 21 // handlers will only ever be initialized once. ShutdownNSSHttpIO() must be |
22 // called on shutdown. | 22 // called on shutdown. |
23 NET_EXPORT void EnsureNSSHttpIOInit(); | 23 NET_EXPORT void EnsureNSSHttpIOInit(); |
24 | 24 |
25 // This should be called once on shutdown to stop issuing URLRequests for NSS | 25 // This should be called once on shutdown to stop issuing URLRequests for NSS |
26 // related HTTP fetches. | 26 // related HTTP fetches. |
27 NET_EXPORT void ShutdownNSSHttpIO(); | 27 NET_EXPORT void ShutdownNSSHttpIO(); |
28 | 28 |
| 29 // Can be called after a call to |ShutdownNSSHttpIO()| to reset internal state |
| 30 // and associate it with the current thread. |
| 31 NET_EXPORT void ResetNSSHttpIOForTesting(); |
| 32 |
29 // Sets the URLRequestContext for HTTP requests issued by NSS. | 33 // Sets the URLRequestContext for HTTP requests issued by NSS. |
30 NET_EXPORT void SetURLRequestContextForNSSHttpIO( | 34 NET_EXPORT void SetURLRequestContextForNSSHttpIO( |
31 URLRequestContext* request_context); | 35 URLRequestContext* request_context); |
32 | 36 |
33 } // namespace net | 37 } // namespace net |
34 | 38 |
35 #endif // NET_OCSP_NSS_OCSP_H_ | 39 #endif // NET_OCSP_NSS_OCSP_H_ |
OLD | NEW |