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

Side by Side Diff: components/certificate_reporting/error_reporter.h

Issue 1921973002: Convert //components/[a-e]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_ 5 #ifndef COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_
6 #define COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_ 6 #define COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
10 #include <set> 11 #include <set>
11 #include <string> 12 #include <string>
12 13
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "net/url_request/certificate_report_sender.h" 15 #include "net/url_request/certificate_report_sender.h"
16 #include "url/gurl.h" 16 #include "url/gurl.h"
17 17
18 namespace net { 18 namespace net {
19 class URLRequestContext; 19 class URLRequestContext;
20 class SSLInfo; 20 class SSLInfo;
21 } 21 }
22 22
23 namespace certificate_reporting { 23 namespace certificate_reporting {
24 24
(...skipping 12 matching lines...) Expand all
37 const GURL& upload_url, 37 const GURL& upload_url,
38 net::CertificateReportSender::CookiesPreference cookies_preference); 38 net::CertificateReportSender::CookiesPreference cookies_preference);
39 39
40 // Allows tests to use a server public key with known private key and 40 // Allows tests to use a server public key with known private key and
41 // a mock CertificateReportSender. |server_public_key| must outlive 41 // a mock CertificateReportSender. |server_public_key| must outlive
42 // the ErrorReporter. 42 // the ErrorReporter.
43 ErrorReporter( 43 ErrorReporter(
44 const GURL& upload_url, 44 const GURL& upload_url,
45 const uint8_t server_public_key[/* 32 */], 45 const uint8_t server_public_key[/* 32 */],
46 const uint32_t server_public_key_version, 46 const uint32_t server_public_key_version,
47 scoped_ptr<net::CertificateReportSender> certificate_report_sender); 47 std::unique_ptr<net::CertificateReportSender> certificate_report_sender);
48 48
49 virtual ~ErrorReporter(); 49 virtual ~ErrorReporter();
50 50
51 // Sends a certificate report to the report collection server. The 51 // Sends a certificate report to the report collection server. The
52 // |serialized_report| is expected to be a serialized protobuf 52 // |serialized_report| is expected to be a serialized protobuf
53 // containing information about the hostname, certificate chain, and 53 // containing information about the hostname, certificate chain, and
54 // certificate errors encountered when validating the chain. 54 // certificate errors encountered when validating the chain.
55 // 55 //
56 // |SendReport| actually sends the report over the network; callers are 56 // |SendReport| actually sends the report over the network; callers are
57 // responsible for enforcing any preconditions (such as obtaining user 57 // responsible for enforcing any preconditions (such as obtaining user
(...skipping 10 matching lines...) Expand all
68 // Whether sending reports over HTTP is supported. 68 // Whether sending reports over HTTP is supported.
69 static bool IsHttpUploadUrlSupported(); 69 static bool IsHttpUploadUrlSupported();
70 70
71 // Used by tests. 71 // Used by tests.
72 static bool DecryptErrorReport( 72 static bool DecryptErrorReport(
73 const uint8_t server_private_key[32], 73 const uint8_t server_private_key[32],
74 const EncryptedCertLoggerRequest& encrypted_report, 74 const EncryptedCertLoggerRequest& encrypted_report,
75 std::string* decrypted_serialized_report); 75 std::string* decrypted_serialized_report);
76 76
77 private: 77 private:
78 scoped_ptr<net::CertificateReportSender> certificate_report_sender_; 78 std::unique_ptr<net::CertificateReportSender> certificate_report_sender_;
79 79
80 const GURL upload_url_; 80 const GURL upload_url_;
81 81
82 const uint8_t* server_public_key_; 82 const uint8_t* server_public_key_;
83 const uint32_t server_public_key_version_; 83 const uint32_t server_public_key_version_;
84 84
85 DISALLOW_COPY_AND_ASSIGN(ErrorReporter); 85 DISALLOW_COPY_AND_ASSIGN(ErrorReporter);
86 }; 86 };
87 87
88 } // namespace certificate_reporting 88 } // namespace certificate_reporting
89 89
90 #endif // COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_ 90 #endif // COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_
OLDNEW
« no previous file with comments | « components/certificate_reporting/error_report.h ('k') | components/certificate_reporting/error_reporter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698