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

Unified Diff: chrome/browser/process_resource_usage.cc

Issue 1143343005: chrome/browser: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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 | « chrome/browser/printing/print_view_manager_base.cc ('k') | chrome/browser/process_singleton_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_resource_usage.cc
diff --git a/chrome/browser/process_resource_usage.cc b/chrome/browser/process_resource_usage.cc
index 27413c60f10b685431216f9ceccbd4b176cc6a3a..119ca71b95ba5f6c34139cd8b5c3d5664277172a 100644
--- a/chrome/browser/process_resource_usage.cc
+++ b/chrome/browser/process_resource_usage.cc
@@ -7,7 +7,8 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/error_handler.h"
class ProcessResourceUsage::ErrorHandler : public mojo::ErrorHandler {
@@ -38,9 +39,9 @@ ProcessResourceUsage::~ProcessResourceUsage() {
void ProcessResourceUsage::RunPendingRefreshCallbacks() {
DCHECK(thread_checker_.CalledOnValidThread());
- auto message_loop = base::MessageLoopProxy::current();
+ auto task_runner = base::ThreadTaskRunnerHandle::Get();
for (const auto& callback : refresh_callbacks_)
- message_loop->PostTask(FROM_HERE, callback);
+ task_runner->PostTask(FROM_HERE, callback);
refresh_callbacks_.clear();
}
@@ -48,7 +49,7 @@ void ProcessResourceUsage::Refresh(const base::Closure& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
if (!service_ || service_.encountered_error()) {
if (!callback.is_null())
- base::MessageLoopProxy::current()->PostTask(FROM_HERE, callback);
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback);
return;
}
« no previous file with comments | « chrome/browser/printing/print_view_manager_base.cc ('k') | chrome/browser/process_singleton_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698