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

Side by Side Diff: sandbox/mac/mach_message_server.h

Issue 1556133002: Shutdown the sandbox MessageServer before deleting it. (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 unified diff | Download patch
« no previous file with comments | « sandbox/mac/launchd_interception_server.cc ('k') | sandbox/mac/mach_message_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SANDBOX_MAC_MACH_MESSAGE_SERVER_H_ 5 #ifndef SANDBOX_MAC_MACH_MESSAGE_SERVER_H_
6 #define SANDBOX_MAC_MACH_MESSAGE_SERVER_H_ 6 #define SANDBOX_MAC_MACH_MESSAGE_SERVER_H_
7 7
8 #include <mach/mach.h> 8 #include <mach/mach.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 16 matching lines...) Expand all
27 // take ownership of the port and it will be used to receive messages. 27 // take ownership of the port and it will be used to receive messages.
28 // Otherwise the server will create a new receive right. 28 // Otherwise the server will create a new receive right.
29 // The maximum size of messages is specified by |buffer_size|. 29 // The maximum size of messages is specified by |buffer_size|.
30 MachMessageServer(MessageDemuxer* demuxer, 30 MachMessageServer(MessageDemuxer* demuxer,
31 mach_port_t server_receive_right, 31 mach_port_t server_receive_right,
32 mach_msg_size_t buffer_size); 32 mach_msg_size_t buffer_size);
33 ~MachMessageServer() override; 33 ~MachMessageServer() override;
34 34
35 // MessageServer: 35 // MessageServer:
36 bool Initialize() override; 36 bool Initialize() override;
37 void Shutdown() override;
37 pid_t GetMessageSenderPID(IPCMessage request) override; 38 pid_t GetMessageSenderPID(IPCMessage request) override;
38 IPCMessage CreateReply(IPCMessage request) override; 39 IPCMessage CreateReply(IPCMessage request) override;
39 bool SendReply(IPCMessage reply) override; 40 bool SendReply(IPCMessage reply) override;
40 void ForwardMessage(IPCMessage request, mach_port_t destination) override; 41 void ForwardMessage(IPCMessage request, mach_port_t destination) override;
41 // Replies to the message with the specified |error_code| as a MIG 42 // Replies to the message with the specified |error_code| as a MIG
42 // error_reply RetCode. 43 // error_reply RetCode.
43 void RejectMessage(IPCMessage request, int error_code) override; 44 void RejectMessage(IPCMessage request, int error_code) override;
44 mach_port_t GetServerPort() const override; 45 mach_port_t GetServerPort() const override;
45 46
46 private: 47 private:
(...skipping 17 matching lines...) Expand all
64 // MACH_RECV dispatch source that handles the |server_port_|. 65 // MACH_RECV dispatch source that handles the |server_port_|.
65 scoped_ptr<base::DispatchSourceMach> dispatch_source_; 66 scoped_ptr<base::DispatchSourceMach> dispatch_source_;
66 67
67 // Whether or not ForwardMessage() was called during ReceiveMessage(). 68 // Whether or not ForwardMessage() was called during ReceiveMessage().
68 bool did_forward_message_; 69 bool did_forward_message_;
69 }; 70 };
70 71
71 } // namespace sandbox 72 } // namespace sandbox
72 73
73 #endif // SANDBOX_MAC_MACH_MESSAGE_SERVER_H_ 74 #endif // SANDBOX_MAC_MACH_MESSAGE_SERVER_H_
OLDNEW
« no previous file with comments | « sandbox/mac/launchd_interception_server.cc ('k') | sandbox/mac/mach_message_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698