Commit bf85a504 authored by Anand K. Mistry's avatar Anand K. Mistry Committed by Commit Bot

Convert Callback -> {Once,Repeating}Callback in mojo/public/cpp/system

Also convert usages of Bind -> Bind{Once,Repeating}.

Bug: 1007814
Change-Id: Ib242b593fe7b0870bf5953fa5e614aa092aa6a02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1913233Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Commit-Queue: Anand Mistry <amistry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715120}
parent 471e5833
...@@ -20,9 +20,9 @@ DataPipeDrainer::DataPipeDrainer(Client* client, ...@@ -20,9 +20,9 @@ DataPipeDrainer::DataPipeDrainer(Client* client,
SimpleWatcher::ArmingPolicy::AUTOMATIC, SimpleWatcher::ArmingPolicy::AUTOMATIC,
base::SequencedTaskRunnerHandle::Get()) { base::SequencedTaskRunnerHandle::Get()) {
DCHECK(client_); DCHECK(client_);
handle_watcher_.Watch( handle_watcher_.Watch(source_.get(), MOJO_HANDLE_SIGNAL_READABLE,
source_.get(), MOJO_HANDLE_SIGNAL_READABLE, base::BindRepeating(&DataPipeDrainer::WaitComplete,
base::Bind(&DataPipeDrainer::WaitComplete, weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
} }
DataPipeDrainer::~DataPipeDrainer() {} DataPipeDrainer::~DataPipeDrainer() {}
......
...@@ -77,7 +77,7 @@ class DataPipeProducer::SequenceState ...@@ -77,7 +77,7 @@ class DataPipeProducer::SequenceState
base::SequencedTaskRunnerHandle::Get()); base::SequencedTaskRunnerHandle::Get());
watcher_->Watch(producer_handle_.get(), MOJO_HANDLE_SIGNAL_WRITABLE, watcher_->Watch(producer_handle_.get(), MOJO_HANDLE_SIGNAL_WRITABLE,
MOJO_WATCH_CONDITION_SATISFIED, MOJO_WATCH_CONDITION_SATISFIED,
base::Bind(&SequenceState::OnHandleReady, this)); base::BindRepeating(&SequenceState::OnHandleReady, this));
} }
} }
......
...@@ -14,7 +14,7 @@ namespace { ...@@ -14,7 +14,7 @@ namespace {
bool BlockingCopyHelper( bool BlockingCopyHelper(
ScopedDataPipeConsumerHandle source, ScopedDataPipeConsumerHandle source,
const base::Callback<size_t(const void*, uint32_t)>& write_bytes) { base::RepeatingCallback<size_t(const void*, uint32_t)> write_bytes) {
for (;;) { for (;;) {
const void* buffer; const void* buffer;
uint32_t num_bytes; uint32_t num_bytes;
...@@ -58,7 +58,7 @@ bool BlockingCopyToString(ScopedDataPipeConsumerHandle source, ...@@ -58,7 +58,7 @@ bool BlockingCopyToString(ScopedDataPipeConsumerHandle source,
CHECK(result); CHECK(result);
result->clear(); result->clear();
return BlockingCopyHelper(std::move(source), return BlockingCopyHelper(std::move(source),
base::Bind(&CopyToStringHelper, result)); base::BindRepeating(&CopyToStringHelper, result));
} }
bool MOJO_CPP_SYSTEM_EXPORT bool MOJO_CPP_SYSTEM_EXPORT
......
...@@ -22,12 +22,14 @@ HandleSignalTracker::HandleSignalTracker( ...@@ -22,12 +22,14 @@ HandleSignalTracker::HandleSignalTracker(
std::move(task_runner)) { std::move(task_runner)) {
MojoResult rv = high_watcher_.Watch( MojoResult rv = high_watcher_.Watch(
handle, signals, MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED, handle, signals, MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED,
base::Bind(&HandleSignalTracker::OnNotify, base::Unretained(this))); base::BindRepeating(&HandleSignalTracker::OnNotify,
base::Unretained(this)));
DCHECK_EQ(MOJO_RESULT_OK, rv); DCHECK_EQ(MOJO_RESULT_OK, rv);
rv = low_watcher_.Watch( rv = low_watcher_.Watch(handle, signals,
handle, signals, MOJO_TRIGGER_CONDITION_SIGNALS_UNSATISFIED, MOJO_TRIGGER_CONDITION_SIGNALS_UNSATISFIED,
base::Bind(&HandleSignalTracker::OnNotify, base::Unretained(this))); base::BindRepeating(&HandleSignalTracker::OnNotify,
base::Unretained(this)));
DCHECK_EQ(MOJO_RESULT_OK, rv); DCHECK_EQ(MOJO_RESULT_OK, rv);
last_known_state_ = handle.QuerySignalsState(); last_known_state_ = handle.QuerySignalsState();
......
...@@ -29,7 +29,7 @@ namespace mojo { ...@@ -29,7 +29,7 @@ namespace mojo {
class MOJO_CPP_SYSTEM_EXPORT HandleSignalTracker { class MOJO_CPP_SYSTEM_EXPORT HandleSignalTracker {
public: public:
using NotificationCallback = using NotificationCallback =
base::Callback<void(const HandleSignalsState& signals_state)>; base::RepeatingCallback<void(const HandleSignalsState& signals_state)>;
// Constructs a tracker which tracks |signals| on |handle|. |signals| may // Constructs a tracker which tracks |signals| on |handle|. |signals| may
// be any single signal flag or any combination of signal flags. // be any single signal flag or any combination of signal flags.
...@@ -45,8 +45,8 @@ class MOJO_CPP_SYSTEM_EXPORT HandleSignalTracker { ...@@ -45,8 +45,8 @@ class MOJO_CPP_SYSTEM_EXPORT HandleSignalTracker {
// Sets an optional callback to be invoked any time the tracker is notified of // Sets an optional callback to be invoked any time the tracker is notified of
// a relevant state change. // a relevant state change.
void set_notification_callback(const NotificationCallback& callback) { void set_notification_callback(NotificationCallback callback) {
notification_callback_ = callback; notification_callback_ = std::move(callback);
} }
private: private:
......
...@@ -161,12 +161,12 @@ bool SimpleWatcher::IsWatching() const { ...@@ -161,12 +161,12 @@ bool SimpleWatcher::IsWatching() const {
MojoResult SimpleWatcher::Watch(Handle handle, MojoResult SimpleWatcher::Watch(Handle handle,
MojoHandleSignals signals, MojoHandleSignals signals,
MojoTriggerCondition condition, MojoTriggerCondition condition,
const ReadyCallbackWithState& callback) { ReadyCallbackWithState callback) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!IsWatching()); DCHECK(!IsWatching());
DCHECK(!callback.is_null()); DCHECK(!callback.is_null());
callback_ = callback; callback_ = std::move(callback);
handle_ = handle; handle_ = handle;
watch_id_ += 1; watch_id_ += 1;
......
...@@ -120,7 +120,7 @@ class MOJO_CPP_SYSTEM_EXPORT SimpleWatcher { ...@@ -120,7 +120,7 @@ class MOJO_CPP_SYSTEM_EXPORT SimpleWatcher {
MojoResult Watch(Handle handle, MojoResult Watch(Handle handle,
MojoHandleSignals signals, MojoHandleSignals signals,
MojoTriggerCondition condition, MojoTriggerCondition condition,
const ReadyCallbackWithState& callback); ReadyCallbackWithState callback);
// DEPRECATED: Please use the above signature instead. // DEPRECATED: Please use the above signature instead.
// //
...@@ -129,9 +129,9 @@ class MOJO_CPP_SYSTEM_EXPORT SimpleWatcher { ...@@ -129,9 +129,9 @@ class MOJO_CPP_SYSTEM_EXPORT SimpleWatcher {
// a notification. // a notification.
MojoResult Watch(Handle handle, MojoResult Watch(Handle handle,
MojoHandleSignals signals, MojoHandleSignals signals,
const ReadyCallback& callback) { ReadyCallback callback) {
return Watch(handle, signals, MOJO_WATCH_CONDITION_SATISFIED, return Watch(handle, signals, MOJO_WATCH_CONDITION_SATISFIED,
base::Bind(&DiscardReadyState, callback)); base::BindRepeating(&DiscardReadyState, std::move(callback)));
} }
// Cancels the current watch. Once this returns, the ReadyCallback previously // Cancels the current watch. Once this returns, the ReadyCallback previously
......
...@@ -40,10 +40,10 @@ class DataPipeReader { ...@@ -40,10 +40,10 @@ class DataPipeReader {
watcher_(FROM_HERE, watcher_(FROM_HERE,
SimpleWatcher::ArmingPolicy::AUTOMATIC, SimpleWatcher::ArmingPolicy::AUTOMATIC,
base::SequencedTaskRunnerHandle::Get()) { base::SequencedTaskRunnerHandle::Get()) {
watcher_.Watch( watcher_.Watch(consumer_handle_.get(), MOJO_HANDLE_SIGNAL_READABLE,
consumer_handle_.get(), MOJO_HANDLE_SIGNAL_READABLE, MOJO_WATCH_CONDITION_SATISFIED,
MOJO_WATCH_CONDITION_SATISFIED, base::BindRepeating(&DataPipeReader::OnDataAvailable,
base::Bind(&DataPipeReader::OnDataAvailable, base::Unretained(this))); base::Unretained(this)));
} }
~DataPipeReader() = default; ~DataPipeReader() = default;
......
...@@ -22,7 +22,7 @@ class HandleSignalTrackerTest : public testing::Test { ...@@ -22,7 +22,7 @@ class HandleSignalTrackerTest : public testing::Test {
void WaitForNextNotification(HandleSignalTracker* tracker) { void WaitForNextNotification(HandleSignalTracker* tracker) {
base::RunLoop loop; base::RunLoop loop;
tracker->set_notification_callback(base::Bind( tracker->set_notification_callback(base::BindRepeating(
[](base::RunLoop* loop, const HandleSignalsState& signals_state) { [](base::RunLoop* loop, const HandleSignalsState& signals_state) {
loop->Quit(); loop->Quit();
}, },
......
...@@ -27,7 +27,7 @@ void RunResultHandler(Handler f, MojoResult result) { ...@@ -27,7 +27,7 @@ void RunResultHandler(Handler f, MojoResult result) {
template <typename Handler> template <typename Handler>
SimpleWatcher::ReadyCallback OnReady(Handler f) { SimpleWatcher::ReadyCallback OnReady(Handler f) {
return base::Bind(&RunResultHandler<Handler>, f); return base::BindRepeating(&RunResultHandler<Handler>, f);
} }
SimpleWatcher::ReadyCallback NotReached() { SimpleWatcher::ReadyCallback NotReached() {
...@@ -229,7 +229,7 @@ TEST_F(SimpleWatcherTest, UnarmedCancel) { ...@@ -229,7 +229,7 @@ TEST_F(SimpleWatcherTest, UnarmedCancel) {
base::RunLoop loop; base::RunLoop loop;
EXPECT_EQ(MOJO_RESULT_OK, EXPECT_EQ(MOJO_RESULT_OK,
b_watcher.Watch(b.get(), MOJO_HANDLE_SIGNAL_READABLE, b_watcher.Watch(b.get(), MOJO_HANDLE_SIGNAL_READABLE,
base::Bind( base::BindRepeating(
[](base::RunLoop* loop, MojoResult result) { [](base::RunLoop* loop, MojoResult result) {
EXPECT_EQ(result, MOJO_RESULT_CANCELLED); EXPECT_EQ(result, MOJO_RESULT_CANCELLED);
loop->Quit(); loop->Quit();
...@@ -253,7 +253,7 @@ TEST_F(SimpleWatcherTest, ManualArming) { ...@@ -253,7 +253,7 @@ TEST_F(SimpleWatcherTest, ManualArming) {
base::RunLoop loop; base::RunLoop loop;
EXPECT_EQ(MOJO_RESULT_OK, EXPECT_EQ(MOJO_RESULT_OK,
b_watcher.Watch(b.get(), MOJO_HANDLE_SIGNAL_READABLE, b_watcher.Watch(b.get(), MOJO_HANDLE_SIGNAL_READABLE,
base::Bind( base::BindRepeating(
[](base::RunLoop* loop, MojoResult result) { [](base::RunLoop* loop, MojoResult result) {
EXPECT_EQ(result, MOJO_RESULT_OK); EXPECT_EQ(result, MOJO_RESULT_OK);
loop->Quit(); loop->Quit();
...@@ -276,7 +276,7 @@ TEST_F(SimpleWatcherTest, ManualArmOrNotifyWhileSignaled) { ...@@ -276,7 +276,7 @@ TEST_F(SimpleWatcherTest, ManualArmOrNotifyWhileSignaled) {
EXPECT_EQ(MOJO_RESULT_OK, EXPECT_EQ(MOJO_RESULT_OK,
b_watcher1.Watch( b_watcher1.Watch(
b.get(), MOJO_HANDLE_SIGNAL_READABLE, b.get(), MOJO_HANDLE_SIGNAL_READABLE,
base::Bind( base::BindRepeating(
[](base::RunLoop* loop, bool* notified, MojoResult result) { [](base::RunLoop* loop, bool* notified, MojoResult result) {
EXPECT_EQ(result, MOJO_RESULT_OK); EXPECT_EQ(result, MOJO_RESULT_OK);
*notified = true; *notified = true;
...@@ -290,7 +290,7 @@ TEST_F(SimpleWatcherTest, ManualArmOrNotifyWhileSignaled) { ...@@ -290,7 +290,7 @@ TEST_F(SimpleWatcherTest, ManualArmOrNotifyWhileSignaled) {
EXPECT_EQ(MOJO_RESULT_OK, EXPECT_EQ(MOJO_RESULT_OK,
b_watcher2.Watch( b_watcher2.Watch(
b.get(), MOJO_HANDLE_SIGNAL_READABLE, b.get(), MOJO_HANDLE_SIGNAL_READABLE,
base::Bind( base::BindRepeating(
[](base::RunLoop* loop, bool* notified, MojoResult result) { [](base::RunLoop* loop, bool* notified, MojoResult result) {
EXPECT_EQ(result, MOJO_RESULT_OK); EXPECT_EQ(result, MOJO_RESULT_OK);
*notified = true; *notified = true;
......
...@@ -34,10 +34,10 @@ class DataPipeReader { ...@@ -34,10 +34,10 @@ class DataPipeReader {
watcher_(FROM_HERE, watcher_(FROM_HERE,
SimpleWatcher::ArmingPolicy::AUTOMATIC, SimpleWatcher::ArmingPolicy::AUTOMATIC,
base::SequencedTaskRunnerHandle::Get()) { base::SequencedTaskRunnerHandle::Get()) {
watcher_.Watch( watcher_.Watch(consumer_handle_.get(), MOJO_HANDLE_SIGNAL_READABLE,
consumer_handle_.get(), MOJO_HANDLE_SIGNAL_READABLE, MOJO_WATCH_CONDITION_SATISFIED,
MOJO_WATCH_CONDITION_SATISFIED, base::BindRepeating(&DataPipeReader::OnDataAvailable,
base::Bind(&DataPipeReader::OnDataAvailable, base::Unretained(this))); base::Unretained(this)));
} }
~DataPipeReader() = default; ~DataPipeReader() = default;
......
...@@ -40,14 +40,14 @@ std::string ReadMessage(const ScopedMessagePipeHandle& handle) { ...@@ -40,14 +40,14 @@ std::string ReadMessage(const ScopedMessagePipeHandle& handle) {
class ThreadedRunner : public base::SimpleThread { class ThreadedRunner : public base::SimpleThread {
public: public:
explicit ThreadedRunner(const base::Closure& callback) explicit ThreadedRunner(base::OnceClosure callback)
: SimpleThread("ThreadedRunner"), callback_(callback) {} : SimpleThread("ThreadedRunner"), callback_(std::move(callback)) {}
~ThreadedRunner() override { Join(); } ~ThreadedRunner() override { Join(); }
void Run() override { callback_.Run(); } void Run() override { std::move(callback_).Run(); }
private: private:
const base::Closure callback_; base::OnceClosure callback_;
DISALLOW_COPY_AND_ASSIGN(ThreadedRunner); DISALLOW_COPY_AND_ASSIGN(ThreadedRunner);
}; };
...@@ -162,7 +162,7 @@ TEST_F(WaitSetTest, CloseWhileWaiting) { ...@@ -162,7 +162,7 @@ TEST_F(WaitSetTest, CloseWhileWaiting) {
wait_set.AddHandle(p.handle0.get(), MOJO_HANDLE_SIGNAL_READABLE); wait_set.AddHandle(p.handle0.get(), MOJO_HANDLE_SIGNAL_READABLE);
const Handle handle0_value = p.handle0.get(); const Handle handle0_value = p.handle0.get();
ThreadedRunner close_after_delay(base::Bind( ThreadedRunner close_after_delay(base::BindOnce(
[](ScopedMessagePipeHandle* handle) { [](ScopedMessagePipeHandle* handle) {
// Wait a little while, then close the handle. // Wait a little while, then close the handle.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200)); base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200));
...@@ -239,7 +239,7 @@ TEST_F(WaitSetTest, SatisfiedThenUnsatisfied) { ...@@ -239,7 +239,7 @@ TEST_F(WaitSetTest, SatisfiedThenUnsatisfied) {
EXPECT_EQ(kTestMessage1, ReadMessage(p.handle1)); EXPECT_EQ(kTestMessage1, ReadMessage(p.handle1));
ThreadedRunner write_after_delay(base::Bind( ThreadedRunner write_after_delay(base::BindOnce(
[](ScopedMessagePipeHandle* handle) { [](ScopedMessagePipeHandle* handle) {
// Wait a little while, then write a message. // Wait a little while, then write a message.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200)); base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200));
...@@ -295,7 +295,7 @@ TEST_F(WaitSetTest, EventAndHandle) { ...@@ -295,7 +295,7 @@ TEST_F(WaitSetTest, EventAndHandle) {
EXPECT_EQ(kTestMessage, ReadMessage(p.handle1)); EXPECT_EQ(kTestMessage, ReadMessage(p.handle1));
ThreadedRunner signal_after_delay(base::Bind( ThreadedRunner signal_after_delay(base::BindOnce(
[](base::WaitableEvent* event) { [](base::WaitableEvent* event) {
// Wait a little while, then close the handle. // Wait a little while, then close the handle.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200)); base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200));
......
...@@ -42,14 +42,14 @@ std::string ReadMessage(const ScopedMessagePipeHandle& handle) { ...@@ -42,14 +42,14 @@ std::string ReadMessage(const ScopedMessagePipeHandle& handle) {
class ThreadedRunner : public base::SimpleThread { class ThreadedRunner : public base::SimpleThread {
public: public:
explicit ThreadedRunner(const base::Closure& callback) explicit ThreadedRunner(base::OnceClosure callback)
: SimpleThread("ThreadedRunner"), callback_(callback) {} : SimpleThread("ThreadedRunner"), callback_(std::move(callback)) {}
~ThreadedRunner() override { Join(); } ~ThreadedRunner() override { Join(); }
void Run() override { callback_.Run(); } void Run() override { std::move(callback_).Run(); }
private: private:
const base::Closure callback_; base::OnceClosure callback_;
DISALLOW_COPY_AND_ASSIGN(ThreadedRunner); DISALLOW_COPY_AND_ASSIGN(ThreadedRunner);
}; };
...@@ -125,7 +125,7 @@ TEST_F(WaitTest, Basic) { ...@@ -125,7 +125,7 @@ TEST_F(WaitTest, Basic) {
TEST_F(WaitTest, DelayedWrite) { TEST_F(WaitTest, DelayedWrite) {
MessagePipe p; MessagePipe p;
ThreadedRunner write_after_delay(base::Bind( ThreadedRunner write_after_delay(base::BindOnce(
[](ScopedMessagePipeHandle* handle) { [](ScopedMessagePipeHandle* handle) {
// Wait a little while, then write a message. // Wait a little while, then write a message.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200)); base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200));
...@@ -145,7 +145,7 @@ TEST_F(WaitTest, DelayedWrite) { ...@@ -145,7 +145,7 @@ TEST_F(WaitTest, DelayedWrite) {
TEST_F(WaitTest, DelayedPeerClosure) { TEST_F(WaitTest, DelayedPeerClosure) {
MessagePipe p; MessagePipe p;
ThreadedRunner close_after_delay(base::Bind( ThreadedRunner close_after_delay(base::BindOnce(
[](ScopedMessagePipeHandle* handle) { [](ScopedMessagePipeHandle* handle) {
// Wait a little while, then close the handle. // Wait a little while, then close the handle.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200)); base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200));
...@@ -164,7 +164,7 @@ TEST_F(WaitTest, DelayedPeerClosure) { ...@@ -164,7 +164,7 @@ TEST_F(WaitTest, DelayedPeerClosure) {
TEST_F(WaitTest, CloseWhileWaiting) { TEST_F(WaitTest, CloseWhileWaiting) {
MessagePipe p; MessagePipe p;
ThreadedRunner close_after_delay(base::Bind( ThreadedRunner close_after_delay(base::BindOnce(
[](ScopedMessagePipeHandle* handle) { [](ScopedMessagePipeHandle* handle) {
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200)); base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200));
handle->reset(); handle->reset();
...@@ -234,7 +234,7 @@ TEST_F(WaitManyTest, CloseWhileWaiting) { ...@@ -234,7 +234,7 @@ TEST_F(WaitManyTest, CloseWhileWaiting) {
MOJO_HANDLE_SIGNAL_READABLE, MOJO_HANDLE_SIGNAL_READABLE,
MOJO_HANDLE_SIGNAL_READABLE}; MOJO_HANDLE_SIGNAL_READABLE};
ThreadedRunner close_after_delay(base::Bind( ThreadedRunner close_after_delay(base::BindOnce(
[](ScopedMessagePipeHandle* handle) { [](ScopedMessagePipeHandle* handle) {
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200)); base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200));
handle->reset(); handle->reset();
...@@ -251,7 +251,7 @@ TEST_F(WaitManyTest, CloseWhileWaiting) { ...@@ -251,7 +251,7 @@ TEST_F(WaitManyTest, CloseWhileWaiting) {
TEST_F(WaitManyTest, DelayedWrite) { TEST_F(WaitManyTest, DelayedWrite) {
MessagePipe p; MessagePipe p;
ThreadedRunner write_after_delay(base::Bind( ThreadedRunner write_after_delay(base::BindOnce(
[](ScopedMessagePipeHandle* handle) { [](ScopedMessagePipeHandle* handle) {
// Wait a little while, then write a message. // Wait a little while, then write a message.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200)); base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200));
...@@ -278,7 +278,7 @@ TEST_F(WaitManyTest, DelayedWrite) { ...@@ -278,7 +278,7 @@ TEST_F(WaitManyTest, DelayedWrite) {
TEST_F(WaitManyTest, DelayedPeerClosure) { TEST_F(WaitManyTest, DelayedPeerClosure) {
MessagePipe p, q; MessagePipe p, q;
ThreadedRunner close_after_delay(base::Bind( ThreadedRunner close_after_delay(base::BindOnce(
[](ScopedMessagePipeHandle* handle) { [](ScopedMessagePipeHandle* handle) {
// Wait a little while, then close the handle. // Wait a little while, then close the handle.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200)); base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200));
......
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