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

Unified Diff: sandbox/mac/message_server.h

Issue 398563002: Do not create a reply IPCMessage for every message received. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « sandbox/mac/mach_message_server.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/mac/message_server.h
diff --git a/sandbox/mac/message_server.h b/sandbox/mac/message_server.h
index 2a56fd5209529e5fd874b52f07a8ce7d62cb654e..1cd40b0a3dc9e433fda4feacfeda9ba51c1b8a16 100644
--- a/sandbox/mac/message_server.h
+++ b/sandbox/mac/message_server.h
@@ -24,10 +24,9 @@ union IPCMessage {
// incoming intercepted IPC messages.
class MessageDemuxer {
public:
- // Handle a |request| message and optionally create a |reply|. Both message
- // objects are owned by the server. Use the server's methods to send a
- // reply message.
- virtual void DemuxMessage(IPCMessage request, IPCMessage reply) = 0;
+ // Handle a |request| message. The message is owned by the server. Use the
+ // server's methods to create and send a reply message.
+ virtual void DemuxMessage(IPCMessage request) = 0;
protected:
virtual ~MessageDemuxer() {}
@@ -48,15 +47,20 @@ class MessageServer {
// Given a received request message, returns the PID of the sending process.
virtual pid_t GetMessageSenderPID(IPCMessage request) = 0;
+ // Creates a reply message from a request message. The result is owned by
+ // the server.
+ virtual IPCMessage CreateReply(IPCMessage request) = 0;
+
// Sends a reply message. Returns true if the message was sent successfully.
virtual bool SendReply(IPCMessage reply) = 0;
// Forwards the original |request| to the |destination| for handling.
virtual void ForwardMessage(IPCMessage request, mach_port_t destination) = 0;
- // Replies to the message with the specified |error_code| in an error field
- // that is interpreted by the underlying IPC system.
- virtual void RejectMessage(IPCMessage reply, int error_code) = 0;
+ // Replies to the received |request| message by creating a reply and setting
+ // the specified |error_code| in a field that is interpreted by the
+ // underlying IPC system.
+ virtual void RejectMessage(IPCMessage request, int error_code) = 0;
// Returns the Mach port on which the MessageServer is listening.
virtual mach_port_t GetServerPort() const = 0;
« no previous file with comments | « sandbox/mac/mach_message_server.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698