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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 int setting; | 43 int setting; |
44 if (!value->GetAsInteger(&setting)) | 44 if (!value->GetAsInteger(&setting)) |
45 return false; | 45 return false; |
46 if (setting == CONTENT_SETTING_DEFAULT) | 46 if (setting == CONTENT_SETTING_DEFAULT) |
47 return false; | 47 return false; |
48 return info->IsSettingValid(IntToContentSetting(setting)); | 48 return info->IsSettingValid(IntToContentSetting(setting)); |
49 } | 49 } |
50 | 50 |
51 // TODO(raymes): We should permit different types of base::Value for | 51 // TODO(raymes): We should permit different types of base::Value for |
52 // website settings. | 52 // website settings. |
53 return value->GetType() == base::Value::TYPE_DICTIONARY; | 53 return value->GetType() == base::Value::Type::DICTIONARY; |
54 } | 54 } |
55 | 55 |
56 } // namespace | 56 } // namespace |
57 | 57 |
58 namespace content_settings { | 58 namespace content_settings { |
59 | 59 |
60 ContentSettingsPref::ContentSettingsPref( | 60 ContentSettingsPref::ContentSettingsPref( |
61 ContentSettingsType content_type, | 61 ContentSettingsType content_type, |
62 PrefService* prefs, | 62 PrefService* prefs, |
63 PrefChangeRegistrar* registrar, | 63 PrefChangeRegistrar* registrar, |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 | 509 |
510 void ContentSettingsPref::AssertLockNotHeld() const { | 510 void ContentSettingsPref::AssertLockNotHeld() const { |
511 #if !defined(NDEBUG) | 511 #if !defined(NDEBUG) |
512 // |Lock::Acquire()| will assert if the lock is held by this thread. | 512 // |Lock::Acquire()| will assert if the lock is held by this thread. |
513 lock_.Acquire(); | 513 lock_.Acquire(); |
514 lock_.Release(); | 514 lock_.Release(); |
515 #endif | 515 #endif |
516 } | 516 } |
517 | 517 |
518 } // namespace content_settings | 518 } // namespace content_settings |
OLD | NEW |