commit | c13482980f289f9386444ffd281c5baddb79829c | [log] [tgz] |
---|---|---|
author | Jeremy Roman <[email protected]> | Wed Jun 14 00:53:59 2017 |
committer | Commit Bot <[email protected]> | Wed Jun 14 15:00:57 2017 |
tree | 6d08c9526564c675e8a8f165922bc8dcf6e27dc0 | |
parent | 7a18f1f40bb62682b6e41e4b43f5ddc1e04033dd [diff] [blame] |
[Mojo] Implement explicit operator bool on InterfacePtr and AssociatedInterfacePtr. This explaces the "safe bool" pattern (operator Testable), and is the recommended pattern for this from C++11 onwards. The only major difference from a use standpoint is that the conversion no longer occurs implicitly when returning from a bool function. Those cases have been made explicit. This is similar to templates like std::unique_ptr. [email protected] Change-Id: I1c04df989214acf878857194afcdf0906aa3d9c5 Reviewed-on: https://chromium-review.googlesource.com/534295 Commit-Queue: Jeremy Roman <[email protected]> Reviewed-by: Yuzhu Shen <[email protected]> Cr-Commit-Position: refs/heads/master@{#479382}
diff --git a/ipc/ipc_message_pipe_reader.h b/ipc/ipc_message_pipe_reader.h index b441960..ceb62fe 100644 --- a/ipc/ipc_message_pipe_reader.h +++ b/ipc/ipc_message_pipe_reader.h
@@ -74,7 +74,7 @@ void Close(); // Return true if the MessagePipe is alive. - bool IsValid() { return sender_; } + bool IsValid() { return sender_.is_bound(); } // Sends an IPC::Message to the other end of the pipe. Safe to call from any // thread.