| 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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 if (io_loop_) | 536 if (io_loop_) |
| 537 io_loop_->task_runner()->PostTask(from_here, task); | 537 io_loop_->task_runner()->PostTask(from_here, task); |
| 538 } | 538 } |
| 539 | 539 |
| 540 void OCSPIOLoop::EnsureIOLoop() { | 540 void OCSPIOLoop::EnsureIOLoop() { |
| 541 base::AutoLock autolock(lock_); | 541 base::AutoLock autolock(lock_); |
| 542 DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_); | 542 DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_); |
| 543 } | 543 } |
| 544 | 544 |
| 545 void OCSPIOLoop::AddRequest(OCSPRequestSession* request) { | 545 void OCSPIOLoop::AddRequest(OCSPRequestSession* request) { |
| 546 DCHECK(!ContainsKey(requests_, request)); | 546 DCHECK(!base::ContainsKey(requests_, request)); |
| 547 requests_.insert(request); | 547 requests_.insert(request); |
| 548 } | 548 } |
| 549 | 549 |
| 550 void OCSPIOLoop::RemoveRequest(OCSPRequestSession* request) { | 550 void OCSPIOLoop::RemoveRequest(OCSPRequestSession* request) { |
| 551 DCHECK(ContainsKey(requests_, request)); | 551 DCHECK(base::ContainsKey(requests_, request)); |
| 552 requests_.erase(request); | 552 requests_.erase(request); |
| 553 } | 553 } |
| 554 | 554 |
| 555 void OCSPIOLoop::CancelAllRequests() { | 555 void OCSPIOLoop::CancelAllRequests() { |
| 556 // CancelURLRequest() always removes the request from the requests_ | 556 // CancelURLRequest() always removes the request from the requests_ |
| 557 // set synchronously. | 557 // set synchronously. |
| 558 while (!requests_.empty()) | 558 while (!requests_.empty()) |
| 559 (*requests_.begin())->CancelURLRequest(); | 559 (*requests_.begin())->CancelURLRequest(); |
| 560 } | 560 } |
| 561 | 561 |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 void SetURLRequestContextForNSSHttpIO(URLRequestContext* request_context) { | 964 void SetURLRequestContextForNSSHttpIO(URLRequestContext* request_context) { |
| 965 pthread_mutex_lock(&g_request_context_lock); | 965 pthread_mutex_lock(&g_request_context_lock); |
| 966 if (request_context) { | 966 if (request_context) { |
| 967 DCHECK(!g_request_context); | 967 DCHECK(!g_request_context); |
| 968 } | 968 } |
| 969 g_request_context = request_context; | 969 g_request_context = request_context; |
| 970 pthread_mutex_unlock(&g_request_context_lock); | 970 pthread_mutex_unlock(&g_request_context_lock); |
| 971 } | 971 } |
| 972 | 972 |
| 973 } // namespace net | 973 } // namespace net |
| OLD | NEW |