Chromium Code Reviews| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 void AddRequest(OCSPRequestSession* request); | 81 void AddRequest(OCSPRequestSession* request); |
| 82 void RemoveRequest(OCSPRequestSession* request); | 82 void RemoveRequest(OCSPRequestSession* request); |
| 83 | 83 |
| 84 // Clears internal state and calls |StartUsing()|. Should be called only in | 84 // Clears internal state and calls |StartUsing()|. Should be called only in |
| 85 // the context of testing. | 85 // the context of testing. |
| 86 void ReuseForTesting() { | 86 void ReuseForTesting() { |
| 87 { | 87 { |
| 88 base::AutoLock autolock(lock_); | 88 base::AutoLock autolock(lock_); |
| 89 DCHECK(base::MessageLoopForIO::current()); | 89 DCHECK(base::MessageLoopForIO::current()); |
| 90 thread_checker_.DetachFromThread(); | 90 thread_checker_.DetachFromThread(); |
| 91 thread_checker_.CalledOnValidThread(); | 91 |
| 92 // CalledOnValidThread is the only available api to reassociate | |
|
blundell
2013/11/05 16:35:06
API
Nico
2013/11/05 16:37:28
Done.
| |
| 93 // thread_checker_ with the current thread. Result ignored intentionally. | |
| 94 ignore_result(thread_checker_.CalledOnValidThread()); | |
| 92 shutdown_ = false; | 95 shutdown_ = false; |
| 93 used_ = false; | 96 used_ = false; |
| 94 } | 97 } |
| 95 StartUsing(); | 98 StartUsing(); |
| 96 } | 99 } |
| 97 | 100 |
| 98 private: | 101 private: |
| 99 friend struct base::DefaultLazyInstanceTraits<OCSPIOLoop>; | 102 friend struct base::DefaultLazyInstanceTraits<OCSPIOLoop>; |
| 100 | 103 |
| 101 OCSPIOLoop(); | 104 OCSPIOLoop(); |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 967 void SetURLRequestContextForNSSHttpIO(URLRequestContext* request_context) { | 970 void SetURLRequestContextForNSSHttpIO(URLRequestContext* request_context) { |
| 968 pthread_mutex_lock(&g_request_context_lock); | 971 pthread_mutex_lock(&g_request_context_lock); |
| 969 if (request_context) { | 972 if (request_context) { |
| 970 DCHECK(!g_request_context); | 973 DCHECK(!g_request_context); |
| 971 } | 974 } |
| 972 g_request_context = request_context; | 975 g_request_context = request_context; |
| 973 pthread_mutex_unlock(&g_request_context_lock); | 976 pthread_mutex_unlock(&g_request_context_lock); |
| 974 } | 977 } |
| 975 | 978 |
| 976 } // namespace net | 979 } // namespace net |
| OLD | NEW |