Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(722)

Side by Side Diff: net/cert/multi_threaded_cert_verifier.cc

Issue 1082123003: Rename USE_NSS to USE_NSS_CERTS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use-nss-certs
Patch Set: rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/cert/ev_root_ca_metadata_unittest.cc ('k') | net/cert/test_root_certs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/multi_threaded_cert_verifier.h" 5 #include "net/cert/multi_threaded_cert_verifier.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
14 #include "base/profiler/scoped_tracker.h" 14 #include "base/profiler/scoped_tracker.h"
15 #include "base/stl_util.h" 15 #include "base/stl_util.h"
16 #include "base/synchronization/lock.h" 16 #include "base/synchronization/lock.h"
17 #include "base/threading/worker_pool.h" 17 #include "base/threading/worker_pool.h"
18 #include "base/time/time.h" 18 #include "base/time/time.h"
19 #include "base/values.h" 19 #include "base/values.h"
20 #include "net/base/hash_value.h" 20 #include "net/base/hash_value.h"
21 #include "net/base/net_errors.h" 21 #include "net/base/net_errors.h"
22 #include "net/cert/cert_trust_anchor_provider.h" 22 #include "net/cert/cert_trust_anchor_provider.h"
23 #include "net/cert/cert_verify_proc.h" 23 #include "net/cert/cert_verify_proc.h"
24 #include "net/cert/crl_set.h" 24 #include "net/cert/crl_set.h"
25 #include "net/cert/x509_certificate.h" 25 #include "net/cert/x509_certificate.h"
26 #include "net/cert/x509_certificate_net_log_param.h" 26 #include "net/cert/x509_certificate_net_log_param.h"
27 #include "net/log/net_log.h" 27 #include "net/log/net_log.h"
28 28
29 #if defined(USE_NSS) || defined(OS_IOS) 29 #if defined(USE_NSS_CERTS) || defined(OS_IOS)
30 #include <private/pprthred.h> // PR_DetachThread 30 #include <private/pprthred.h> // PR_DetachThread
31 #endif 31 #endif
32 32
33 namespace net { 33 namespace net {
34 34
35 //////////////////////////////////////////////////////////////////////////// 35 ////////////////////////////////////////////////////////////////////////////
36 36
37 // Life of a request: 37 // Life of a request:
38 // 38 //
39 // MultiThreadedCertVerifier CertVerifierJob CertVerifierWorker Request 39 // MultiThreadedCertVerifier CertVerifierJob CertVerifierWorker Request
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 private: 257 private:
258 void Run() { 258 void Run() {
259 // Runs on a worker thread. 259 // Runs on a worker thread.
260 error_ = verify_proc_->Verify(cert_.get(), 260 error_ = verify_proc_->Verify(cert_.get(),
261 hostname_, 261 hostname_,
262 flags_, 262 flags_,
263 crl_set_.get(), 263 crl_set_.get(),
264 additional_trust_anchors_, 264 additional_trust_anchors_,
265 &verify_result_); 265 &verify_result_);
266 #if defined(USE_NSS) || defined(OS_IOS) 266 #if defined(USE_NSS_CERTS) || defined(OS_IOS)
267 // Detach the thread from NSPR. 267 // Detach the thread from NSPR.
268 // Calling NSS functions attaches the thread to NSPR, which stores 268 // Calling NSS functions attaches the thread to NSPR, which stores
269 // the NSPR thread ID in thread-specific data. 269 // the NSPR thread ID in thread-specific data.
270 // The threads in our thread pool terminate after we have called 270 // The threads in our thread pool terminate after we have called
271 // PR_Cleanup. Unless we detach them from NSPR, net_unittests gets 271 // PR_Cleanup. Unless we detach them from NSPR, net_unittests gets
272 // segfaults on shutdown when the threads' thread-specific data 272 // segfaults on shutdown when the threads' thread-specific data
273 // destructors run. 273 // destructors run.
274 PR_DetachThread(); 274 PR_DetachThread();
275 #endif 275 #endif
276 Finish(); 276 Finish();
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 615
616 void MultiThreadedCertVerifier::OnCACertChanged( 616 void MultiThreadedCertVerifier::OnCACertChanged(
617 const X509Certificate* cert) { 617 const X509Certificate* cert) {
618 DCHECK(CalledOnValidThread()); 618 DCHECK(CalledOnValidThread());
619 619
620 ClearCache(); 620 ClearCache();
621 } 621 }
622 622
623 } // namespace net 623 } // namespace net
624 624
OLDNEW
« no previous file with comments | « net/cert/ev_root_ca_metadata_unittest.cc ('k') | net/cert/test_root_certs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698