OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=455424 | 7 // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=455424 |
8 // until NSS 3.12.2 comes out and we update to it. | 8 // until NSS 3.12.2 comes out and we update to it. |
9 #define Lock FOO_NSS_Lock | 9 #define Lock FOO_NSS_Lock |
10 #include <certt.h> | 10 #include <certt.h> |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 AutoLock autolock(lock_); | 214 AutoLock autolock(lock_); |
215 finished_ = true; | 215 finished_ = true; |
216 } | 216 } |
217 cv_.Signal(); | 217 cv_.Signal(); |
218 delete request_; | 218 delete request_; |
219 request_ = NULL; | 219 request_ = NULL; |
220 } | 220 } |
221 } | 221 } |
222 | 222 |
223 private: | 223 private: |
| 224 friend class base::RefCountedThreadSafe<OCSPRequestSession>; |
| 225 |
| 226 virtual ~OCSPRequestSession() { |
| 227 DCHECK(!request_); |
| 228 } |
| 229 |
224 void StartURLRequest() { | 230 void StartURLRequest() { |
225 DCHECK(MessageLoopForIO::current() == io_loop_); | 231 DCHECK(MessageLoopForIO::current() == io_loop_); |
226 DCHECK(!request_); | 232 DCHECK(!request_); |
227 | 233 |
228 request_ = new URLRequest(url_, this); | 234 request_ = new URLRequest(url_, this); |
229 request_->set_context( | 235 request_->set_context( |
230 Singleton<OCSPInitSingleton>::get()->url_request_context()); | 236 Singleton<OCSPInitSingleton>::get()->url_request_context()); |
231 // To meet the privacy requirements of off-the-record mode. | 237 // To meet the privacy requirements of off-the-record mode. |
232 request_->set_load_flags( | 238 request_->set_load_flags( |
233 net::LOAD_DISABLE_CACHE|net::LOAD_DO_NOT_SAVE_COOKIES); | 239 net::LOAD_DISABLE_CACHE|net::LOAD_DO_NOT_SAVE_COOKIES); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 void EnsureOCSPInit() { | 519 void EnsureOCSPInit() { |
514 Singleton<OCSPInitSingleton>::get(); | 520 Singleton<OCSPInitSingleton>::get(); |
515 } | 521 } |
516 | 522 |
517 // This function would be called before NSS initialization. | 523 // This function would be called before NSS initialization. |
518 void SetURLRequestContextForOCSP(URLRequestContext* request_context) { | 524 void SetURLRequestContextForOCSP(URLRequestContext* request_context) { |
519 OCSPInitSingleton::set_url_request_context(request_context); | 525 OCSPInitSingleton::set_url_request_context(request_context); |
520 } | 526 } |
521 | 527 |
522 } // namespace net | 528 } // namespace net |
OLD | NEW |