Index: chrome/browser/ssl/ssl_error_classification.h |
diff --git a/chrome/browser/ssl/ssl_error_classification.h b/chrome/browser/ssl/ssl_error_classification.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9c2174c913bf110d6edf8ab50c12aad4b33fa5bb |
--- /dev/null |
+++ b/chrome/browser/ssl/ssl_error_classification.h |
@@ -0,0 +1,41 @@ |
+// 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.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ |
+#define CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ |
+#endif |
+ |
+#include "base/time/time.h" |
+#include "net/cert/x509_certificate.h" |
+ |
+// This class calculates the severity scores for the different type of SSL |
+// errors. |
+class SSLErrorClassification { |
+ public: |
+ SSLErrorClassification(base::Time current_time, |
+ 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.
|
+ ~SSLErrorClassification(); |
+ |
+ // Functions which check whether the user clock is wrong or not. |
+ static bool IsUserClockInThePast(base::Time time_now); |
+ static bool IsUserClockInTheFuture(base::Time time_now); |
+ |
+ // 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.
|
+ // Date_Invalid. |
+ 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.
|
+ |
+ void RecordUMAStatistics(bool overridable); |
+ base::TimeDelta TimePassedSinceExpiry(); |
+ |
+ private: |
+ FRIEND_TEST_ALL_PREFIXES(SSLErrorClassification, TestDateInvalidScore); |
+ |
+ float CalculateScoreTimePassedSinceExpiry(); |
+ |
+ // This stores the current time. |
+ base::Time current_time_; |
+ |
+ // This stores the certificate. |
+ 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.
|
+}; |