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

Unified Diff: chrome/browser/extensions/blacklist.cc

Issue 1112573002: [chrome/browser/extensions] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolving ng browser unittest issues Created 5 years, 8 months 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: chrome/browser/extensions/blacklist.cc
diff --git a/chrome/browser/extensions/blacklist.cc b/chrome/browser/extensions/blacklist.cc
index e52eb0079adce458853d41ad015ec2ce826f0367..ef1cdfe696222c9179d71bf3be866f517b86c9e5 100644
--- a/chrome/browser/extensions/blacklist.cc
+++ b/chrome/browser/extensions/blacklist.cc
@@ -11,7 +11,9 @@
#include "base/lazy_instance.h"
#include "base/memory/ref_counted.h"
#include "base/prefs/pref_service.h"
+#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
+#include "base/thread_task_runner_handle.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/blacklist_factory.h"
@@ -72,7 +74,7 @@ class SafeBrowsingClientImpl
SafeBrowsingClientImpl(
const std::set<std::string>& extension_ids,
const OnResultCallback& callback)
- : callback_message_loop_(base::MessageLoopProxy::current()),
+ : callback_task_runner_(base::ThreadTaskRunnerHandle::Get()),
callback_(callback) {
BrowserThread::PostTask(
BrowserThread::IO,
@@ -93,7 +95,7 @@ class SafeBrowsingClientImpl
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (database_manager->CheckExtensionIDs(extension_ids, this)) {
// Definitely not blacklisted. Callback immediately.
- callback_message_loop_->PostTask(
+ callback_task_runner_->PostTask(
FROM_HERE,
base::Bind(callback_, std::set<std::string>()));
return;
@@ -105,11 +107,11 @@ class SafeBrowsingClientImpl
void OnCheckExtensionsResult(const std::set<std::string>& hits) override {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- callback_message_loop_->PostTask(FROM_HERE, base::Bind(callback_, hits));
+ callback_task_runner_->PostTask(FROM_HERE, base::Bind(callback_, hits));
Release(); // Balanced in StartCheck.
}
- scoped_refptr<base::MessageLoopProxy> callback_message_loop_;
+ scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner_;
OnResultCallback callback_;
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingClientImpl);
@@ -191,7 +193,7 @@ void Blacklist::GetBlacklistedIDs(const std::set<std::string>& ids,
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (ids.empty() || !g_database_manager.Get().get().get()) {
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(callback, BlacklistStateMap()));
return;
}

Powered by Google App Engine
This is Rietveld 408576698