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

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

Issue 2587883003: Revert of Force HostContentSettingsMap to be destroyed on its owning thread. (Closed)
Patch Set: 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 04a1ea572889ff96ffff4721e8e794a5369efdf5..6bc47584c5a54dab2885fb4628aad084c3c2f9df 100644
--- a/components/keyed_service/core/refcounted_keyed_service.cc
+++ b/components/keyed_service/core/refcounted_keyed_service.cc
@@ -4,13 +4,15 @@
#include "components/keyed_service/core/refcounted_keyed_service.h"
-#include <utility>
+#include "base/location.h"
+#include "base/threading/thread_task_runner_handle.h"
namespace impl {
// static
void RefcountedKeyedServiceTraits::Destruct(const RefcountedKeyedService* obj) {
- if (obj->task_runner_ && !obj->task_runner_->RunsTasksOnCurrentThread()) {
+ if (obj->task_runner_.get() != nullptr &&
+ obj->task_runner_.get() != base::ThreadTaskRunnerHandle::Get()) {
obj->task_runner_->DeleteSoon(FROM_HERE, obj);
} else {
delete obj;
@@ -23,7 +25,9 @@
}
RefcountedKeyedService::RefcountedKeyedService(
- scoped_refptr<base::SequencedTaskRunner> task_runner)
- : task_runner_(std::move(task_runner)) {}
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner)
+ : task_runner_(task_runner) {
+}
-RefcountedKeyedService::~RefcountedKeyedService() = default;
+RefcountedKeyedService::~RefcountedKeyedService() {
+}
« 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