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

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

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 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
« no previous file with comments | « net/http/http_server_properties_manager_unittest.cc ('k') | net/log/test_net_log_entry.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 "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 164 }
165 165
166 if (now < domain_state.pkp.expiry) { 166 if (now < domain_state.pkp.expiry) {
167 serialized->Set(kDynamicSPKIHashes, 167 serialized->Set(kDynamicSPKIHashes,
168 SPKIHashesToListValue(domain_state.pkp.spki_hashes)); 168 SPKIHashesToListValue(domain_state.pkp.spki_hashes));
169 } 169 }
170 170
171 toplevel.Set(HashedDomainToExternalString(hostname), serialized); 171 toplevel.Set(HashedDomainToExternalString(hostname), serialized);
172 } 172 }
173 173
174 base::JSONWriter::WriteWithOptions(&toplevel, 174 base::JSONWriter::WriteWithOptions(
175 base::JSONWriter::OPTIONS_PRETTY_PRINT, 175 toplevel, base::JSONWriter::OPTIONS_PRETTY_PRINT, output);
176 output);
177 return true; 176 return true;
178 } 177 }
179 178
180 bool TransportSecurityPersister::LoadEntries(const std::string& serialized, 179 bool TransportSecurityPersister::LoadEntries(const std::string& serialized,
181 bool* dirty) { 180 bool* dirty) {
182 DCHECK(foreground_runner_->RunsTasksOnCurrentThread()); 181 DCHECK(foreground_runner_->RunsTasksOnCurrentThread());
183 182
184 transport_security_state_->ClearDynamicData(); 183 transport_security_state_->ClearDynamicData();
185 return Deserialize(serialized, dirty, transport_security_state_); 184 return Deserialize(serialized, dirty, transport_security_state_);
186 } 185 }
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 bool dirty = false; 311 bool dirty = false;
313 if (!LoadEntries(state, &dirty)) { 312 if (!LoadEntries(state, &dirty)) {
314 LOG(ERROR) << "Failed to deserialize state: " << state; 313 LOG(ERROR) << "Failed to deserialize state: " << state;
315 return; 314 return;
316 } 315 }
317 if (dirty) 316 if (dirty)
318 StateIsDirty(transport_security_state_); 317 StateIsDirty(transport_security_state_);
319 } 318 }
320 319
321 } // namespace net 320 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties_manager_unittest.cc ('k') | net/log/test_net_log_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698