blob: 497ccc2da09ff2a9d15c1b9e7508085b70b070ce [file] [log] [blame]
Elly Jonesa44d22d2012-01-05 18:05:56 -05001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Elly Jones0c016cc2011-12-19 16:19:22 -05002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Alex Vakulenko262be3f2014-07-30 15:25:50 -07005#ifndef DEBUGD_SRC_SUBPROCESS_TOOL_H_
6#define DEBUGD_SRC_SUBPROCESS_TOOL_H_
Elly Jones0c016cc2011-12-19 16:19:22 -05007
8#include <map>
9#include <string>
10
Ben Chan657bed82014-09-02 20:40:51 -070011#include <base/macros.h>
Elly Jones0c016cc2011-12-19 16:19:22 -050012#include <dbus-c++/dbus.h>
13
14namespace debugd {
15
16class ProcessWithId;
17
18class SubprocessTool {
19 public:
Ben Chan78f89532014-08-29 09:35:09 -070020 SubprocessTool() = default;
21 virtual ~SubprocessTool() = default;
Elly Jones0c016cc2011-12-19 16:19:22 -050022
Jorge Lucangeli Obes623f8ca2014-09-18 10:50:06 -070023 virtual ProcessWithId* CreateProcess(bool sandboxed);
24 virtual ProcessWithId* CreateProcess(bool sandboxed,
25 bool allow_root_mount_ns);
26
Ben Chana0011d82014-05-13 00:19:29 -070027 virtual void Stop(const std::string& handle, DBus::Error* error);
28
Elly Jones0c016cc2011-12-19 16:19:22 -050029 private:
30 std::map<std::string, ProcessWithId*> processes_;
Ben Chana0011d82014-05-13 00:19:29 -070031
Elly Jones0c016cc2011-12-19 16:19:22 -050032 DISALLOW_COPY_AND_ASSIGN(SubprocessTool);
33};
34
Ben Chana0011d82014-05-13 00:19:29 -070035} // namespace debugd
Elly Jones0c016cc2011-12-19 16:19:22 -050036
Alex Vakulenko262be3f2014-07-30 15:25:50 -070037#endif // DEBUGD_SRC_SUBPROCESS_TOOL_H_