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

Side by Side Diff: chrome/browser/extensions/api/content_settings/content_settings_store.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 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
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 "chrome/browser/extensions/api/content_settings/content_settings_store. h" 5 #include "chrome/browser/extensions/api/content_settings/content_settings_store. h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } 287 }
288 } 288 }
289 return settings; 289 return settings;
290 } 290 }
291 291
292 void ContentSettingsStore::SetExtensionContentSettingFromList( 292 void ContentSettingsStore::SetExtensionContentSettingFromList(
293 const std::string& extension_id, 293 const std::string& extension_id,
294 const base::ListValue* list, 294 const base::ListValue* list,
295 ExtensionPrefsScope scope) { 295 ExtensionPrefsScope scope) {
296 for (const auto& value : *list) { 296 for (const auto& value : *list) {
297 const base::DictionaryValue* dict = nullptr; 297 base::DictionaryValue* dict;
298 if (!value.GetAsDictionary(&dict)) { 298 if (!value->GetAsDictionary(&dict)) {
299 NOTREACHED(); 299 NOTREACHED();
300 continue; 300 continue;
301 } 301 }
302 std::string primary_pattern_str; 302 std::string primary_pattern_str;
303 dict->GetString(keys::kPrimaryPatternKey, &primary_pattern_str); 303 dict->GetString(keys::kPrimaryPatternKey, &primary_pattern_str);
304 ContentSettingsPattern primary_pattern = 304 ContentSettingsPattern primary_pattern =
305 ContentSettingsPattern::FromString(primary_pattern_str); 305 ContentSettingsPattern::FromString(primary_pattern_str);
306 DCHECK(primary_pattern.IsValid()); 306 DCHECK(primary_pattern.IsValid());
307 307
308 std::string secondary_pattern_str; 308 std::string secondary_pattern_str;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 ContentSettingsStore::ExtensionEntries::iterator 384 ContentSettingsStore::ExtensionEntries::iterator
385 ContentSettingsStore::FindIterator(const std::string& ext_id) { 385 ContentSettingsStore::FindIterator(const std::string& ext_id) {
386 return std::find_if(entries_.begin(), entries_.end(), 386 return std::find_if(entries_.begin(), entries_.end(),
387 [ext_id](const std::unique_ptr<ExtensionEntry>& entry) { 387 [ext_id](const std::unique_ptr<ExtensionEntry>& entry) {
388 return entry->id == ext_id; 388 return entry->id == ext_id;
389 }); 389 });
390 } 390 }
391 391
392 } // namespace extensions 392 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/extensions/api/declarative_content/content_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698