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" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 } | 43 } |
44 | 44 |
45 } // namespace | 45 } // namespace |
46 | 46 |
47 namespace content_settings { | 47 namespace content_settings { |
48 | 48 |
49 ContentSettingsPref::ContentSettingsPref( | 49 ContentSettingsPref::ContentSettingsPref( |
50 ContentSettingsType content_type, | 50 ContentSettingsType content_type, |
51 PrefService* prefs, | 51 PrefService* prefs, |
52 PrefChangeRegistrar* registrar, | 52 PrefChangeRegistrar* registrar, |
53 const char* pref_name, | 53 const std::string& pref_name, |
54 bool incognito, | 54 bool incognito, |
55 NotifyObserversCallback notify_callback) | 55 NotifyObserversCallback notify_callback) |
56 : content_type_(content_type), | 56 : content_type_(content_type), |
57 prefs_(prefs), | 57 prefs_(prefs), |
58 registrar_(registrar), | 58 registrar_(registrar), |
59 pref_name_(pref_name), | 59 pref_name_(pref_name), |
60 is_incognito_(incognito), | 60 is_incognito_(incognito), |
61 updating_preferences_(false), | 61 updating_preferences_(false), |
62 notify_callback_(notify_callback) { | 62 notify_callback_(notify_callback) { |
63 DCHECK(prefs_); | 63 DCHECK(prefs_); |
(...skipping 444 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 |