Commit afc45177 authored by anujk.sharma's avatar anujk.sharma Committed by Commit bot

Adding ThreadTaskRunnerHandle in lieu of MessageLoopProxy in net/cert and net/cookies module

MessageLoopProxy is deprecated.
This basically does a search and replace of:

MessageLoopProxy::current() -> ThreadTaskRunnerHandle::Get().

MessageLoopProxy -> SingleThreadTaskRunner

BUG=391045

Review URL: https://codereview.chromium.org/1124153005

Cr-Commit-Position: refs/heads/master@{#329998}
parent 990d0c7d
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/thread_task_runner_handle.h"
#include "crypto/nss_util_internal.h" #include "crypto/nss_util_internal.h"
#include "crypto/scoped_test_nss_chromeos_user.h" #include "crypto/scoped_test_nss_chromeos_user.h"
#include "crypto/scoped_test_nss_db.h" #include "crypto/scoped_test_nss_db.h"
...@@ -61,7 +61,7 @@ class NSSCertDatabaseChromeOSTest : public testing::Test, ...@@ -61,7 +61,7 @@ class NSSCertDatabaseChromeOSTest : public testing::Test,
crypto::GetPrivateSlotForChromeOSUser( crypto::GetPrivateSlotForChromeOSUser(
user_1_.username_hash(), user_1_.username_hash(),
base::Callback<void(crypto::ScopedPK11Slot)>()))); base::Callback<void(crypto::ScopedPK11Slot)>())));
db_1_->SetSlowTaskRunnerForTest(base::MessageLoopProxy::current()); db_1_->SetSlowTaskRunnerForTest(base::ThreadTaskRunnerHandle::Get());
db_1_->SetSystemSlot( db_1_->SetSystemSlot(
crypto::ScopedPK11Slot(PK11_ReferenceSlot(system_db_.slot()))); crypto::ScopedPK11Slot(PK11_ReferenceSlot(system_db_.slot())));
db_2_.reset(new NSSCertDatabaseChromeOS( db_2_.reset(new NSSCertDatabaseChromeOS(
...@@ -69,7 +69,7 @@ class NSSCertDatabaseChromeOSTest : public testing::Test, ...@@ -69,7 +69,7 @@ class NSSCertDatabaseChromeOSTest : public testing::Test,
crypto::GetPrivateSlotForChromeOSUser( crypto::GetPrivateSlotForChromeOSUser(
user_2_.username_hash(), user_2_.username_hash(),
base::Callback<void(crypto::ScopedPK11Slot)>()))); base::Callback<void(crypto::ScopedPK11Slot)>())));
db_2_->SetSlowTaskRunnerForTest(base::MessageLoopProxy::current()); db_2_->SetSlowTaskRunnerForTest(base::ThreadTaskRunnerHandle::Get());
// Add observer to CertDatabase for checking that notifications from // Add observer to CertDatabase for checking that notifications from
// NSSCertDatabaseChromeOS are proxied to the CertDatabase. // NSSCertDatabaseChromeOS are proxied to the CertDatabase.
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/thread_task_runner_handle.h"
#include "crypto/scoped_nss_types.h" #include "crypto/scoped_nss_types.h"
#include "crypto/scoped_test_nss_db.h" #include "crypto/scoped_test_nss_db.h"
#include "net/base/crypto_module.h" #include "net/base/crypto_module.h"
...@@ -131,7 +131,7 @@ TEST_F(CertDatabaseNSSTest, ListCerts) { ...@@ -131,7 +131,7 @@ TEST_F(CertDatabaseNSSTest, ListCerts) {
// This test isn't terribly useful, though it will at least let valgrind test // This test isn't terribly useful, though it will at least let valgrind test
// for leaks. // for leaks.
CertificateList certs; CertificateList certs;
cert_db_->SetSlowTaskRunnerForTest(base::MessageLoopProxy::current()); cert_db_->SetSlowTaskRunnerForTest(base::ThreadTaskRunnerHandle::Get());
cert_db_->ListCerts(base::Bind(&SwapCertList, base::Unretained(&certs))); cert_db_->ListCerts(base::Bind(&SwapCertList, base::Unretained(&certs)));
EXPECT_EQ(0U, certs.size()); EXPECT_EQ(0U, certs.size());
......
...@@ -54,12 +54,13 @@ ...@@ -54,12 +54,13 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/metrics/field_trial.h" #include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h" #include "base/metrics/histogram.h"
#include "base/profiler/scoped_tracker.h" #include "base/profiler/scoped_tracker.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/thread_task_runner_handle.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/cookies/canonical_cookie.h" #include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_util.h" #include "net/cookies/cookie_util.h"
...@@ -393,7 +394,7 @@ class CookieMonster::CookieMonsterTask ...@@ -393,7 +394,7 @@ class CookieMonster::CookieMonsterTask
friend class base::RefCountedThreadSafe<CookieMonsterTask>; friend class base::RefCountedThreadSafe<CookieMonsterTask>;
CookieMonster* cookie_monster_; CookieMonster* cookie_monster_;
scoped_refptr<base::MessageLoopProxy> thread_; scoped_refptr<base::SingleThreadTaskRunner> thread_;
DISALLOW_COPY_AND_ASSIGN(CookieMonsterTask); DISALLOW_COPY_AND_ASSIGN(CookieMonsterTask);
}; };
...@@ -401,7 +402,7 @@ class CookieMonster::CookieMonsterTask ...@@ -401,7 +402,7 @@ class CookieMonster::CookieMonsterTask
CookieMonster::CookieMonsterTask::CookieMonsterTask( CookieMonster::CookieMonsterTask::CookieMonsterTask(
CookieMonster* cookie_monster) CookieMonster* cookie_monster)
: cookie_monster_(cookie_monster), : cookie_monster_(cookie_monster),
thread_(base::MessageLoopProxy::current()) { thread_(base::ThreadTaskRunnerHandle::Get()) {
} }
CookieMonster::CookieMonsterTask::~CookieMonsterTask() { CookieMonster::CookieMonsterTask::~CookieMonsterTask() {
...@@ -2428,7 +2429,7 @@ CookieMonster::AddCallbackForCookie(const GURL& gurl, ...@@ -2428,7 +2429,7 @@ CookieMonster::AddCallbackForCookie(const GURL& gurl,
if (hook_map_.count(key) == 0) if (hook_map_.count(key) == 0)
hook_map_[key] = make_linked_ptr(new CookieChangedCallbackList()); hook_map_[key] = make_linked_ptr(new CookieChangedCallbackList());
return hook_map_[key]->Add( return hook_map_[key]->Add(
base::Bind(&RunAsync, base::MessageLoopProxy::current(), callback)); base::Bind(&RunAsync, base::ThreadTaskRunnerHandle::Get(), callback));
} }
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment