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

Side by Side Diff: net/base/cert_verifier.cc

Issue 556068: BSD port: USE_NSS and other macros instead of OS_LINUX where applicable (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/base/ev_root_ca_metadata.h » ('j') | net/socket/client_socket.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 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/base/cert_verifier.h" 5 #include "net/base/cert_verifier.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(USE_NSS)
8 #include <private/pprthred.h> // PR_DetatchThread 8 #include <private/pprthred.h> // PR_DetatchThread
9 #endif 9 #endif
10 10
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/worker_pool.h" 12 #include "base/worker_pool.h"
13 #include "net/base/cert_verify_result.h" 13 #include "net/base/cert_verify_result.h"
14 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
15 #include "net/base/x509_certificate.h" 15 #include "net/base/x509_certificate.h"
16 16
17 namespace net { 17 namespace net {
(...skipping 13 matching lines...) Expand all
31 verifier_(verifier), 31 verifier_(verifier),
32 verify_result_(verify_result), 32 verify_result_(verify_result),
33 callback_(callback), 33 callback_(callback),
34 origin_loop_(MessageLoop::current()), 34 origin_loop_(MessageLoop::current()),
35 error_(OK) { 35 error_(OK) {
36 } 36 }
37 37
38 void DoVerify() { 38 void DoVerify() {
39 // Running on the worker thread 39 // Running on the worker thread
40 error_ = cert_->Verify(hostname_, flags_, &result_); 40 error_ = cert_->Verify(hostname_, flags_, &result_);
41 #if defined(OS_LINUX) 41 #if defined(USE_NSS)
42 // Detach the thread from NSPR. 42 // Detach the thread from NSPR.
43 // Calling NSS functions attaches the thread to NSPR, which stores 43 // Calling NSS functions attaches the thread to NSPR, which stores
44 // the NSPR thread ID in thread-specific data. 44 // the NSPR thread ID in thread-specific data.
45 // The threads in our thread pool terminate after we have called 45 // The threads in our thread pool terminate after we have called
46 // PR_Cleanup. Unless we detach them from NSPR, net_unittests gets 46 // PR_Cleanup. Unless we detach them from NSPR, net_unittests gets
47 // segfaults on shutdown when the threads' thread-specific data 47 // segfaults on shutdown when the threads' thread-specific data
48 // destructors run. 48 // destructors run.
49 PR_DetachThread(); 49 PR_DetachThread();
50 #endif 50 #endif
51 51
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 NewRunnableMethod(request_.get(), &Request::DoVerify), true)) { 146 NewRunnableMethod(request_.get(), &Request::DoVerify), true)) {
147 NOTREACHED(); 147 NOTREACHED();
148 request_ = NULL; 148 request_ = NULL;
149 return ERR_FAILED; 149 return ERR_FAILED;
150 } 150 }
151 151
152 return ERR_IO_PENDING; 152 return ERR_IO_PENDING;
153 } 153 }
154 154
155 } // namespace net 155 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/base/ev_root_ca_metadata.h » ('j') | net/socket/client_socket.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698