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

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

Issue 1555273002: [mojo] Add CreateSharedBuffer method to Broker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: mojo/edk/system/child_broker.h
diff --git a/mojo/edk/system/child_broker.h b/mojo/edk/system/child_broker.h
index 49bd05fb230456943b464080f9b7bb5dd9096934..7b513b1d9709c1d042507e5e6ca1c8135e8004d4 100644
--- a/mojo/edk/system/child_broker.h
+++ b/mojo/edk/system/child_broker.h
@@ -46,7 +46,11 @@ class MOJO_SYSTEM_IMPL_EXPORT ChildBroker
void TokenToHandle(const uint64_t* tokens,
size_t count,
PlatformHandle* handles) override;
+#else
+ scoped_refptr<PlatformSharedBuffer> CreateSharedBuffer(
+ size_t num_bytes) override;
#endif
+
void ConnectMessagePipe(uint64_t pipe_id,
MessagePipeDispatcher* message_pipe) override;
void CloseMessagePipe(uint64_t pipe_id,
@@ -87,6 +91,13 @@ class MOJO_SYSTEM_IMPL_EXPORT ChildBroker
void CreatePlatformChannelPairNoLock(ScopedPlatformHandle* server,
ScopedPlatformHandle* client);
+#else
+ // Will fully write |message|, then read back some number of handles. Returns
+ // false if the write or read failed, or if there were no handles received.
+ bool WriteAndReadHandles(BrokerMessage* message,
+ std::deque<PlatformHandle>* handles);
+#endif
+
// Guards access to |parent_sync_channel_|.
// We use LockImpl instead of Lock because the latter adds thread checking
// that we don't want (since we lock in the constructor and unlock on another
@@ -97,7 +108,6 @@ class MOJO_SYSTEM_IMPL_EXPORT ChildBroker
// instead of bindings or RawChannel because we need to send synchronous
// messages with replies from any thread.
ScopedPlatformHandle parent_sync_channel_;
-#endif
// RawChannel used for asynchronous communication to and from the parent
// process. Since these messages are bidirectional, we can't use

Powered by Google App Engine
This is Rietveld 408576698