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

Unified Diff: mojo/edk/system/slave_connection_manager.cc

Issue 1496663002: EDK: Make mojo::platform::TaskRunner's PostTask() take an std::function<void()>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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 | « mojo/edk/system/remote_message_pipe_unittest.cc ('k') | mojo/edk/system/test/test_io_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/slave_connection_manager.cc
diff --git a/mojo/edk/system/slave_connection_manager.cc b/mojo/edk/system/slave_connection_manager.cc
index 2f842f4d9e377e22664e18e424f92bb8524f80fa..c147dca8be1904223b9b16f1e82ec0ffec0e8f9d 100644
--- a/mojo/edk/system/slave_connection_manager.cc
+++ b/mojo/edk/system/slave_connection_manager.cc
@@ -327,9 +327,12 @@ void SlaveConnectionManager::OnError(Error error) {
raw_channel_.reset();
DCHECK(slave_process_delegate_);
- delegate_thread_task_runner_->PostTask(
- base::Bind(&embedder::SlaveProcessDelegate::OnMasterDisconnect,
- base::Unretained(slave_process_delegate_)));
+ // TODO(vtl): With C++14 lambda captures, we'll be able to avoid this
+ // nonsense.
+ auto slave_process_delegate = slave_process_delegate_;
+ delegate_thread_task_runner_->PostTask([slave_process_delegate]() {
+ slave_process_delegate->OnMasterDisconnect();
+ });
}
void SlaveConnectionManager::AssertNotOnPrivateThread() const {
« no previous file with comments | « mojo/edk/system/remote_message_pipe_unittest.cc ('k') | mojo/edk/system/test/test_io_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698