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..7aaa169b62e8eccfcc23fc043e46428b38a50727 |
--- /dev/null |
+++ b/chrome/browser/ssl/ssl_error_classification.h |
@@ -0,0 +1,41 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// 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: |
+ |
felt
2014/07/10 18:41:10
nit: a single line after public
public:
SSLErr
radhikabhar
2014/07/10 20:04:43
Done.
|
+ SSLErrorClassification(base::Time current_time, |
+ net::X509Certificate* cert); |
+ ~SSLErrorClassification(); |
+ |
+ // Functions which check whether the user clock is wrong or not. |
+ static bool IsUserClockInThePast(bool overridable, base::Time time_now); |
+ static bool IsUserClockInTheFuture(bool overridable, base::Time time_now); |
+ |
+ // A function which calcualtes the severity score when the ssl error is |
+ // Date_Invalid. |
+ float InvalidDateSeverityScore(); |
+ |
+ base::TimeDelta TimePassedSinceExpiry(); |
+ |
+ private: |
+ float CalculateScoreTimePassedSinceExpiry(); |
+ |
+ // This stores the current time. |
+ base::Time current_time_; |
+ |
+ // This stores the certificate. |
+ net::X509Certificate* cert_ ; |
+ |
+ FRIEND_TEST_ALL_PREFIXES(SSLErrorClassification, TestDateInvalidScore); |
felt
2014/07/10 18:41:10
Usually put friend classes at the very beginning o
radhikabhar
2014/07/10 20:04:43
Done.
|
+}; |