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

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

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 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 | « net/base/crl_filter.cc ('k') | net/test/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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 return false; 365 return false;
366 } 366 }
367 367
368 // static 368 // static
369 bool TransportSecurityState::Deserialise( 369 bool TransportSecurityState::Deserialise(
370 const std::string& input, 370 const std::string& input,
371 bool* dirty, 371 bool* dirty,
372 std::map<std::string, DomainState>* out) { 372 std::map<std::string, DomainState>* out) {
373 scoped_ptr<Value> value( 373 scoped_ptr<Value> value(
374 base::JSONReader::Read(input, false /* do not allow trailing commas */)); 374 base::JSONReader::Read(input, false /* do not allow trailing commas */));
375 if (!value.get() || !value->IsType(Value::TYPE_DICTIONARY)) 375 if (!value.get() || !value->IsDictionary())
376 return false; 376 return false;
377 377
378 DictionaryValue* dict_value = reinterpret_cast<DictionaryValue*>(value.get()); 378 DictionaryValue* dict_value = reinterpret_cast<DictionaryValue*>(value.get());
379 const base::Time current_time(base::Time::Now()); 379 const base::Time current_time(base::Time::Now());
380 bool dirtied = false; 380 bool dirtied = false;
381 381
382 for (DictionaryValue::key_iterator i = dict_value->begin_keys(); 382 for (DictionaryValue::key_iterator i = dict_value->begin_keys();
383 i != dict_value->end_keys(); ++i) { 383 i != dict_value->end_keys(); ++i) {
384 DictionaryValue* state; 384 DictionaryValue* state;
385 if (!dict_value->GetDictionaryWithoutPathExpansion(*i, &state)) 385 if (!dict_value->GetDictionaryWithoutPathExpansion(*i, &state))
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 } 739 }
740 740
741 LOG(ERROR) << "Rejecting public key chain for domain " << domain 741 LOG(ERROR) << "Rejecting public key chain for domain " << domain
742 << ". Validated chain: " << HashesToBase64String(hashes) 742 << ". Validated chain: " << HashesToBase64String(hashes)
743 << ", expected: " << HashesToBase64String(public_key_hashes); 743 << ", expected: " << HashesToBase64String(public_key_hashes);
744 744
745 return false; 745 return false;
746 } 746 }
747 747
748 } // namespace 748 } // namespace
OLDNEW
« no previous file with comments | « net/base/crl_filter.cc ('k') | net/test/test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698