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

Unified Diff: ipc/ipc_message_pipe_reader.h

Issue 2173303002: Revert of 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
« no previous file with comments | « ipc/ipc_channel_proxy.cc ('k') | ipc/ipc_message_pipe_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_pipe_reader.h
diff --git a/ipc/ipc_message_pipe_reader.h b/ipc/ipc_message_pipe_reader.h
index e6a2a137a0a39930266c1400977befb13d10c51a..5aec4407aaef45842c397d4402e846ba9f4dbd8c 100644
--- a/ipc/ipc_message_pipe_reader.h
+++ b/ipc/ipc_message_pipe_reader.h
@@ -13,7 +13,6 @@
#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"
@@ -48,12 +47,26 @@
public:
class Delegate {
public:
- virtual void OnPeerPidReceived() = 0;
virtual void OnMessageReceived(const Message& message) = 0;
virtual void OnPipeError() = 0;
virtual void OnAssociatedInterfaceRequest(
const std::string& name,
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
@@ -69,6 +82,7 @@
MessagePipeReader(mojo::MessagePipeHandle pipe,
mojom::ChannelAssociatedPtr sender,
mojo::AssociatedInterfaceRequest<mojom::Channel> receiver,
+ base::ProcessId peer_pid,
Delegate* delegate);
~MessagePipeReader() override;
@@ -94,7 +108,6 @@
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(
@@ -103,7 +116,7 @@
// |delegate_| is null once the message pipe is closed.
Delegate* delegate_;
- base::ProcessId peer_pid_ = base::kNullProcessId;
+ base::ProcessId peer_pid_;
mojom::ChannelAssociatedPtr sender_;
mojo::AssociatedBinding<mojom::Channel> binding_;
« no previous file with comments | « ipc/ipc_channel_proxy.cc ('k') | ipc/ipc_message_pipe_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698