Index: ipc/ipc_message_pipe_reader.h |
diff --git a/ipc/ipc_message_pipe_reader.h b/ipc/ipc_message_pipe_reader.h |
index 5aec4407aaef45842c397d4402e846ba9f4dbd8c..e6a2a137a0a39930266c1400977befb13d10c51a 100644 |
--- a/ipc/ipc_message_pipe_reader.h |
+++ b/ipc/ipc_message_pipe_reader.h |
@@ -13,6 +13,7 @@ |
#include "base/atomicops.h" |
#include "base/compiler_specific.h" |
#include "base/macros.h" |
+#include "base/process/process_handle.h" |
#include "base/threading/thread_checker.h" |
#include "ipc/ipc.mojom.h" |
#include "ipc/ipc_export.h" |
@@ -47,6 +48,7 @@ class IPC_EXPORT MessagePipeReader : public NON_EXPORTED_BASE(mojom::Channel) { |
public: |
class Delegate { |
public: |
+ virtual void OnPeerPidReceived() = 0; |
virtual void OnMessageReceived(const Message& message) = 0; |
virtual void OnPipeError() = 0; |
virtual void OnAssociatedInterfaceRequest( |
@@ -54,21 +56,6 @@ class IPC_EXPORT MessagePipeReader : public NON_EXPORTED_BASE(mojom::Channel) { |
mojo::ScopedInterfaceEndpointHandle handle) = 0; |
}; |
- // Delay the object deletion using the current message loop. |
- // This is intended to used by MessagePipeReader owners. |
- class DelayedDeleter { |
- public: |
- typedef std::default_delete<MessagePipeReader> DefaultType; |
- |
- static void DeleteNow(MessagePipeReader* ptr) { delete ptr; } |
- |
- DelayedDeleter() {} |
- explicit DelayedDeleter(const DefaultType&) {} |
- DelayedDeleter& operator=(const DefaultType&) { return *this; } |
- |
- void operator()(MessagePipeReader* ptr) const; |
- }; |
- |
// Builds a reader that reads messages from |receive_handle| and lets |
// |delegate| know. |
// |
@@ -82,7 +69,6 @@ class IPC_EXPORT MessagePipeReader : public NON_EXPORTED_BASE(mojom::Channel) { |
MessagePipeReader(mojo::MessagePipeHandle pipe, |
mojom::ChannelAssociatedPtr sender, |
mojo::AssociatedInterfaceRequest<mojom::Channel> receiver, |
- base::ProcessId peer_pid, |
Delegate* delegate); |
~MessagePipeReader() override; |
@@ -108,6 +94,7 @@ class IPC_EXPORT MessagePipeReader : public NON_EXPORTED_BASE(mojom::Channel) { |
private: |
// mojom::Channel: |
+ void SetPeerPid(int32_t peer_pid) override; |
void Receive(mojo::Array<uint8_t> data, |
mojo::Array<mojom::SerializedHandlePtr> handles) override; |
void GetAssociatedInterface( |
@@ -116,7 +103,7 @@ class IPC_EXPORT MessagePipeReader : public NON_EXPORTED_BASE(mojom::Channel) { |
// |delegate_| is null once the message pipe is closed. |
Delegate* delegate_; |
- base::ProcessId peer_pid_; |
+ base::ProcessId peer_pid_ = base::kNullProcessId; |
mojom::ChannelAssociatedPtr sender_; |
mojo::AssociatedBinding<mojom::Channel> binding_; |