OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_pref.h" | 5 #include "components/content_settings/core/browser/content_settings_pref.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 if (settings_dictionary->GetDictionary( | 245 if (settings_dictionary->GetDictionary( |
246 kPerResourceIdentifierPrefName, &resource_dictionary)) { | 246 kPerResourceIdentifierPrefName, &resource_dictionary)) { |
247 for (base::DictionaryValue::Iterator j(*resource_dictionary); | 247 for (base::DictionaryValue::Iterator j(*resource_dictionary); |
248 !j.IsAtEnd(); | 248 !j.IsAtEnd(); |
249 j.Advance()) { | 249 j.Advance()) { |
250 const std::string& resource_identifier(j.key()); | 250 const std::string& resource_identifier(j.key()); |
251 int setting = CONTENT_SETTING_DEFAULT; | 251 int setting = CONTENT_SETTING_DEFAULT; |
252 bool is_integer = j.value().GetAsInteger(&setting); | 252 bool is_integer = j.value().GetAsInteger(&setting); |
253 DCHECK(is_integer); | 253 DCHECK(is_integer); |
254 DCHECK_NE(CONTENT_SETTING_DEFAULT, setting); | 254 DCHECK_NE(CONTENT_SETTING_DEFAULT, setting); |
255 std::unique_ptr<base::Value> setting_ptr( | 255 std::unique_ptr<base::Value> setting_ptr(new base::Value(setting)); |
256 new base::FundamentalValue(setting)); | |
257 value_map_.SetValue(pattern_pair.first, | 256 value_map_.SetValue(pattern_pair.first, |
258 pattern_pair.second, | 257 pattern_pair.second, |
259 content_type_, | 258 content_type_, |
260 resource_identifier, | 259 resource_identifier, |
261 setting_ptr->DeepCopy()); | 260 setting_ptr->DeepCopy()); |
262 } | 261 } |
263 } | 262 } |
264 } | 263 } |
265 | 264 |
266 const base::Value* value = nullptr; | 265 const base::Value* value = nullptr; |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 | 445 |
447 void ContentSettingsPref::AssertLockNotHeld() const { | 446 void ContentSettingsPref::AssertLockNotHeld() const { |
448 #if !defined(NDEBUG) | 447 #if !defined(NDEBUG) |
449 // |Lock::Acquire()| will assert if the lock is held by this thread. | 448 // |Lock::Acquire()| will assert if the lock is held by this thread. |
450 lock_.Acquire(); | 449 lock_.Acquire(); |
451 lock_.Release(); | 450 lock_.Release(); |
452 #endif | 451 #endif |
453 } | 452 } |
454 | 453 |
455 } // namespace content_settings | 454 } // namespace content_settings |
OLD | NEW |