summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorGabriel Charette <gab@chromium.org>2018-04-25 06:03:30 +0900
committerQijiang Fan <fqj@google.com>2020-06-05 09:09:41 +0900
commit1a7424d87955ab0e407866947cabbbd4898c3af7 (patch)
tree958fd3fa206f00619ccd1d4ef0a6cbb565b3a119 /ipc
parent21ace6d4c1e409628dab0d2148809f8af2c515ce (diff)
downloadlibchrome-1a7424d87955ab0e407866947cabbbd4898c3af7.tar.gz
Migrate MessageLoop::current() to MessageLoopCurrent in /ipc
These changes were scripted as part of the effort to restrict exposure of the raw MessageLoop*. Note that many static methods exposed on MessageLoopCurrent are also deprecated so it is very well possible that this is migrating to an already deprecated method. The goal of this pass is to reduce usage of MessageLoop::current() (and ultimately make it impossible to obtain the MessageLoop* statically). As such I will not edit this CL unless the script did something logically wrong. I defer to owners to fix highlighted usage of already deprecated APIs. Possible script screw ups / things to look out for in this review: - Storing MessageLoopCurrent in a MessageLoop* variable or comparing it against one (I will go over that in a separate pass). Includes should have been stripped if that was the last usage of message_loop.h in that file. Please CQ if LGTY This CL was uploaded by git cl split. R=tsepez@chromium.org Bug: 825327 Change-Id: I23484e311db823f08ac571bf34411f960cd8fb3e Reviewed-on: https://chromium-review.googlesource.com/1024316 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Gabriel Charette <gab@chromium.org> Cr-Commit-Position: refs/heads/master@{#553274} CrOS-Libchrome-Original-Commit: d79c145d8f65a8bdf9c128bf7e01e7b3337c349a
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_mojo_perftest.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/ipc/ipc_mojo_perftest.cc b/ipc/ipc_mojo_perftest.cc
index ce0e4c5bbf..d2652afa93 100644
--- a/ipc/ipc_mojo_perftest.cc
+++ b/ipc/ipc_mojo_perftest.cc
@@ -7,6 +7,7 @@
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_loop_current.h"
#include "base/process/process_metrics.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
@@ -793,7 +794,7 @@ class CallbackPerfTest : public testing::Test {
std::vector<PingPongTestParams> params = GetDefaultTestParams();
for (size_t i = 0; i < params.size(); i++) {
std::string hello("hello");
- base::MessageLoop::current()->task_runner()->PostTask(
+ base::MessageLoopCurrent::Get()->task_runner()->PostTask(
FROM_HERE, base::Bind(&CallbackPerfTest::SingleThreadPingPostTask,
base::Unretained(this), hello));
message_count_ = count_down_ = params[i].message_count();
@@ -804,7 +805,7 @@ class CallbackPerfTest : public testing::Test {
}
void SingleThreadPingPostTask(const std::string& value) {
- base::MessageLoop::current()->task_runner()->PostTask(
+ base::MessageLoopCurrent::Get()->task_runner()->PostTask(
FROM_HERE, base::Bind(&CallbackPerfTest::SingleThreadPongPostTask,
base::Unretained(this), value));
}
@@ -828,7 +829,7 @@ class CallbackPerfTest : public testing::Test {
}
}
- base::MessageLoop::current()->task_runner()->PostTask(
+ base::MessageLoopCurrent::Get()->task_runner()->PostTask(
FROM_HERE, base::Bind(&CallbackPerfTest::SingleThreadPingPostTask,
base::Unretained(this), payload_));
}