| Index: chrome/browser/ssl/chrome_fraudulent_certificate_reporter.cc
|
| diff --git a/chrome/browser/net/chrome_fraudulent_certificate_reporter.cc b/chrome/browser/ssl/chrome_fraudulent_certificate_reporter.cc
|
| similarity index 64%
|
| rename from chrome/browser/net/chrome_fraudulent_certificate_reporter.cc
|
| rename to chrome/browser/ssl/chrome_fraudulent_certificate_reporter.cc
|
| index 1c6dd486a5bccec9f0b10507beba7e8eb93d1f24..e24d71ad28abb0f6e3e5ffe9d70d1ae98e9dc94e 100644
|
| --- a/chrome/browser/net/chrome_fraudulent_certificate_reporter.cc
|
| +++ b/chrome/browser/ssl/chrome_fraudulent_certificate_reporter.cc
|
| @@ -1,11 +1,12 @@
|
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Copyright 2015 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.
|
|
|
| -#include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h"
|
| +#include "chrome/browser/ssl/chrome_fraudulent_certificate_reporter.h"
|
|
|
| #include "base/profiler/scoped_tracker.h"
|
| #include "chrome/browser/net/certificate_error_reporter.h"
|
| +#include "chrome/browser/ssl/certificate_error_report.h"
|
| #include "net/ssl/ssl_info.h"
|
| #include "net/url_request/url_request_context.h"
|
| #include "url/gurl.h"
|
| @@ -19,18 +20,17 @@ const char kFraudulentCertificateUploadEndpoint[] =
|
|
|
| } // namespace
|
|
|
| -namespace chrome_browser_net {
|
| -
|
| ChromeFraudulentCertificateReporter::ChromeFraudulentCertificateReporter(
|
| net::URLRequestContext* request_context)
|
| - : certificate_reporter_(new CertificateErrorReporter(
|
| + : certificate_reporter_(new chrome_browser_net::CertificateErrorReporter(
|
| request_context,
|
| GURL(kFraudulentCertificateUploadEndpoint),
|
| - CertificateErrorReporter::DO_NOT_SEND_COOKIES)) {
|
| + chrome_browser_net::CertificateErrorReporter::DO_NOT_SEND_COOKIES)) {
|
| }
|
|
|
| ChromeFraudulentCertificateReporter::ChromeFraudulentCertificateReporter(
|
| - scoped_ptr<CertificateErrorReporter> certificate_reporter)
|
| + scoped_ptr<chrome_browser_net::CertificateErrorReporter>
|
| + certificate_reporter)
|
| : certificate_reporter_(certificate_reporter.Pass()) {
|
| }
|
|
|
| @@ -45,9 +45,15 @@ void ChromeFraudulentCertificateReporter::SendReport(
|
| if (!net::TransportSecurityState::IsGooglePinnedProperty(hostname))
|
| return;
|
|
|
| + CertificateErrorReport report(hostname, ssl_info);
|
| + std::string serialized_report;
|
| + if (!report.Serialize(&serialized_report)) {
|
| + LOG(ERROR) << "Failed to serialize pinning violation report.";
|
| + return;
|
| + }
|
| +
|
| certificate_reporter_->SendReport(
|
| - CertificateErrorReporter::REPORT_TYPE_PINNING_VIOLATION, hostname,
|
| - ssl_info);
|
| + chrome_browser_net::CertificateErrorReporter::
|
| + REPORT_TYPE_PINNING_VIOLATION,
|
| + serialized_report);
|
| }
|
| -
|
| -} // namespace chrome_browser_net
|
|
|