Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1021)

Unified Diff: components/content_settings/core/browser/host_content_settings_map.cc

Issue 2581213002: Force HostContentSettingsMap to be destroyed on its owning thread. (Closed)
Patch Set: s/STRH comparison/RunsTasksOnCurrentThread/ Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/content_settings/core/browser/host_content_settings_map.cc
diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc
index 16e073e758c7879646417a4cbade7e702c240998..89fae035973e182e51da0b35e3b73817fc4be2af 100644
--- a/components/content_settings/core/browser/host_content_settings_map.cc
+++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -14,6 +14,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "base/time/clock.h"
#include "build/build_config.h"
#include "components/content_settings/core/browser/content_settings_default_provider.h"
@@ -178,7 +179,7 @@ content_settings::PatternPair GetPatternsForContentSettingsType(
HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs,
bool is_incognito_profile,
bool is_guest_profile)
- :
+ : RefcountedKeyedService(base::ThreadTaskRunnerHandle::Get()),
#ifndef NDEBUG
used_from_thread_id_(base::PlatformThread::CurrentId()),
#endif
@@ -827,6 +828,7 @@ void HostContentSettingsMap::OnContentSettingChanged(
}
HostContentSettingsMap::~HostContentSettingsMap() {
+ DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(!prefs_);
}

Powered by Google App Engine
This is Rietveld 408576698