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

Unified Diff: components/keyed_service/core/refcounted_keyed_service.cc

Issue 2581213002: Force HostContentSettingsMap to be destroyed on its owning thread. (Closed)
Patch Set: fix compile 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
« no previous file with comments | « components/keyed_service/core/refcounted_keyed_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/keyed_service/core/refcounted_keyed_service.cc
diff --git a/components/keyed_service/core/refcounted_keyed_service.cc b/components/keyed_service/core/refcounted_keyed_service.cc
index 6bc47584c5a54dab2885fb4628aad084c3c2f9df..9d400342093660b6c2744c66e085e467ee6f8242 100644
--- a/components/keyed_service/core/refcounted_keyed_service.cc
+++ b/components/keyed_service/core/refcounted_keyed_service.cc
@@ -4,15 +4,17 @@
#include "components/keyed_service/core/refcounted_keyed_service.h"
-#include "base/location.h"
-#include "base/threading/thread_task_runner_handle.h"
+#include <utility>
+
+#include "base/threading/sequenced_task_runner_handle.h"
namespace impl {
// static
void RefcountedKeyedServiceTraits::Destruct(const RefcountedKeyedService* obj) {
if (obj->task_runner_.get() != nullptr &&
- obj->task_runner_.get() != base::ThreadTaskRunnerHandle::Get()) {
+ base::SequencedTaskRunnerHandle::IsSet() &&
+ obj->task_runner_.get() != base::SequencedTaskRunnerHandle::Get()) {
Bernhard Bauer 2016/12/19 17:07:29 Do we have a guarantee that STRH's can be compared
gab 2016/12/19 18:25:56 No we don't (in practice it's true for MessageLoop
obj->task_runner_->DeleteSoon(FROM_HERE, obj);
} else {
delete obj;
@@ -25,9 +27,7 @@ RefcountedKeyedService::RefcountedKeyedService() : task_runner_(nullptr) {
}
RefcountedKeyedService::RefcountedKeyedService(
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner)
- : task_runner_(task_runner) {
-}
+ scoped_refptr<base::SequencedTaskRunner> task_runner)
+ : task_runner_(std::move(task_runner)) {}
-RefcountedKeyedService::~RefcountedKeyedService() {
-}
+RefcountedKeyedService::~RefcountedKeyedService() = default;
« no previous file with comments | « components/keyed_service/core/refcounted_keyed_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698