Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
|
palmer
2014/07/10 21:40:05
2014, since this is a new file.
radhikabhar
2014/07/11 04:16:15
Done.
| |
| 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 #endif | |
| 8 | |
| 9 #include "base/time/time.h" | |
| 10 #include "net/cert/x509_certificate.h" | |
| 11 | |
| 12 // This class calculates the severity scores for the different type of SSL | |
| 13 // errors. | |
| 14 class SSLErrorClassification { | |
| 15 public: | |
| 16 SSLErrorClassification(base::Time current_time, | |
| 17 net::X509Certificate* cert); | |
|
palmer
2014/07/10 21:40:05
Can this be:
const net::x509Certificate& cert
radhikabhar
2014/07/11 04:16:15
Done.
| |
| 18 ~SSLErrorClassification(); | |
| 19 | |
| 20 // Functions which check whether the user clock is wrong or not. | |
| 21 static bool IsUserClockInThePast(base::Time time_now); | |
| 22 static bool IsUserClockInTheFuture(base::Time time_now); | |
| 23 | |
| 24 // A function which calculates the severity score when the ssl error is | |
|
palmer
2014/07/10 21:40:05
Nit: I'd say "certificate error is |CERT_DATE_INVA
radhikabhar
2014/07/11 04:16:15
Done.
| |
| 25 // Date_Invalid. | |
| 26 float InvalidDateSeverityScore(); | |
|
palmer
2014/07/10 21:40:05
This member function can probably be declared cons
radhikabhar
2014/07/11 04:16:15
Done.
| |
| 27 | |
| 28 void RecordUMAStatistics(bool overridable); | |
| 29 base::TimeDelta TimePassedSinceExpiry(); | |
| 30 | |
| 31 private: | |
| 32 FRIEND_TEST_ALL_PREFIXES(SSLErrorClassification, TestDateInvalidScore); | |
| 33 | |
| 34 float CalculateScoreTimePassedSinceExpiry(); | |
| 35 | |
| 36 // This stores the current time. | |
| 37 base::Time current_time_; | |
| 38 | |
| 39 // This stores the certificate. | |
| 40 net::X509Certificate* cert_ ; | |
|
palmer
2014/07/10 21:40:05
Same thing: const & instead of non-const * (if pos
radhikabhar
2014/07/11 04:16:15
Done.
| |
| 41 }; | |
| OLD | NEW |