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

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

Issue 441008: Many changes to DictionaryValues:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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
« base/values.cc ('K') | « ipc/ipc_message_utils.cc ('k') | no next file » | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/strict_transport_security_state.h" 5 #include "net/base/strict_transport_security_state.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 enabled_hosts_.clear(); 238 enabled_hosts_.clear();
239 239
240 scoped_ptr<Value> value( 240 scoped_ptr<Value> value(
241 base::JSONReader::Read(input, false /* do not allow trailing commas */)); 241 base::JSONReader::Read(input, false /* do not allow trailing commas */));
242 if (!value.get() || !value->IsType(Value::TYPE_DICTIONARY)) 242 if (!value.get() || !value->IsType(Value::TYPE_DICTIONARY))
243 return false; 243 return false;
244 244
245 DictionaryValue* dict_value = reinterpret_cast<DictionaryValue*>(value.get()); 245 DictionaryValue* dict_value = reinterpret_cast<DictionaryValue*>(value.get());
246 const base::Time current_time(base::Time::Now()); 246 const base::Time current_time(base::Time::Now());
247 247
248 for (DictionaryValue::key_iterator 248 for (DictionaryValue::key_iterator i = dict_value->begin_keys();
249 i = dict_value->begin_keys(); i != dict_value->end_keys(); ++i) { 249 i != dict_value->end_keys(); ++i) {
250 DictionaryValue* state; 250 DictionaryValue* state;
251 if (!dict_value->GetDictionary(*i, &state)) 251 if (!dict_value->GetDictionaryWithoutPathExpansion(*i, &state))
252 continue; 252 continue;
253 253
254 bool include_subdomains; 254 bool include_subdomains;
255 double expiry; 255 double expiry;
256 256
257 if (!state->GetBoolean(L"include_subdomains", &include_subdomains) || 257 if (!state->GetBoolean(L"include_subdomains", &include_subdomains) ||
258 !state->GetReal(L"expiry", &expiry)) { 258 !state->GetReal(L"expiry", &expiry)) {
259 continue; 259 continue;
260 } 260 }
261 261
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 if (new_host[i + 1] == '-' || 309 if (new_host[i + 1] == '-' ||
310 new_host[i + label_length] == '-') { 310 new_host[i + label_length] == '-') {
311 return std::string(); 311 return std::string();
312 } 312 }
313 } 313 }
314 314
315 return new_host; 315 return new_host;
316 } 316 }
317 317
318 } // namespace 318 } // namespace
OLDNEW
« base/values.cc ('K') | « ipc/ipc_message_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698