#ifndef CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_
#define CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_
#include <set>
#include <string>
#include "net/url_request/fraudulent_certificate_reporter.h"
#include "net/url_request/url_request.h"
namespace net {
class URLRequestContext;
}
namespace chrome_browser_net {
class ChromeFraudulentCertificateReporter
: public net::FraudulentCertificateReporter,
public net::URLRequest::Delegate {
public:
explicit ChromeFraudulentCertificateReporter(
net::URLRequestContext* request_context);
virtual ~ChromeFraudulentCertificateReporter();
virtual scoped_ptr<net::URLRequest> CreateURLRequest(
net::URLRequestContext* context);
virtual void SendReport(const std::string& hostname,
const net::SSLInfo& ssl_info,
bool sni_available) OVERRIDE;
virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE;
virtual void OnReadCompleted(net::URLRequest* request,
int bytes_read) OVERRIDE;
protected:
net::URLRequestContext* const request_context_;
private:
void RequestComplete(net::URLRequest* request);
const GURL upload_url_;
std::set<net::URLRequest*> inflight_requests_;
DISALLOW_COPY_AND_ASSIGN(ChromeFraudulentCertificateReporter);
};
}
#endif