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

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

Issue 2037933002: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/http_server_properties_impl.cc ('k') | net/proxy/proxy_config.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_persister.h" 5 #include "net/http/transport_security_persister.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 11 matching lines...) Expand all
22 #include "net/cert/x509_certificate.h" 22 #include "net/cert/x509_certificate.h"
23 #include "net/http/transport_security_state.h" 23 #include "net/http/transport_security_state.h"
24 24
25 namespace net { 25 namespace net {
26 26
27 namespace { 27 namespace {
28 28
29 base::ListValue* SPKIHashesToListValue(const HashValueVector& hashes) { 29 base::ListValue* SPKIHashesToListValue(const HashValueVector& hashes) {
30 base::ListValue* pins = new base::ListValue; 30 base::ListValue* pins = new base::ListValue;
31 for (size_t i = 0; i != hashes.size(); i++) 31 for (size_t i = 0; i != hashes.size(); i++)
32 pins->Append(new base::StringValue(hashes[i].ToString())); 32 pins->AppendString(hashes[i].ToString());
33 return pins; 33 return pins;
34 } 34 }
35 35
36 void SPKIHashesFromListValue(const base::ListValue& pins, 36 void SPKIHashesFromListValue(const base::ListValue& pins,
37 HashValueVector* hashes) { 37 HashValueVector* hashes) {
38 size_t num_pins = pins.GetSize(); 38 size_t num_pins = pins.GetSize();
39 for (size_t i = 0; i < num_pins; ++i) { 39 for (size_t i = 0; i < num_pins; ++i) {
40 std::string type_and_base64; 40 std::string type_and_base64;
41 HashValue fingerprint; 41 HashValue fingerprint;
42 if (pins.GetString(i, &type_and_base64) && 42 if (pins.GetString(i, &type_and_base64) &&
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 bool dirty = false; 377 bool dirty = false;
378 if (!LoadEntries(state, &dirty)) { 378 if (!LoadEntries(state, &dirty)) {
379 LOG(ERROR) << "Failed to deserialize state: " << state; 379 LOG(ERROR) << "Failed to deserialize state: " << state;
380 return; 380 return;
381 } 381 }
382 if (dirty) 382 if (dirty)
383 StateIsDirty(transport_security_state_); 383 StateIsDirty(transport_security_state_);
384 } 384 }
385 385
386 } // namespace net 386 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties_impl.cc ('k') | net/proxy/proxy_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698