Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "components/content_settings/core/browser/host_content_settings_map.h" | 5 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 content_settings::PolicyProvider::RegisterProfilePrefs(registry); | 232 content_settings::PolicyProvider::RegisterProfilePrefs(registry); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void HostContentSettingsMap::RegisterProvider( | 235 void HostContentSettingsMap::RegisterProvider( |
| 236 ProviderType type, | 236 ProviderType type, |
| 237 std::unique_ptr<content_settings::ObservableProvider> provider) { | 237 std::unique_ptr<content_settings::ObservableProvider> provider) { |
| 238 DCHECK(!content_settings_providers_[type]); | 238 DCHECK(!content_settings_providers_[type]); |
| 239 provider->AddObserver(this); | 239 provider->AddObserver(this); |
| 240 content_settings_providers_[type] = std::move(provider); | 240 content_settings_providers_[type] = std::move(provider); |
| 241 | 241 |
| 242 #ifndef NDEBUG | 242 // DO NOT SUBMIT |
| 243 DCHECK_NE(used_from_thread_id_, base::kInvalidThreadId) | 243 /* |
|
Sigurður Ásgeirsson
2017/05/10 17:46:23
???
manzagop (departed)
2017/05/10 23:06:11
Yeah, this trips on TOT. MAD was also hitting it.
| |
| 244 << "Used from multiple threads before initialization complete."; | 244 #ifndef NDEBUG |
| 245 #endif | 245 DCHECK_NE(used_from_thread_id_, base::kInvalidThreadId) |
| 246 << "Used from multiple threads before initialization complete."; | |
| 247 #endif | |
| 248 */ | |
| 246 | 249 |
| 247 OnContentSettingChanged(ContentSettingsPattern(), | 250 OnContentSettingChanged(ContentSettingsPattern(), |
| 248 ContentSettingsPattern(), | 251 ContentSettingsPattern(), |
| 249 CONTENT_SETTINGS_TYPE_DEFAULT, | 252 CONTENT_SETTINGS_TYPE_DEFAULT, |
| 250 std::string()); | 253 std::string()); |
| 251 } | 254 } |
| 252 | 255 |
| 253 ContentSetting HostContentSettingsMap::GetDefaultContentSettingFromProvider( | 256 ContentSetting HostContentSettingsMap::GetDefaultContentSettingFromProvider( |
| 254 ContentSettingsType content_type, | 257 ContentSettingsType content_type, |
| 255 content_settings::ProviderInterface* provider) const { | 258 content_settings::ProviderInterface* provider) const { |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 933 return base::WrapUnique(rule.value.get()->DeepCopy()); | 936 return base::WrapUnique(rule.value.get()->DeepCopy()); |
| 934 } | 937 } |
| 935 } | 938 } |
| 936 } | 939 } |
| 937 return std::unique_ptr<base::Value>(); | 940 return std::unique_ptr<base::Value>(); |
| 938 } | 941 } |
| 939 | 942 |
| 940 void HostContentSettingsMap::SetClockForTesting( | 943 void HostContentSettingsMap::SetClockForTesting( |
| 941 std::unique_ptr<base::Clock> clock) { | 944 std::unique_ptr<base::Clock> clock) { |
| 942 pref_provider_->SetClockForTesting(std::move(clock)); | 945 pref_provider_->SetClockForTesting(std::move(clock)); |
| 943 } | 946 } |
| OLD | NEW |