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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
11 #include "base/prefs/scoped_user_pref_update.h" | |
12 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
13 #include "base/time/clock.h" | 12 #include "base/time/clock.h" |
14 #include "components/content_settings/core/browser/content_settings_info.h" | 13 #include "components/content_settings/core/browser/content_settings_info.h" |
15 #include "components/content_settings/core/browser/content_settings_registry.h" | 14 #include "components/content_settings/core/browser/content_settings_registry.h" |
16 #include "components/content_settings/core/browser/content_settings_rule.h" | 15 #include "components/content_settings/core/browser/content_settings_rule.h" |
17 #include "components/content_settings/core/browser/content_settings_utils.h" | 16 #include "components/content_settings/core/browser/content_settings_utils.h" |
18 #include "components/content_settings/core/browser/host_content_settings_map.h" | 17 #include "components/content_settings/core/browser/host_content_settings_map.h" |
19 #include "components/content_settings/core/common/content_settings.h" | 18 #include "components/content_settings/core/common/content_settings.h" |
20 #include "components/content_settings/core/common/content_settings_pattern.h" | 19 #include "components/content_settings/core/common/content_settings_pattern.h" |
21 #include "components/content_settings/core/common/pref_names.h" | 20 #include "components/content_settings/core/common/pref_names.h" |
| 21 #include "components/prefs/scoped_user_pref_update.h" |
22 #include "url/gurl.h" | 22 #include "url/gurl.h" |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 const char kSettingPath[] = "setting"; | 26 const char kSettingPath[] = "setting"; |
27 const char kPerResourceIdentifierPrefName[] = "per_resource"; | 27 const char kPerResourceIdentifierPrefName[] = "per_resource"; |
28 const char kLastUsed[] = "last_used"; | 28 const char kLastUsed[] = "last_used"; |
29 | 29 |
30 // If the given content type supports resource identifiers in user preferences, | 30 // If the given content type supports resource identifiers in user preferences, |
31 // returns true and sets |pref_key| to the key in the content settings | 31 // returns true and sets |pref_key| to the key in the content settings |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 | 508 |
509 void ContentSettingsPref::AssertLockNotHeld() const { | 509 void ContentSettingsPref::AssertLockNotHeld() const { |
510 #if !defined(NDEBUG) | 510 #if !defined(NDEBUG) |
511 // |Lock::Acquire()| will assert if the lock is held by this thread. | 511 // |Lock::Acquire()| will assert if the lock is held by this thread. |
512 lock_.Acquire(); | 512 lock_.Acquire(); |
513 lock_.Release(); | 513 lock_.Release(); |
514 #endif | 514 #endif |
515 } | 515 } |
516 | 516 |
517 } // namespace content_settings | 517 } // namespace content_settings |
OLD | NEW |