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

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

Issue 9960077: Modify the base::JSONReader interface to take a set of options rather than a boolean flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 8 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
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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 if (pins.GetString(i, &type_and_base64)) 910 if (pins.GetString(i, &type_and_base64))
911 AddHash(type_and_base64, hashes); 911 AddHash(type_and_base64, hashes);
912 } 912 }
913 } 913 }
914 914
915 // static 915 // static
916 bool TransportSecurityState::Deserialise( 916 bool TransportSecurityState::Deserialise(
917 const std::string& input, 917 const std::string& input,
918 bool* dirty, 918 bool* dirty,
919 std::map<std::string, DomainState>* out) { 919 std::map<std::string, DomainState>* out) {
920 scoped_ptr<Value> value( 920 scoped_ptr<Value> value(base::JSONReader::Read(input));
921 base::JSONReader::Read(input, false /* do not allow trailing commas */));
922 if (!value.get() || !value->IsType(Value::TYPE_DICTIONARY)) 921 if (!value.get() || !value->IsType(Value::TYPE_DICTIONARY))
923 return false; 922 return false;
924 923
925 DictionaryValue* dict_value = reinterpret_cast<DictionaryValue*>(value.get()); 924 DictionaryValue* dict_value = reinterpret_cast<DictionaryValue*>(value.get());
926 const base::Time current_time(base::Time::Now()); 925 const base::Time current_time(base::Time::Now());
927 bool dirtied = false; 926 bool dirtied = false;
928 927
929 for (DictionaryValue::key_iterator i = dict_value->begin_keys(); 928 for (DictionaryValue::key_iterator i = dict_value->begin_keys();
930 i != dict_value->end_keys(); ++i) { 929 i != dict_value->end_keys(); ++i) {
931 DictionaryValue* state; 930 DictionaryValue* state;
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 1656
1658 return true; 1657 return true;
1659 } 1658 }
1660 1659
1661 bool TransportSecurityState::DomainState::ShouldRedirectHTTPToHTTPS() 1660 bool TransportSecurityState::DomainState::ShouldRedirectHTTPToHTTPS()
1662 const { 1661 const {
1663 return mode == MODE_STRICT; 1662 return mode == MODE_STRICT;
1664 } 1663 }
1665 1664
1666 } // namespace 1665 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698