OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2014 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 CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ | |
6 #define CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ | |
7 | |
8 #include "base/time/time.h" | |
9 #include "net/cert/x509_certificate.h" | |
10 | |
11 // This class calculates the severity scores for the different type of SSL | |
12 // errors. | |
13 class SSLErrorClassification { | |
14 public: | |
15 SSLErrorClassification(base::Time current_time, | |
16 const::net::X509Certificate& cert); | |
17 ~SSLErrorClassification(); | |
18 | |
19 // Functions which check whether the user clock is wrong or not. | |
20 static bool IsUserClockInThePast(base::Time time_now); | |
21 static bool IsUserClockInTheFuture(base::Time time_now); | |
22 | |
23 // A function which calculates the severity score when the ssl error is | |
24 // CERT_DATE_INVALID. | |
25 float InvalidDateSeverityScore() const; | |
26 | |
27 void RecordUMAStatistics(bool overridable); | |
felt
2014/07/11 14:12:48
could this also be a static method, at least for n
radhikabhar
2014/07/11 16:34:46
Done.
But in the future if I have to record any o
| |
28 base::TimeDelta TimePassedSinceExpiry() const; | |
29 | |
30 private: | |
31 FRIEND_TEST_ALL_PREFIXES(SSLErrorClassification, TestDateInvalidScore); | |
32 | |
33 float CalculateScoreTimePassedSinceExpiry() const; | |
34 | |
35 // This stores the current time. | |
36 base::Time current_time_; | |
37 | |
38 // This stores the certificate. | |
39 const net::X509Certificate& cert_; | |
40 }; | |
41 | |
42 #endif // CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ | |
OLD | NEW |