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

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

Issue 9590002: JSONWriter cleanup: integrate pretty print into write options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict 7. Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « jingle/glue/utils.cc ('k') | net/test/remote_test_server.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/base/transport_security_state.h" 5 #include "net/base/transport_security_state.h"
6 6
7 #if defined(USE_OPENSSL) 7 #if defined(USE_OPENSSL)
8 #include <openssl/ecdsa.h> 8 #include <openssl/ecdsa.h>
9 #include <openssl/ssl.h> 9 #include <openssl/ssl.h>
10 #else // !defined(USE_OPENSSL) 10 #else // !defined(USE_OPENSSL)
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 SPKIHashesToListValue(i->second.preloaded_spki_hashes)); 870 SPKIHashesToListValue(i->second.preloaded_spki_hashes));
871 871
872 if (now < i->second.dynamic_spki_hashes_expiry) { 872 if (now < i->second.dynamic_spki_hashes_expiry) {
873 state->Set("dynamic_spki_hashes", 873 state->Set("dynamic_spki_hashes",
874 SPKIHashesToListValue(i->second.dynamic_spki_hashes)); 874 SPKIHashesToListValue(i->second.dynamic_spki_hashes));
875 } 875 }
876 876
877 toplevel.Set(HashedDomainToExternalString(i->first), state); 877 toplevel.Set(HashedDomainToExternalString(i->first), state);
878 } 878 }
879 879
880 base::JSONWriter::Write(&toplevel, true /* pretty print */, output); 880 base::JSONWriter::WriteWithOptions(&toplevel,
881 base::JSONWriter::OPTIONS_PRETTY_PRINT,
882 output);
881 return true; 883 return true;
882 } 884 }
883 885
884 bool TransportSecurityState::LoadEntries(const std::string& input, 886 bool TransportSecurityState::LoadEntries(const std::string& input,
885 bool* dirty) { 887 bool* dirty) {
886 DCHECK(CalledOnValidThread()); 888 DCHECK(CalledOnValidThread());
887 889
888 enabled_hosts_.clear(); 890 enabled_hosts_.clear();
889 return Deserialise(input, dirty, &enabled_hosts_); 891 return Deserialise(input, dirty, &enabled_hosts_);
890 } 892 }
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 1657
1656 return true; 1658 return true;
1657 } 1659 }
1658 1660
1659 bool TransportSecurityState::DomainState::ShouldRedirectHTTPToHTTPS() 1661 bool TransportSecurityState::DomainState::ShouldRedirectHTTPToHTTPS()
1660 const { 1662 const {
1661 return mode == MODE_STRICT; 1663 return mode == MODE_STRICT;
1662 } 1664 }
1663 1665
1664 } // namespace 1666 } // namespace
OLDNEW
« no previous file with comments | « jingle/glue/utils.cc ('k') | net/test/remote_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698