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

Side by Side Diff: components/content_settings/core/browser/content_settings_policy_provider.cc

Issue 1323923002: Remove use of JSONReader::DeprecatedRead from components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Error fix Created 5 years, 3 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 | « no previous file | components/dom_distiller/core/page_features_unittest.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 "components/content_settings/core/browser/content_settings_policy_provi der.h" 5 #include "components/content_settings/core/browser/content_settings_policy_provi der.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // } 264 // }
265 // } 265 // }
266 // } 266 // }
267 for (size_t j = 0; j < pattern_filter_str_list->GetSize(); ++j) { 267 for (size_t j = 0; j < pattern_filter_str_list->GetSize(); ++j) {
268 std::string pattern_filter_json; 268 std::string pattern_filter_json;
269 if (!pattern_filter_str_list->GetString(j, &pattern_filter_json)) { 269 if (!pattern_filter_str_list->GetString(j, &pattern_filter_json)) {
270 NOTREACHED(); 270 NOTREACHED();
271 continue; 271 continue;
272 } 272 }
273 273
274 scoped_ptr<base::Value> value(base::JSONReader::DeprecatedRead( 274 scoped_ptr<base::Value> value = base::JSONReader::Read(
275 pattern_filter_json, base::JSON_ALLOW_TRAILING_COMMAS)); 275 pattern_filter_json, base::JSON_ALLOW_TRAILING_COMMAS);
276 if (!value || !value->IsType(base::Value::TYPE_DICTIONARY)) { 276 if (!value || !value->IsType(base::Value::TYPE_DICTIONARY)) {
277 VLOG(1) << "Ignoring invalid certificate auto select setting. Reason:" 277 VLOG(1) << "Ignoring invalid certificate auto select setting. Reason:"
278 " Invalid JSON object: " << pattern_filter_json; 278 " Invalid JSON object: " << pattern_filter_json;
279 continue; 279 continue;
280 } 280 }
281 281
282 scoped_ptr<base::DictionaryValue> pattern_filter_pair( 282 scoped_ptr<base::DictionaryValue> pattern_filter_pair(
283 static_cast<base::DictionaryValue*>(value.release())); 283 static_cast<base::DictionaryValue*>(value.release()));
284 std::string pattern_str; 284 std::string pattern_str;
285 bool pattern_read = pattern_filter_pair->GetStringWithoutPathExpansion( 285 bool pattern_read = pattern_filter_pair->GetStringWithoutPathExpansion(
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 ReadManagedDefaultSettings(); 400 ReadManagedDefaultSettings();
401 } 401 }
402 402
403 NotifyObservers(ContentSettingsPattern(), 403 NotifyObservers(ContentSettingsPattern(),
404 ContentSettingsPattern(), 404 ContentSettingsPattern(),
405 CONTENT_SETTINGS_TYPE_DEFAULT, 405 CONTENT_SETTINGS_TYPE_DEFAULT,
406 std::string()); 406 std::string());
407 } 407 }
408 408
409 } // namespace content_settings 409 } // namespace content_settings
OLDNEW
« no previous file with comments | « no previous file | components/dom_distiller/core/page_features_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698