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

Side by Side Diff: net/cert/cert_status_flags.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/cert_policy_enforcer_unittest.cc ('k') | net/cert/cert_status_flags.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_CERT_CERT_STATUS_FLAGS_H_
6 #define NET_CERT_CERT_STATUS_FLAGS_H_
7
8 #include "base/basictypes.h"
9 #include "net/base/net_export.h"
10
11 namespace net {
12
13 // Bitmask of status flags of a certificate, representing any errors, as well as
14 // other non-error status information such as whether the certificate is EV.
15 typedef uint32 CertStatus;
16
17 // NOTE: Because these names have appeared in bug reports, we preserve them as
18 // MACRO_STYLE for continuity, instead of renaming them to kConstantStyle as
19 // befits most static consts.
20 #define CERT_STATUS_FLAG(label, value) \
21 CertStatus static const CERT_STATUS_##label = value;
22 #include "net/cert/cert_status_flags_list.h"
23 #undef CERT_STATUS_FLAG
24
25 static const CertStatus CERT_STATUS_ALL_ERRORS = 0xFFFF;
26
27 // Returns true if the specified cert status has an error set.
28 static inline bool IsCertStatusError(CertStatus status) {
29 return (CERT_STATUS_ALL_ERRORS & status) != 0;
30 }
31
32 // IsCertStatusMinorError returns true iff |cert_status| indicates a condition
33 // that should typically be ignored by automated requests. (i.e. a revocation
34 // check failure.)
35 NET_EXPORT bool IsCertStatusMinorError(CertStatus cert_status);
36
37 // Maps a network error code to the equivalent certificate status flag. If
38 // the error code is not a certificate error, it is mapped to 0.
39 NET_EXPORT CertStatus MapNetErrorToCertStatus(int error);
40
41 // Maps the most serious certificate error in the certificate status flags
42 // to the equivalent network error code.
43 NET_EXPORT int MapCertStatusToNetError(CertStatus cert_status);
44
45 } // namespace net
46
47 #endif // NET_CERT_CERT_STATUS_FLAGS_H_
OLDNEW
« no previous file with comments | « net/cert/cert_policy_enforcer_unittest.cc ('k') | net/cert/cert_status_flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698