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

Unified Diff: ipc/ipc_message_pipe_reader.h

Issue 2163633003: Support early associated interface binding on ChannelMojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicit-channel-ipc-task-runner
Patch Set: . Created 4 years, 5 months 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
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..5246478def40933f756fb14e779addb754cbb4fc 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(
@@ -82,7 +84,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 +109,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 +118,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_;

Powered by Google App Engine
This is Rietveld 408576698