Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Unified Diff: chrome/browser/net/chrome_fraudulent_certificate_reporter.h

Issue 8302019: Recommit fraudulent certificate reporting infrastructure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/cert_logger.proto ('k') | chrome/browser/net/chrome_fraudulent_certificate_reporter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_fraudulent_certificate_reporter.h
===================================================================
--- chrome/browser/net/chrome_fraudulent_certificate_reporter.h (revision 0)
+++ chrome/browser/net/chrome_fraudulent_certificate_reporter.h (revision 0)
@@ -0,0 +1,61 @@
+// Copyright (c) 2011 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_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_
+#define CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_
+#pragma once
+
+#include <set>
+#include <string>
+
+#include "net/url_request/fraudulent_certificate_reporter.h"
+#include "net/url_request/url_request.h"
+
+namespace chrome_browser_net {
+
+// TODO(palmer): Switch to HTTPS when the error handling delegate is more
+// sophisticated. Ultimately we plan to attempt the report on many transports.
+const char FRAUDULENT_CERTIFICATE_UPLOAD_ENDPOINT[] =
+ "http://clients3.google.com/log_cert_error";
+
+class ChromeFraudulentCertificateReporter
+ : public net::FraudulentCertificateReporter,
+ public net::URLRequest::Delegate {
+ public:
+ explicit ChromeFraudulentCertificateReporter(
+ net::URLRequestContext* request_context);
+
+ virtual ~ChromeFraudulentCertificateReporter();
+
+ // Allows users of this class to override this and set their own URLRequest
+ // type. Used by SendReport.
+ virtual net::URLRequest* CreateURLRequest();
+
+ // net::FraudulentCertificateReporter
+ virtual void SendReport(const std::string& hostname,
+ const net::SSLInfo& ssl_info,
+ bool sni_available) OVERRIDE;
+
+ // net::URLRequest::Delegate
+ virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE;
+ virtual 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_;
+ std::set<net::URLRequest*> inflight_requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeFraudulentCertificateReporter);
+};
+
+} // namespace chrome_browser_net
+
+#endif // CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_
+
« no previous file with comments | « chrome/browser/net/cert_logger.proto ('k') | chrome/browser/net/chrome_fraudulent_certificate_reporter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698