Chromium Code Reviews| Index: chrome/browser/content_settings/host_content_settings_map.cc |
| diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc |
| index d0554547abe9a2f0f48b26b1be783dc4a7432c42..d4ec4e341e501ba63d00d3ab9cea71b99c5906ba 100644 |
| --- a/chrome/browser/content_settings/host_content_settings_map.cc |
| +++ b/chrome/browser/content_settings/host_content_settings_map.cc |
| @@ -26,8 +26,6 @@ |
| #include "components/content_settings/core/browser/content_settings_rule.h" |
| #include "components/content_settings/core/common/content_settings_pattern.h" |
| #include "components/pref_registry/pref_registry_syncable.h" |
| -#include "content/public/browser/browser_thread.h" |
| -#include "content/public/common/content_switches.h" |
| #include "net/base/net_errors.h" |
| #include "net/base/static_cookie_policy.h" |
| #include "url/gurl.h" |
| @@ -36,8 +34,6 @@ |
| #include "extensions/common/constants.h" |
| #endif |
| -using content::BrowserThread; |
| - |
| namespace { |
| typedef std::vector<content_settings::Rule> Rules; |
| @@ -128,6 +124,7 @@ void HostContentSettingsMap::RegisterProfilePrefs( |
| void HostContentSettingsMap::RegisterProvider( |
| ProviderType type, |
| scoped_ptr<content_settings::ObservableProvider> provider) { |
| + DCHECK(CalledOnValidThread()); |
|
vabr (Chromium)
2014/09/23 07:51:00
Instead of trying to get this functionality from N
Jun Mukai
2014/09/23 20:48:44
That is an idea. Please see Bauer's comment.
Bernhard Bauer
2014/09/24 08:15:31
Yeah, that probably makes the most sense. You coul
vabr (Chromium)
2014/09/24 09:56:39
+1 to putting the ThreadChecker (or NonThreadSafe)
|
| DCHECK(!content_settings_providers_[type]); |
| provider->AddObserver(this); |
| content_settings_providers_[type] = provider.release(); |
| @@ -328,7 +325,7 @@ ContentSetting HostContentSettingsMap::GetContentSettingAndMaybeUpdateLastUsage( |
| const GURL& secondary_url, |
| ContentSettingsType content_type, |
| const std::string& resource_identifier) { |
| - DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| + DCHECK(CalledOnValidThread()); |
| ContentSetting setting = GetContentSetting( |
| primary_url, secondary_url, content_type, resource_identifier); |
| @@ -573,11 +570,10 @@ void HostContentSettingsMap::OnContentSettingChanged( |
| HostContentSettingsMap::~HostContentSettingsMap() { |
| DCHECK(!prefs_); |
| - STLDeleteValues(&content_settings_providers_); |
| } |
| void HostContentSettingsMap::ShutdownOnUIThread() { |
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| + DCHECK(CalledOnValidThread()); |
| DCHECK(prefs_); |
| prefs_ = NULL; |
| for (ProviderIterator it = content_settings_providers_.begin(); |
| @@ -585,6 +581,8 @@ void HostContentSettingsMap::ShutdownOnUIThread() { |
| ++it) { |
| it->second->ShutdownOnUIThread(); |
| } |
| + STLDeleteValues(&content_settings_providers_); |
| + DetachFromThread(); |
| } |
| void HostContentSettingsMap::MigrateObsoleteClearOnExitPref() { |