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

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

Issue 6969077: net: Add NET_API to net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef NET_BASE_CERT_VERIFIER_H_ 5 #ifndef NET_BASE_CERT_VERIFIER_H_
6 #define NET_BASE_CERT_VERIFIER_H_ 6 #define NET_BASE_CERT_VERIFIER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/threading/non_thread_safe.h" 14 #include "base/threading/non_thread_safe.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "net/base/cert_database.h" 16 #include "net/base/cert_database.h"
17 #include "net/base/cert_verify_result.h" 17 #include "net/base/cert_verify_result.h"
18 #include "net/base/completion_callback.h" 18 #include "net/base/completion_callback.h"
19 #include "net/base/net_api.h"
19 #include "net/base/x509_cert_types.h" 20 #include "net/base/x509_cert_types.h"
20 21
21 namespace net { 22 namespace net {
22 23
23 class CertVerifierJob; 24 class CertVerifierJob;
24 class CertVerifierWorker; 25 class CertVerifierWorker;
25 class X509Certificate; 26 class X509Certificate;
26 27
27 // CachedCertVerifyResult contains the result of a certificate verification. 28 // CachedCertVerifyResult contains the result of a certificate verification.
28 struct CachedCertVerifyResult { 29 struct CachedCertVerifyResult {
(...skipping 11 matching lines...) Expand all
40 }; 41 };
41 42
42 // CertVerifier represents a service for verifying certificates. 43 // CertVerifier represents a service for verifying certificates.
43 // 44 //
44 // CertVerifier can handle multiple requests at a time, so when canceling a 45 // CertVerifier can handle multiple requests at a time, so when canceling a
45 // request the RequestHandle that was returned by Verify() needs to be 46 // request the RequestHandle that was returned by Verify() needs to be
46 // given. A simpler alternative for consumers that only have 1 outstanding 47 // given. A simpler alternative for consumers that only have 1 outstanding
47 // request at a time is to create a SingleRequestCertVerifier wrapper around 48 // request at a time is to create a SingleRequestCertVerifier wrapper around
48 // CertVerifier (which will automatically cancel the single request when it 49 // CertVerifier (which will automatically cancel the single request when it
49 // goes out of scope). 50 // goes out of scope).
50 class CertVerifier : public base::NonThreadSafe, 51 MSVC_PUSH_DISABLE_WARNING(4275)
51 public CertDatabase::Observer { 52 class NET_API CertVerifier : public base::NonThreadSafe,
53 public CertDatabase::Observer {
54 MSVC_POP_WARNING()
52 public: 55 public:
53 // Opaque type used to cancel a request. 56 // Opaque type used to cancel a request.
54 typedef void* RequestHandle; 57 typedef void* RequestHandle;
55 58
56 // CertVerifier must not call base::Time::Now() directly. It must call 59 // CertVerifier must not call base::Time::Now() directly. It must call
57 // time_service_->Now(). This allows unit tests to mock the current time. 60 // time_service_->Now(). This allows unit tests to mock the current time.
58 class TimeService { 61 class TimeService {
59 public: 62 public:
60 virtual ~TimeService() {} 63 virtual ~TimeService() {}
61 64
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 214
212 // Completion callback for when request to |cert_verifier_| completes. 215 // Completion callback for when request to |cert_verifier_| completes.
213 CompletionCallbackImpl<SingleRequestCertVerifier> callback_; 216 CompletionCallbackImpl<SingleRequestCertVerifier> callback_;
214 217
215 DISALLOW_COPY_AND_ASSIGN(SingleRequestCertVerifier); 218 DISALLOW_COPY_AND_ASSIGN(SingleRequestCertVerifier);
216 }; 219 };
217 220
218 } // namespace net 221 } // namespace net
219 222
220 #endif // NET_BASE_CERT_VERIFIER_H_ 223 #endif // NET_BASE_CERT_VERIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698