Chromium Code Reviews| 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..361189f159eea55cb5023fc4f8307eb179e5b014 |
| --- /dev/null |
| +++ b/chrome/browser/ssl/ssl_error_classification.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright (c) 2014 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_ |
| + |
| +#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, |
| + const::net::X509Certificate& cert); |
| + ~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 |
| + // CERT_DATE_INVALID. |
| + float InvalidDateSeverityScore() const; |
| + |
| + 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
|
| + base::TimeDelta TimePassedSinceExpiry() const; |
| + |
| + private: |
| + FRIEND_TEST_ALL_PREFIXES(SSLErrorClassification, TestDateInvalidScore); |
| + |
| + float CalculateScoreTimePassedSinceExpiry() const; |
| + |
| + // This stores the current time. |
| + base::Time current_time_; |
| + |
| + // This stores the certificate. |
| + const net::X509Certificate& cert_; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ |