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

Unified Diff: components/webdata/common/web_data_request_manager.cc

Issue 2087583002: Remove calls to MessageLoop::current() in components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test error Created 4 years, 6 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
« no previous file with comments | « components/webdata/common/web_data_request_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webdata/common/web_data_request_manager.cc
diff --git a/components/webdata/common/web_data_request_manager.cc b/components/webdata/common/web_data_request_manager.cc
index 2900590cf4041c37066188de2f12ac98beb22bef..d03d841bf64fde0c3eeab115e74003cdadb33cbf 100644
--- a/components/webdata/common/web_data_request_manager.cc
+++ b/components/webdata/common/web_data_request_manager.cc
@@ -8,10 +8,9 @@
#include "base/bind.h"
#include "base/location.h"
-#include "base/message_loop/message_loop.h"
#include "base/profiler/scoped_tracker.h"
-#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
+#include "base/threading/thread_task_runner_handle.h"
////////////////////////////////////////////////////////////////////////////////
//
@@ -23,7 +22,7 @@ WebDataRequest::WebDataRequest(WebDataServiceConsumer* consumer,
WebDataRequestManager* manager)
: manager_(manager), cancelled_(false), consumer_(consumer) {
handle_ = manager_->GetNextRequestHandle();
- message_loop_ = base::MessageLoop::current();
+ task_runner_ = base::ThreadTaskRunnerHandle::Get();
manager_->RegisterRequest(this);
}
@@ -44,8 +43,9 @@ WebDataServiceConsumer* WebDataRequest::GetConsumer() const {
return consumer_;
}
-base::MessageLoop* WebDataRequest::GetMessageLoop() const {
- return message_loop_;
+scoped_refptr<base::SingleThreadTaskRunner> WebDataRequest::GetTaskRunner()
+ const {
+ return task_runner_;
}
bool WebDataRequest::IsCancelled() const {
@@ -114,8 +114,9 @@ void WebDataRequestManager::CancelRequest(WebDataServiceBase::Handle h) {
void WebDataRequestManager::RequestCompleted(
std::unique_ptr<WebDataRequest> request) {
- base::MessageLoop* loop = request->GetMessageLoop();
- loop->task_runner()->PostTask(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner =
+ request->GetTaskRunner();
+ task_runner->PostTask(
FROM_HERE, base::Bind(&WebDataRequestManager::RequestCompletedOnThread,
this, base::Passed(&request)));
}
« no previous file with comments | « components/webdata/common/web_data_request_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698