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

Unified Diff: mojo/edk/system/node_controller.h

Issue 1712143002: [mojo-edk] Add support for transferring mach ports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 4 years, 9 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 | « mojo/edk/system/node_channel.cc ('k') | mojo/edk/system/node_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/node_controller.h
diff --git a/mojo/edk/system/node_controller.h b/mojo/edk/system/node_controller.h
index 75d28926e09af39007215fde0d841b47906ae2dd..34c26444a85297f48fd6eb069e86a066d4911001 100644
--- a/mojo/edk/system/node_controller.h
+++ b/mojo/edk/system/node_controller.h
@@ -25,11 +25,16 @@
#include "mojo/edk/system/ports/node.h"
#include "mojo/edk/system/ports/node_delegate.h"
+namespace base {
+class PortProvider;
+}
+
namespace mojo {
namespace edk {
class Broker;
class Core;
+class MachPortRelay;
class PortsMessage;
// The owner of ports::Node which facilitates core EDK implementation. All
@@ -56,6 +61,11 @@ class NodeController : public ports::NodeDelegate,
return io_task_runner_;
}
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+ // Create the relay used to transfer mach ports between processes.
+ void CreateMachPortRelay(base::PortProvider* port_provider);
+#endif
+
// Called exactly once, shortly after construction, and before any other
// methods are called on this object.
void SetIOTaskRunner(scoped_refptr<base::TaskRunner> io_task_runner);
@@ -162,13 +172,16 @@ class NodeController : public ports::NodeDelegate,
void OnIntroduce(const ports::NodeName& from_node,
const ports::NodeName& name,
ScopedPlatformHandle channel_handle) override;
-#if defined(OS_WIN)
+#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS))
void OnRelayPortsMessage(const ports::NodeName& from_node,
base::ProcessHandle from_process,
const ports::NodeName& destination,
Channel::MessagePtr message) override;
#endif
void OnChannelError(const ports::NodeName& from_node) override;
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+ MachPortRelay* GetMachPortRelay() override;
+#endif
// Marks this NodeController for destruction when the IO thread shuts down.
// This is used in case Core is torn down before the IO thread. Must only be
@@ -258,6 +271,12 @@ class NodeController : public ports::NodeDelegate,
scoped_ptr<Broker> broker_;
#endif
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+ base::Lock mach_port_relay_lock_;
+ // Relay for transferring mach ports to/from children.
+ scoped_ptr<MachPortRelay> mach_port_relay_;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(NodeController);
};
« no previous file with comments | « mojo/edk/system/node_channel.cc ('k') | mojo/edk/system/node_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698