EDK: Remove tracked_objects::Location argument in TestIOThread methods (etc.).
I've never found the tracking information useful in this code, and the
abstraction/wrapper around base::TaskRunner won't have it.
R=jamesr@chromium.org
Review URL: https://codereview.chromium.org/1408133004 .
diff --git a/mojo/edk/embedder/embedder_unittest.cc b/mojo/edk/embedder/embedder_unittest.cc
index 20e4664..0844fc5 100644
--- a/mojo/edk/embedder/embedder_unittest.cc
+++ b/mojo/edk/embedder/embedder_unittest.cc
@@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/command_line.h"
-#include "base/location.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/synchronization/waitable_event.h"
@@ -243,8 +242,7 @@
base::Bind(&TestAsyncWaiter::Awake,
base::Unretained(&waiter))));
- test_io_task_runner()->PostTask(FROM_HERE,
- base::Bind(&WriteHello, server_mp.get()));
+ test_io_thread().PostTask(base::Bind(&WriteHello, server_mp.get()));
EXPECT_TRUE(waiter.TryWait());
EXPECT_EQ(MOJO_RESULT_OK, waiter.wait_result());
@@ -267,8 +265,7 @@
base::Bind(&TestAsyncWaiter::Awake,
base::Unretained(&unsatisfiable_waiter))));
- test_io_task_runner()->PostTask(
- FROM_HERE,
+ test_io_thread().PostTask(
base::Bind(&CloseScopedHandle, base::Passed(server_mp.Pass())));
EXPECT_TRUE(unsatisfiable_waiter.TryWait());
@@ -446,7 +443,6 @@
EXPECT_TRUE(event.TimedWait(TestTimeouts::action_timeout()));
test_io_thread().PostTaskAndWait(
- FROM_HERE,
base::Bind(&DestroyChannelOnIOThread, base::Unretained(channel_info)));
}
@@ -521,7 +517,6 @@
EXPECT_TRUE(event.TimedWait(TestTimeouts::action_timeout()));
test_io_thread.PostTaskAndWait(
- FROM_HERE,
base::Bind(&DestroyChannelOnIOThread, base::Unretained(channel_info)));
}
diff --git a/mojo/edk/system/channel_endpoint_unittest.cc b/mojo/edk/system/channel_endpoint_unittest.cc
index e82a005..19cc237 100644
--- a/mojo/edk/system/channel_endpoint_unittest.cc
+++ b/mojo/edk/system/channel_endpoint_unittest.cc
@@ -29,16 +29,16 @@
test::ChannelTestBase::SetUp();
PostMethodToIOThreadAndWait(
- FROM_HERE, &ChannelEndpointTest::CreateAndInitChannelOnIOThread, 0);
+ &ChannelEndpointTest::CreateAndInitChannelOnIOThread, 0);
PostMethodToIOThreadAndWait(
- FROM_HERE, &ChannelEndpointTest::CreateAndInitChannelOnIOThread, 1);
+ &ChannelEndpointTest::CreateAndInitChannelOnIOThread, 1);
}
void TearDown() override {
- PostMethodToIOThreadAndWait(
- FROM_HERE, &ChannelEndpointTest::ShutdownChannelOnIOThread, 0);
- PostMethodToIOThreadAndWait(
- FROM_HERE, &ChannelEndpointTest::ShutdownChannelOnIOThread, 1);
+ PostMethodToIOThreadAndWait(&ChannelEndpointTest::ShutdownChannelOnIOThread,
+ 0);
+ PostMethodToIOThreadAndWait(&ChannelEndpointTest::ShutdownChannelOnIOThread,
+ 1);
test::ChannelTestBase::TearDown();
}
diff --git a/mojo/edk/system/channel_test_base.cc b/mojo/edk/system/channel_test_base.cc
index 1b6678a..1069e79 100644
--- a/mojo/edk/system/channel_test_base.cc
+++ b/mojo/edk/system/channel_test_base.cc
@@ -22,7 +22,7 @@
}
void ChannelTestBase::SetUp() {
- PostMethodToIOThreadAndWait(FROM_HERE, &ChannelTestBase::SetUpOnIOThread);
+ PostMethodToIOThreadAndWait(&ChannelTestBase::SetUpOnIOThread);
}
void ChannelTestBase::CreateChannelOnIOThread(unsigned i) {
diff --git a/mojo/edk/system/channel_test_base.h b/mojo/edk/system/channel_test_base.h
index 8518cbc..8b1b932 100644
--- a/mojo/edk/system/channel_test_base.h
+++ b/mojo/edk/system/channel_test_base.h
@@ -8,7 +8,6 @@
#include <memory>
#include "base/bind.h"
-#include "base/location.h"
#include "mojo/edk/embedder/simple_platform_support.h"
#include "mojo/edk/system/channel.h"
#include "mojo/edk/system/ref_ptr.h"
@@ -32,11 +31,9 @@
void SetUp() override;
template <typename Functor, typename... Args>
- void PostMethodToIOThreadAndWait(const tracked_objects::Location& from_here,
- Functor functor,
- const Args&... args) {
+ void PostMethodToIOThreadAndWait(Functor functor, const Args&... args) {
io_thread_.PostTaskAndWait(
- from_here, base::Bind(functor, base::Unretained(this), args...));
+ base::Bind(functor, base::Unretained(this), args...));
}
// These should only be called from |io_thread()|:
diff --git a/mojo/edk/system/channel_unittest.cc b/mojo/edk/system/channel_unittest.cc
index ec668cb..b90c884 100644
--- a/mojo/edk/system/channel_unittest.cc
+++ b/mojo/edk/system/channel_unittest.cc
@@ -25,10 +25,8 @@
// ChannelTest.InitShutdown ----------------------------------------------------
TEST_F(ChannelTest, InitShutdown) {
- PostMethodToIOThreadAndWait(FROM_HERE,
- &ChannelTest::CreateAndInitChannelOnIOThread, 0);
- PostMethodToIOThreadAndWait(FROM_HERE,
- &ChannelTest::ShutdownChannelOnIOThread, 0);
+ PostMethodToIOThreadAndWait(&ChannelTest::CreateAndInitChannelOnIOThread, 0);
+ PostMethodToIOThreadAndWait(&ChannelTest::ShutdownChannelOnIOThread, 0);
// Okay to destroy |Channel| on not-the-I/O-thread.
channel(0)->AssertHasOneRef();
@@ -38,8 +36,7 @@
// ChannelTest.CloseBeforeAttachAndRun -----------------------------------------
TEST_F(ChannelTest, CloseBeforeRun) {
- PostMethodToIOThreadAndWait(FROM_HERE,
- &ChannelTest::CreateAndInitChannelOnIOThread, 0);
+ PostMethodToIOThreadAndWait(&ChannelTest::CreateAndInitChannelOnIOThread, 0);
RefPtr<ChannelEndpoint> channel_endpoint;
auto mp = MessagePipe::CreateLocalProxy(&channel_endpoint);
@@ -48,8 +45,7 @@
channel(0)->SetBootstrapEndpoint(std::move(channel_endpoint));
- PostMethodToIOThreadAndWait(FROM_HERE,
- &ChannelTest::ShutdownChannelOnIOThread, 0);
+ PostMethodToIOThreadAndWait(&ChannelTest::ShutdownChannelOnIOThread, 0);
channel(0)->AssertHasOneRef();
}
@@ -57,8 +53,7 @@
// ChannelTest.ShutdownAfterAttachAndRun ---------------------------------------
TEST_F(ChannelTest, ShutdownAfterAttach) {
- PostMethodToIOThreadAndWait(FROM_HERE,
- &ChannelTest::CreateAndInitChannelOnIOThread, 0);
+ PostMethodToIOThreadAndWait(&ChannelTest::CreateAndInitChannelOnIOThread, 0);
RefPtr<ChannelEndpoint> channel_endpoint;
auto mp = MessagePipe::CreateLocalProxy(&channel_endpoint);
@@ -72,8 +67,7 @@
mp->AddAwakable(0, &waiter, MOJO_HANDLE_SIGNAL_READABLE, 123, nullptr));
// Don't wait for the shutdown to run ...
- PostMethodToIOThreadAndWait(FROM_HERE,
- &ChannelTest::ShutdownChannelOnIOThread, 0);
+ PostMethodToIOThreadAndWait(&ChannelTest::ShutdownChannelOnIOThread, 0);
// ... since this |Wait()| should fail once the channel is shut down.
EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
@@ -91,16 +85,14 @@
// ChannelTest.WaitAfterAttachRunAndShutdown -----------------------------------
TEST_F(ChannelTest, WaitAfterAttachRunAndShutdown) {
- PostMethodToIOThreadAndWait(FROM_HERE,
- &ChannelTest::CreateAndInitChannelOnIOThread, 0);
+ PostMethodToIOThreadAndWait(&ChannelTest::CreateAndInitChannelOnIOThread, 0);
RefPtr<ChannelEndpoint> channel_endpoint;
auto mp = MessagePipe::CreateLocalProxy(&channel_endpoint);
channel(0)->SetBootstrapEndpoint(std::move(channel_endpoint));
- PostMethodToIOThreadAndWait(FROM_HERE,
- &ChannelTest::ShutdownChannelOnIOThread, 0);
+ PostMethodToIOThreadAndWait(&ChannelTest::ShutdownChannelOnIOThread, 0);
Waiter waiter;
waiter.Init();
@@ -124,8 +116,8 @@
for (size_t i = 0; i < kIterations; i++) {
// Need a new set of |RawChannel|s on every iteration.
SetUp();
- PostMethodToIOThreadAndWait(
- FROM_HERE, &ChannelTest::CreateAndInitChannelOnIOThread, 0);
+ PostMethodToIOThreadAndWait(&ChannelTest::CreateAndInitChannelOnIOThread,
+ 0);
RefPtr<ChannelEndpoint> channel_endpoint;
auto mp = MessagePipe::CreateLocalProxy(&channel_endpoint);
@@ -133,12 +125,12 @@
channel(0)->SetBootstrapEndpoint(std::move(channel_endpoint));
io_thread()->PostTask(
- FROM_HERE, base::Bind(&ChannelTest::ShutdownAndReleaseChannelOnIOThread,
- base::Unretained(this), 0));
+ base::Bind(&ChannelTest::ShutdownAndReleaseChannelOnIOThread,
+ base::Unretained(this), 0));
mp->Close(0);
// Wait for the IO thread to finish shutting down the channel.
- io_thread()->PostTaskAndWait(FROM_HERE, base::Bind(&DoNothing));
+ io_thread()->PostTaskAndWait(base::Bind(&DoNothing));
EXPECT_FALSE(channel(0));
}
}
diff --git a/mojo/edk/system/data_pipe_impl_unittest.cc b/mojo/edk/system/data_pipe_impl_unittest.cc
index 42a02c4..cbacf0e 100644
--- a/mojo/edk/system/data_pipe_impl_unittest.cc
+++ b/mojo/edk/system/data_pipe_impl_unittest.cc
@@ -13,7 +13,6 @@
#include <utility>
#include "base/bind.h"
-#include "base/location.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
@@ -232,18 +231,17 @@
message_pipes_[0] = MessagePipe::CreateLocalProxy(&ep[0]);
message_pipes_[1] = MessagePipe::CreateLocalProxy(&ep[1]);
- io_thread_.PostTaskAndWait(
- FROM_HERE, base::Bind(&RemoteDataPipeImplTestHelper::SetUpOnIOThread,
- base::Unretained(this), base::Passed(&ep[0]),
- base::Passed(&ep[1])));
+ io_thread_.PostTaskAndWait(base::Bind(
+ &RemoteDataPipeImplTestHelper::SetUpOnIOThread, base::Unretained(this),
+ base::Passed(&ep[0]), base::Passed(&ep[1])));
}
void TearDown() override {
EnsureMessagePipeClosed(0);
EnsureMessagePipeClosed(1);
io_thread_.PostTaskAndWait(
- FROM_HERE, base::Bind(&RemoteDataPipeImplTestHelper::TearDownOnIOThread,
- base::Unretained(this)));
+ base::Bind(&RemoteDataPipeImplTestHelper::TearDownOnIOThread,
+ base::Unretained(this)));
}
void Create(const MojoCreateDataPipeOptions& validated_options) override {
diff --git a/mojo/edk/system/endpoint_relayer_unittest.cc b/mojo/edk/system/endpoint_relayer_unittest.cc
index d88e3ec..1b8b440 100644
--- a/mojo/edk/system/endpoint_relayer_unittest.cc
+++ b/mojo/edk/system/endpoint_relayer_unittest.cc
@@ -29,9 +29,9 @@
test::ChannelTestBase::SetUp();
PostMethodToIOThreadAndWait(
- FROM_HERE, &EndpointRelayerTest::CreateAndInitChannelOnIOThread, 0);
+ &EndpointRelayerTest::CreateAndInitChannelOnIOThread, 0);
PostMethodToIOThreadAndWait(
- FROM_HERE, &EndpointRelayerTest::CreateAndInitChannelOnIOThread, 1);
+ &EndpointRelayerTest::CreateAndInitChannelOnIOThread, 1);
// The set up:
// * Across the pair of channels, we'll have a pair of connections (call
@@ -62,10 +62,10 @@
}
void TearDown() override {
- PostMethodToIOThreadAndWait(
- FROM_HERE, &EndpointRelayerTest::ShutdownChannelOnIOThread, 0);
- PostMethodToIOThreadAndWait(
- FROM_HERE, &EndpointRelayerTest::ShutdownChannelOnIOThread, 1);
+ PostMethodToIOThreadAndWait(&EndpointRelayerTest::ShutdownChannelOnIOThread,
+ 0);
+ PostMethodToIOThreadAndWait(&EndpointRelayerTest::ShutdownChannelOnIOThread,
+ 1);
test::ChannelTestBase::TearDown();
}
diff --git a/mojo/edk/system/ipc_support_unittest.cc b/mojo/edk/system/ipc_support_unittest.cc
index f3bbcf8..2fb3418 100644
--- a/mojo/edk/system/ipc_support_unittest.cc
+++ b/mojo/edk/system/ipc_support_unittest.cc
@@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/command_line.h"
-#include "base/location.h"
#include "base/logging.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/test_timeouts.h"
@@ -196,7 +195,6 @@
WaitForChannelToSlave();
test_io_thread_->PostTaskAndWait(
- FROM_HERE,
base::Bind(&ChannelManager::ShutdownChannelOnIOThread,
base::Unretained(master_ipc_support_->channel_manager()),
slave_id_));
@@ -262,7 +260,6 @@
WaitForChannelToMaster();
test_io_thread_->PostTaskAndWait(
- FROM_HERE,
base::Bind(&ChannelManager::ShutdownChannelOnIOThread,
base::Unretained(slave_ipc_support_.channel_manager()),
kMasterProcessIdentifier));
@@ -271,8 +268,8 @@
// No other methods may be called after this.
void ShutdownIPCSupport() {
test_io_thread_->PostTaskAndWait(
- FROM_HERE, base::Bind(&IPCSupport::ShutdownOnIOThread,
- base::Unretained(&slave_ipc_support_)));
+ base::Bind(&IPCSupport::ShutdownOnIOThread,
+ base::Unretained(&slave_ipc_support_)));
}
private:
@@ -390,8 +387,8 @@
void ShutdownMasterIPCSupport() {
test_io_thread_.PostTaskAndWait(
- FROM_HERE, base::Bind(&IPCSupport::ShutdownOnIOThread,
- base::Unretained(&master_ipc_support_)));
+ base::Bind(&IPCSupport::ShutdownOnIOThread,
+ base::Unretained(&master_ipc_support_)));
}
embedder::SimplePlatformSupport& platform_support() {
@@ -617,9 +614,8 @@
EXPECT_EQ(1u, n);
EXPECT_EQ('x', c);
- test_io_thread().PostTaskAndWait(
- FROM_HERE, base::Bind(&IPCSupport::ShutdownOnIOThread,
- base::Unretained(&slave_ipc_support)));
+ test_io_thread().PostTaskAndWait(base::Bind(
+ &IPCSupport::ShutdownOnIOThread, base::Unretained(&slave_ipc_support)));
EXPECT_TRUE(master_process_delegate().TryWaitForOnSlaveDisconnect());
@@ -712,8 +708,7 @@
mojo::test::BlockingWrite(second_platform_handle.get(), "!", 1, &n));
EXPECT_EQ(1u, n);
- test_io_thread.PostTaskAndWait(FROM_HERE,
- base::Bind(&IPCSupport::ShutdownOnIOThread,
+ test_io_thread.PostTaskAndWait(base::Bind(&IPCSupport::ShutdownOnIOThread,
base::Unretained(&ipc_support)));
}
diff --git a/mojo/edk/system/message_pipe_test_utils.cc b/mojo/edk/system/message_pipe_test_utils.cc
index f0d9495..18bdf5d 100644
--- a/mojo/edk/system/message_pipe_test_utils.cc
+++ b/mojo/edk/system/message_pipe_test_utils.cc
@@ -47,7 +47,6 @@
RefPtr<ChannelEndpoint>&& channel_endpoint) {
test_io_thread_.Start();
test_io_thread_.PostTaskAndWait(
- FROM_HERE,
base::Bind(&ChannelThread::InitChannelOnIOThread, base::Unretained(this),
base::Passed(&platform_handle),
base::Passed(&channel_endpoint)));
@@ -61,9 +60,8 @@
while (!channel_->IsWriteBufferEmpty())
test::Sleep(test::DeadlineFromMilliseconds(20));
- test_io_thread_.PostTaskAndWait(
- FROM_HERE, base::Bind(&ChannelThread::ShutdownChannelOnIOThread,
- base::Unretained(this)));
+ test_io_thread_.PostTaskAndWait(base::Bind(
+ &ChannelThread::ShutdownChannelOnIOThread, base::Unretained(this)));
}
test_io_thread_.Stop();
}
diff --git a/mojo/edk/system/raw_channel_unittest.cc b/mojo/edk/system/raw_channel_unittest.cc
index 743659b..53e8688 100644
--- a/mojo/edk/system/raw_channel_unittest.cc
+++ b/mojo/edk/system/raw_channel_unittest.cc
@@ -12,7 +12,6 @@
#include <vector>
#include "base/bind.h"
-#include "base/location.h"
#include "base/logging.h"
#include "base/synchronization/waitable_event.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
@@ -194,7 +193,6 @@
std::unique_ptr<RawChannel> rc(RawChannel::Create(handles[0].Pass()));
TestMessageReaderAndChecker checker(handles[1].get());
io_thread()->PostTaskAndWait(
- FROM_HERE,
base::Bind(&InitOnIOThread, rc.get(), base::Unretained(&delegate)));
// Write and read, for a variety of sizes.
@@ -210,7 +208,7 @@
EXPECT_TRUE(checker.ReadAndCheckNextMessage(size)) << size;
io_thread()->PostTaskAndWait(
- FROM_HERE, base::Bind(&RawChannel::Shutdown, base::Unretained(rc.get())));
+ base::Bind(&RawChannel::Shutdown, base::Unretained(rc.get())));
}
// RawChannelTest.OnReadMessage ------------------------------------------------
@@ -279,7 +277,6 @@
ReadCheckerRawChannelDelegate delegate;
std::unique_ptr<RawChannel> rc(RawChannel::Create(handles[0].Pass()));
io_thread()->PostTaskAndWait(
- FROM_HERE,
base::Bind(&InitOnIOThread, rc.get(), base::Unretained(&delegate)));
// Write and read, for a variety of sizes.
@@ -302,7 +299,7 @@
delegate.Wait();
io_thread()->PostTaskAndWait(
- FROM_HERE, base::Bind(&RawChannel::Shutdown, base::Unretained(rc.get())));
+ base::Bind(&RawChannel::Shutdown, base::Unretained(rc.get())));
}
// RawChannelTest.WriteMessageAndOnReadMessage ---------------------------------
@@ -373,15 +370,13 @@
WriteOnlyRawChannelDelegate writer_delegate;
std::unique_ptr<RawChannel> writer_rc(RawChannel::Create(handles[0].Pass()));
- io_thread()->PostTaskAndWait(FROM_HERE,
- base::Bind(&InitOnIOThread, writer_rc.get(),
+ io_thread()->PostTaskAndWait(base::Bind(&InitOnIOThread, writer_rc.get(),
base::Unretained(&writer_delegate)));
ReadCountdownRawChannelDelegate reader_delegate(kNumWriterThreads *
kNumWriteMessagesPerThread);
std::unique_ptr<RawChannel> reader_rc(RawChannel::Create(handles[1].Pass()));
- io_thread()->PostTaskAndWait(FROM_HERE,
- base::Bind(&InitOnIOThread, reader_rc.get(),
+ io_thread()->PostTaskAndWait(base::Bind(&InitOnIOThread, reader_rc.get(),
base::Unretained(&reader_delegate)));
{
@@ -402,11 +397,9 @@
reader_delegate.Wait();
io_thread()->PostTaskAndWait(
- FROM_HERE,
base::Bind(&RawChannel::Shutdown, base::Unretained(reader_rc.get())));
io_thread()->PostTaskAndWait(
- FROM_HERE,
base::Bind(&RawChannel::Shutdown, base::Unretained(writer_rc.get())));
}
@@ -471,7 +464,6 @@
ErrorRecordingRawChannelDelegate delegate(0, true, true);
std::unique_ptr<RawChannel> rc(RawChannel::Create(handles[0].Pass()));
io_thread()->PostTaskAndWait(
- FROM_HERE,
base::Bind(&InitOnIOThread, rc.get(), base::Unretained(&delegate)));
// Close the handle of the other end, which should make writing fail.
@@ -492,7 +484,7 @@
test::Sleep(test::DeadlineFromMilliseconds(20));
io_thread()->PostTaskAndWait(
- FROM_HERE, base::Bind(&RawChannel::Shutdown, base::Unretained(rc.get())));
+ base::Bind(&RawChannel::Shutdown, base::Unretained(rc.get())));
}
// RawChannelTest.ReadUnaffectedByWriteError -----------------------------------
@@ -514,7 +506,6 @@
ErrorRecordingRawChannelDelegate delegate(kMessageCount, true, true);
std::unique_ptr<RawChannel> rc(RawChannel::Create(handles[0].Pass()));
io_thread()->PostTaskAndWait(
- FROM_HERE,
base::Bind(&InitOnIOThread, rc.get(), base::Unretained(&delegate)));
EXPECT_FALSE(rc->WriteMessage(MakeTestMessage(1)));
@@ -529,7 +520,7 @@
delegate.WaitForReadError();
io_thread()->PostTaskAndWait(
- FROM_HERE, base::Bind(&RawChannel::Shutdown, base::Unretained(rc.get())));
+ base::Bind(&RawChannel::Shutdown, base::Unretained(rc.get())));
}
// RawChannelTest.WriteMessageAfterShutdown ------------------------------------
@@ -540,10 +531,9 @@
WriteOnlyRawChannelDelegate delegate;
std::unique_ptr<RawChannel> rc(RawChannel::Create(handles[0].Pass()));
io_thread()->PostTaskAndWait(
- FROM_HERE,
base::Bind(&InitOnIOThread, rc.get(), base::Unretained(&delegate)));
io_thread()->PostTaskAndWait(
- FROM_HERE, base::Bind(&RawChannel::Shutdown, base::Unretained(rc.get())));
+ base::Bind(&RawChannel::Shutdown, base::Unretained(rc.get())));
EXPECT_FALSE(rc->WriteMessage(MakeTestMessage(1)));
}
@@ -601,7 +591,6 @@
std::unique_ptr<RawChannel> rc(RawChannel::Create(handles[0].Pass()));
ShutdownOnReadMessageRawChannelDelegate delegate(rc.get(), false);
io_thread()->PostTaskAndWait(
- FROM_HERE,
base::Bind(&InitOnIOThread, rc.get(), base::Unretained(&delegate)));
// Wait for the delegate, which will shut the |RawChannel| down.
@@ -616,7 +605,7 @@
RawChannel* rc = RawChannel::Create(handles[0].Pass()).release();
ShutdownOnReadMessageRawChannelDelegate delegate(rc, true);
io_thread()->PostTaskAndWait(
- FROM_HERE, base::Bind(&InitOnIOThread, rc, base::Unretained(&delegate)));
+ base::Bind(&InitOnIOThread, rc, base::Unretained(&delegate)));
// Wait for the delegate, which will shut the |RawChannel| down.
delegate.Wait();
@@ -674,7 +663,6 @@
ShutdownOnErrorRawChannelDelegate delegate(
rc.get(), false, RawChannel::Delegate::ERROR_READ_SHUTDOWN);
io_thread()->PostTaskAndWait(
- FROM_HERE,
base::Bind(&InitOnIOThread, rc.get(), base::Unretained(&delegate)));
// Close the handle of the other end, which should stuff fail.
@@ -689,7 +677,7 @@
ShutdownOnErrorRawChannelDelegate delegate(
rc, true, RawChannel::Delegate::ERROR_READ_SHUTDOWN);
io_thread()->PostTaskAndWait(
- FROM_HERE, base::Bind(&InitOnIOThread, rc, base::Unretained(&delegate)));
+ base::Bind(&InitOnIOThread, rc, base::Unretained(&delegate)));
// Close the handle of the other end, which should stuff fail.
handles[1].reset();
@@ -703,7 +691,6 @@
ShutdownOnErrorRawChannelDelegate delegate(rc.get(), false,
RawChannel::Delegate::ERROR_WRITE);
io_thread()->PostTaskAndWait(
- FROM_HERE,
base::Bind(&InitOnIOThread, rc.get(), base::Unretained(&delegate)));
// Close the handle of the other end, which should stuff fail.
@@ -720,7 +707,7 @@
ShutdownOnErrorRawChannelDelegate delegate(rc, true,
RawChannel::Delegate::ERROR_WRITE);
io_thread()->PostTaskAndWait(
- FROM_HERE, base::Bind(&InitOnIOThread, rc, base::Unretained(&delegate)));
+ base::Bind(&InitOnIOThread, rc, base::Unretained(&delegate)));
// Close the handle of the other end, which should stuff fail.
handles[1].reset();
@@ -795,14 +782,12 @@
WriteOnlyRawChannelDelegate write_delegate;
std::unique_ptr<RawChannel> rc_write(RawChannel::Create(handles[0].Pass()));
- io_thread()->PostTaskAndWait(FROM_HERE,
- base::Bind(&InitOnIOThread, rc_write.get(),
+ io_thread()->PostTaskAndWait(base::Bind(&InitOnIOThread, rc_write.get(),
base::Unretained(&write_delegate)));
ReadPlatformHandlesCheckerRawChannelDelegate read_delegate;
std::unique_ptr<RawChannel> rc_read(RawChannel::Create(handles[1].Pass()));
- io_thread()->PostTaskAndWait(FROM_HERE,
- base::Bind(&InitOnIOThread, rc_read.get(),
+ io_thread()->PostTaskAndWait(base::Bind(&InitOnIOThread, rc_read.get(),
base::Unretained(&read_delegate)));
util::ScopedFILE fp1(test_dir.CreateFile());
@@ -832,10 +817,8 @@
read_delegate.Wait();
io_thread()->PostTaskAndWait(
- FROM_HERE,
base::Bind(&RawChannel::Shutdown, base::Unretained(rc_read.get())));
io_thread()->PostTaskAndWait(
- FROM_HERE,
base::Bind(&RawChannel::Shutdown, base::Unretained(rc_write.get())));
}
diff --git a/mojo/edk/system/remote_data_pipe_impl_unittest.cc b/mojo/edk/system/remote_data_pipe_impl_unittest.cc
index a94ce49..60ceb45 100644
--- a/mojo/edk/system/remote_data_pipe_impl_unittest.cc
+++ b/mojo/edk/system/remote_data_pipe_impl_unittest.cc
@@ -10,7 +10,6 @@
#include <utility>
#include "base/bind.h"
-#include "base/location.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
@@ -49,18 +48,16 @@
message_pipes_[0] = MessagePipe::CreateLocalProxy(&ep[0]);
message_pipes_[1] = MessagePipe::CreateLocalProxy(&ep[1]);
- io_thread_.PostTaskAndWait(
- FROM_HERE, base::Bind(&RemoteDataPipeImplTest::SetUpOnIOThread,
- base::Unretained(this), base::Passed(&ep[0]),
- base::Passed(&ep[1])));
+ io_thread_.PostTaskAndWait(base::Bind(
+ &RemoteDataPipeImplTest::SetUpOnIOThread, base::Unretained(this),
+ base::Passed(&ep[0]), base::Passed(&ep[1])));
}
void TearDown() override {
EnsureMessagePipeClosed(0);
EnsureMessagePipeClosed(1);
- io_thread_.PostTaskAndWait(
- FROM_HERE, base::Bind(&RemoteDataPipeImplTest::TearDownOnIOThread,
- base::Unretained(this)));
+ io_thread_.PostTaskAndWait(base::Bind(
+ &RemoteDataPipeImplTest::TearDownOnIOThread, base::Unretained(this)));
}
protected:
diff --git a/mojo/edk/system/remote_message_pipe_unittest.cc b/mojo/edk/system/remote_message_pipe_unittest.cc
index b7917cb..32043ff 100644
--- a/mojo/edk/system/remote_message_pipe_unittest.cc
+++ b/mojo/edk/system/remote_message_pipe_unittest.cc
@@ -11,7 +11,6 @@
#include <vector>
#include "base/bind.h"
-#include "base/location.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
@@ -52,15 +51,13 @@
~RemoteMessagePipeTest() override {}
void SetUp() override {
- io_thread_.PostTaskAndWait(
- FROM_HERE, base::Bind(&RemoteMessagePipeTest::SetUpOnIOThread,
- base::Unretained(this)));
+ io_thread_.PostTaskAndWait(base::Bind(
+ &RemoteMessagePipeTest::SetUpOnIOThread, base::Unretained(this)));
}
void TearDown() override {
- io_thread_.PostTaskAndWait(
- FROM_HERE, base::Bind(&RemoteMessagePipeTest::TearDownOnIOThread,
- base::Unretained(this)));
+ io_thread_.PostTaskAndWait(base::Bind(
+ &RemoteMessagePipeTest::TearDownOnIOThread, base::Unretained(this)));
}
protected:
@@ -70,7 +67,6 @@
void BootstrapChannelEndpoints(RefPtr<ChannelEndpoint>&& ep0,
RefPtr<ChannelEndpoint>&& ep1) {
io_thread_.PostTaskAndWait(
- FROM_HERE,
base::Bind(&RemoteMessagePipeTest::BootstrapChannelEndpointsOnIOThread,
base::Unretained(this), base::Passed(ep0),
base::Passed(ep1)));
@@ -82,14 +78,12 @@
void BootstrapChannelEndpointNoWait(unsigned channel_index,
RefPtr<ChannelEndpoint>&& ep) {
io_thread_.PostTask(
- FROM_HERE,
base::Bind(&RemoteMessagePipeTest::BootstrapChannelEndpointOnIOThread,
base::Unretained(this), channel_index, base::Passed(&ep)));
}
void RestoreInitialState() {
io_thread_.PostTaskAndWait(
- FROM_HERE,
base::Bind(&RemoteMessagePipeTest::RestoreInitialStateOnIOThread,
base::Unretained(this)));
}
@@ -1134,8 +1128,7 @@
BootstrapChannelEndpointNoWait(1, std::move(ep1));
if (i & 1u) {
- io_thread()->task_runner()->PostTask(FROM_HERE,
- base::Bind(&test::Sleep, delay));
+ io_thread()->PostTask(base::Bind(&test::Sleep, delay));
}
if (i & 2u)
test::Sleep(delay);
@@ -1143,8 +1136,7 @@
mp0->Close(0);
if (i & 4u) {
- io_thread()->task_runner()->PostTask(FROM_HERE,
- base::Bind(&test::Sleep, delay));
+ io_thread()->PostTask(base::Bind(&test::Sleep, delay));
}
if (i & 8u)
test::Sleep(delay);
diff --git a/mojo/edk/test/test_io_thread.cc b/mojo/edk/test/test_io_thread.cc
index e7bcac1..b8b4745 100644
--- a/mojo/edk/test/test_io_thread.cc
+++ b/mojo/edk/test/test_io_thread.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "base/location.h"
#include "base/synchronization/waitable_event.h"
namespace mojo {
@@ -50,15 +51,13 @@
io_thread_started_ = false;
}
-void TestIOThread::PostTask(const tracked_objects::Location& from_here,
- const base::Closure& task) {
- task_runner()->PostTask(from_here, task);
+void TestIOThread::PostTask(const base::Closure& task) {
+ task_runner()->PostTask(tracked_objects::Location(), task);
}
-void TestIOThread::PostTaskAndWait(const tracked_objects::Location& from_here,
- const base::Closure& task) {
+void TestIOThread::PostTaskAndWait(const base::Closure& task) {
base::WaitableEvent event(false, false);
- task_runner()->PostTask(from_here,
+ task_runner()->PostTask(tracked_objects::Location(),
base::Bind(&PostTaskAndWaitHelper, &event, task));
event.Wait();
}
diff --git a/mojo/edk/test/test_io_thread.h b/mojo/edk/test/test_io_thread.h
index 0b0f5dd..e85672c 100644
--- a/mojo/edk/test/test_io_thread.h
+++ b/mojo/edk/test/test_io_thread.h
@@ -29,12 +29,10 @@
void Stop();
// Post |task| to the IO thread.
- void PostTask(const tracked_objects::Location& from_here,
- const base::Closure& task);
+ void PostTask(const base::Closure& task);
// Posts |task| to the IO-thread with an WaitableEvent associated blocks on
// it until the posted |task| is executed, then returns.
- void PostTaskAndWait(const tracked_objects::Location& from_here,
- const base::Closure& task);
+ void PostTaskAndWait(const base::Closure& task);
base::MessageLoopForIO* message_loop() {
return static_cast<base::MessageLoopForIO*>(io_thread_.message_loop());