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

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

Issue 1849323003: Convert //sandbox to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixup nonsfi_sandbox_unittest.cc Created 4 years, 8 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/bootstrap_sandbox_unittest.mm ('k') | sandbox/mac/mach_message_server.h » ('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_LAUNCHD_INTERCEPTION_SERVER_H_ 5 #ifndef SANDBOX_MAC_LAUNCHD_INTERCEPTION_SERVER_H_
6 #define SANDBOX_MAC_LAUNCHD_INTERCEPTION_SERVER_H_ 6 #define SANDBOX_MAC_LAUNCHD_INTERCEPTION_SERVER_H_
7 7
8 #include <memory>
9
8 #include <dispatch/dispatch.h> 10 #include <dispatch/dispatch.h>
9 11
10 #include "base/mac/scoped_mach_port.h" 12 #include "base/mac/scoped_mach_port.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "sandbox/mac/message_server.h" 13 #include "sandbox/mac/message_server.h"
13 14
14 namespace sandbox { 15 namespace sandbox {
15 16
16 class BootstrapSandbox; 17 class BootstrapSandbox;
17 struct BootstrapSandboxPolicy; 18 struct BootstrapSandboxPolicy;
18 class OSCompatibility; 19 class OSCompatibility;
19 20
20 // This class is used to run a Mach IPC message server. This server can 21 // This class is used to run a Mach IPC message server. This server can
21 // hold the receive right for a bootstrap_port of a process, and it filters 22 // hold the receive right for a bootstrap_port of a process, and it filters
(...skipping 25 matching lines...) Expand all
47 // it replies with an error. 48 // it replies with an error.
48 void HandleSwapInteger(IPCMessage request); 49 void HandleSwapInteger(IPCMessage request);
49 50
50 // Forwards the original |request| on to real bootstrap server for handling. 51 // Forwards the original |request| on to real bootstrap server for handling.
51 void ForwardMessage(IPCMessage request); 52 void ForwardMessage(IPCMessage request);
52 53
53 // The sandbox for which this message server is running. 54 // The sandbox for which this message server is running.
54 const BootstrapSandbox* sandbox_; 55 const BootstrapSandbox* sandbox_;
55 56
56 // The Mach IPC server. 57 // The Mach IPC server.
57 scoped_ptr<MessageServer> message_server_; 58 std::unique_ptr<MessageServer> message_server_;
58 59
59 // Whether or not the system is using an XPC-based launchd. 60 // Whether or not the system is using an XPC-based launchd.
60 bool xpc_launchd_; 61 bool xpc_launchd_;
61 62
62 // The Mach port handed out in reply to denied look up requests. All denied 63 // The Mach port handed out in reply to denied look up requests. All denied
63 // requests share the same port, though nothing reads messages from it. 64 // requests share the same port, though nothing reads messages from it.
64 base::mac::ScopedMachReceiveRight sandbox_port_; 65 base::mac::ScopedMachReceiveRight sandbox_port_;
65 // The send right for the above |sandbox_port_|, used with 66 // The send right for the above |sandbox_port_|, used with
66 // MACH_MSG_TYPE_COPY_SEND when handing out references to the dummy port. 67 // MACH_MSG_TYPE_COPY_SEND when handing out references to the dummy port.
67 base::mac::ScopedMachSendRight sandbox_send_port_; 68 base::mac::ScopedMachSendRight sandbox_send_port_;
68 69
69 // The compatibility shim that handles differences in message header IDs and 70 // The compatibility shim that handles differences in message header IDs and
70 // request/reply structures between different OS X versions. 71 // request/reply structures between different OS X versions.
71 scoped_ptr<OSCompatibility> compat_shim_; 72 std::unique_ptr<OSCompatibility> compat_shim_;
72 }; 73 };
73 74
74 } // namespace sandbox 75 } // namespace sandbox
75 76
76 #endif // SANDBOX_MAC_LAUNCHD_INTERCEPTION_SERVER_H_ 77 #endif // SANDBOX_MAC_LAUNCHD_INTERCEPTION_SERVER_H_
OLDNEW
« no previous file with comments | « sandbox/mac/bootstrap_sandbox_unittest.mm ('k') | sandbox/mac/mach_message_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698