Index: chrome/browser/net/chrome_fraudulent_certificate_reporter.h |
diff --git a/chrome/browser/net/chrome_fraudulent_certificate_reporter.h b/chrome/browser/net/chrome_fraudulent_certificate_reporter.h |
index c9874768f1e818aeccfa58e670851e2dfc4f55ed..cddb6f31e7ebae5f8d2e9bfeb28c851aa1b6a3e6 100644 |
--- a/chrome/browser/net/chrome_fraudulent_certificate_reporter.h |
+++ b/chrome/browser/net/chrome_fraudulent_certificate_reporter.h |
@@ -8,8 +8,9 @@ |
#include <set> |
#include <string> |
+#include "base/memory/scoped_ptr.h" |
+#include "chrome/browser/net/certificate_error_reporter.h" |
Ryan Sleevi
2015/03/09 22:14:07
You can forward declare this entire class.
estark
2015/03/09 23:21:17
That doesn't seem to be possible with a scoped_ptr
Ryan Sleevi
2015/03/09 23:44:56
It does when you move the dtor to the .cc (since t
estark
2015/03/10 00:07:38
Done.
|
#include "net/url_request/fraudulent_certificate_reporter.h" |
-#include "net/url_request/url_request.h" |
namespace net { |
class URLRequestContext; |
@@ -18,37 +19,23 @@ class URLRequestContext; |
namespace chrome_browser_net { |
class ChromeFraudulentCertificateReporter |
- : public net::FraudulentCertificateReporter, |
- public net::URLRequest::Delegate { |
+ : public net::FraudulentCertificateReporter { |
public: |
explicit ChromeFraudulentCertificateReporter( |
net::URLRequestContext* request_context); |
- ~ChromeFraudulentCertificateReporter() override; |
+ // Useful for tests to use a mock reporter. |
+ explicit ChromeFraudulentCertificateReporter( |
+ scoped_ptr<CertificateErrorReporter> certificate_reporter); |
- // Allows users of this class to override this and set their own URLRequest |
- // type. Used by SendReport. |
- virtual scoped_ptr<net::URLRequest> CreateURLRequest( |
- net::URLRequestContext* context); |
+ ~ChromeFraudulentCertificateReporter() override {} |
Ryan Sleevi
2015/03/09 22:14:07
Should not be inline; should be in the .cc file
estark
2015/03/09 23:21:17
Done.
|
// net::FraudulentCertificateReporter |
void SendReport(const std::string& hostname, |
const net::SSLInfo& ssl_info) override; |
- // net::URLRequest::Delegate |
- void OnResponseStarted(net::URLRequest* request) override; |
- void OnReadCompleted(net::URLRequest* request, int bytes_read) override; |
- |
- protected: |
- net::URLRequestContext* const request_context_; |
- |
private: |
- // Performs post-report cleanup. |
- void RequestComplete(net::URLRequest* request); |
- |
- const GURL upload_url_; |
- // Owns the contained requests. |
- std::set<net::URLRequest*> inflight_requests_; |
+ scoped_ptr<CertificateErrorReporter> certificate_reporter_; |
DISALLOW_COPY_AND_ASSIGN(ChromeFraudulentCertificateReporter); |
}; |
@@ -56,4 +43,3 @@ class ChromeFraudulentCertificateReporter |
} // namespace chrome_browser_net |
#endif // CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_ |
- |