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

Unified Diff: ipc/ipc_channel_mojo.cc

Issue 2493623002: Remove IPC::Endpoint. (Closed)
Patch Set: Created 4 years, 1 month 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 | « ipc/ipc_channel_mojo.h ('k') | ipc/ipc_channel_nacl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_mojo.cc
diff --git a/ipc/ipc_channel_mojo.cc b/ipc/ipc_channel_mojo.cc
index 6d00311a129db66704be8e3a050045463fef4592..e71baff895e6892d9dc36d6d0bfc44f1f159b7eb 100644
--- a/ipc/ipc_channel_mojo.cc
+++ b/ipc/ipc_channel_mojo.cc
@@ -235,6 +235,18 @@ MojoResult UnwrapAttachment(mojom::SerializedHandlePtr handle,
return MOJO_RESULT_UNKNOWN;
}
+base::ProcessId GetSelfPID() {
+#if defined(OS_LINUX)
+ if (int global_pid = Channel::GetGlobalPid())
+ return global_pid;
+#endif // OS_LINUX
+#if defined(OS_NACL)
+ return -1;
+#else
+ return base::GetCurrentProcId();
+#endif // defined(OS_NACL)
+}
+
} // namespace
//------------------------------------------------------------------------------
@@ -370,29 +382,11 @@ bool ChannelMojo::Send(Message* message) {
return message_reader_->Send(std::move(scoped_message));
}
-base::ProcessId ChannelMojo::GetPeerPID() const {
- if (!message_reader_)
- return base::kNullProcessId;
- return message_reader_->GetPeerPid();
-}
-
-base::ProcessId ChannelMojo::GetSelfPID() const {
-#if defined(OS_LINUX)
- if (int global_pid = GetGlobalPid())
- return global_pid;
-#endif // OS_LINUX
-#if defined(OS_NACL)
- return -1;
-#else
- return base::GetCurrentProcId();
-#endif // defined(OS_NACL)
-}
-
Channel::AssociatedInterfaceSupport*
ChannelMojo::GetAssociatedInterfaceSupport() { return this; }
-void ChannelMojo::OnPeerPidReceived() {
- listener_->OnChannelConnected(static_cast<int32_t>(GetPeerPID()));
+void ChannelMojo::OnPeerPidReceived(int32_t peer_pid) {
+ listener_->OnChannelConnected(peer_pid);
}
void ChannelMojo::OnMessageReceived(const Message& message) {
« no previous file with comments | « ipc/ipc_channel_mojo.h ('k') | ipc/ipc_channel_nacl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698