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

Side by Side Diff: net/http/transport_security_state.cc

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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
« no previous file with comments | « net/http/mock_http_cache.cc ('k') | net/log/net_log_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "net/http/transport_security_state.h" 5 #include "net/http/transport_security_state.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 t.UTCExplode(&exploded); 78 t.UTCExplode(&exploded);
79 return base::StringPrintf( 79 return base::StringPrintf(
80 "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", exploded.year, exploded.month, 80 "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", exploded.year, exploded.month,
81 exploded.day_of_month, exploded.hour, exploded.minute, exploded.second, 81 exploded.day_of_month, exploded.hour, exploded.minute, exploded.second,
82 exploded.millisecond); 82 exploded.millisecond);
83 } 83 }
84 84
85 std::unique_ptr<base::ListValue> GetPEMEncodedChainAsList( 85 std::unique_ptr<base::ListValue> GetPEMEncodedChainAsList(
86 const net::X509Certificate* cert_chain) { 86 const net::X509Certificate* cert_chain) {
87 if (!cert_chain) 87 if (!cert_chain)
88 return base::WrapUnique(new base::ListValue()); 88 return base::MakeUnique<base::ListValue>();
89 89
90 std::unique_ptr<base::ListValue> result(new base::ListValue()); 90 std::unique_ptr<base::ListValue> result(new base::ListValue());
91 std::vector<std::string> pem_encoded_chain; 91 std::vector<std::string> pem_encoded_chain;
92 cert_chain->GetPEMEncodedChain(&pem_encoded_chain); 92 cert_chain->GetPEMEncodedChain(&pem_encoded_chain);
93 for (const std::string& cert : pem_encoded_chain) 93 for (const std::string& cert : pem_encoded_chain)
94 result->Append(base::WrapUnique(new base::StringValue(cert))); 94 result->Append(base::MakeUnique<base::StringValue>(cert));
95 95
96 return result; 96 return result;
97 } 97 }
98 98
99 bool HashReportForCache(const base::DictionaryValue& report, 99 bool HashReportForCache(const base::DictionaryValue& report,
100 const GURL& report_uri, 100 const GURL& report_uri,
101 std::string* cache_key) { 101 std::string* cache_key) {
102 char hashed[crypto::kSHA256Length]; 102 char hashed[crypto::kSHA256Length];
103 std::string to_hash; 103 std::string to_hash;
104 if (!base::JSONWriter::Write(report, &to_hash)) 104 if (!base::JSONWriter::Write(report, &to_hash))
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 TransportSecurityState::PKPStateIterator::PKPStateIterator( 1655 TransportSecurityState::PKPStateIterator::PKPStateIterator(
1656 const TransportSecurityState& state) 1656 const TransportSecurityState& state)
1657 : iterator_(state.enabled_pkp_hosts_.begin()), 1657 : iterator_(state.enabled_pkp_hosts_.begin()),
1658 end_(state.enabled_pkp_hosts_.end()) { 1658 end_(state.enabled_pkp_hosts_.end()) {
1659 } 1659 }
1660 1660
1661 TransportSecurityState::PKPStateIterator::~PKPStateIterator() { 1661 TransportSecurityState::PKPStateIterator::~PKPStateIterator() {
1662 } 1662 }
1663 1663
1664 } // namespace 1664 } // namespace
OLDNEW
« no previous file with comments | « net/http/mock_http_cache.cc ('k') | net/log/net_log_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698