blob: 527e5fc7546ebb4c48b71f2597a78d538142e9a0 [file] [log] [blame]
Elly Jonesa44d22d2012-01-05 18:05:56 -05001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Elly Jonese7cb5b32011-12-01 14:18:32 -05002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef PROCESS_WITH_ID_H
6#define PROCESS_WITH_ID_H
7
Elly Fong-Jonesd9a16cd2012-11-12 16:09:49 -05008#include "sandboxed_process.h"
Elly Jonese7cb5b32011-12-01 14:18:32 -05009
10namespace debugd {
11
12// @brief Represents a process with an immutable ID.
13//
14// The ID is random, unguessable, and may be given to other processes. It is a
15// null-terminated ASCII string.
Elly Fong-Jonesd9a16cd2012-11-12 16:09:49 -050016class ProcessWithId : public SandboxedProcess {
Elly Jonese7cb5b32011-12-01 14:18:32 -050017 public:
18 ProcessWithId();
Elly Fong-Jonesd9a16cd2012-11-12 16:09:49 -050019 virtual bool Init();
Elly Jonese7cb5b32011-12-01 14:18:32 -050020 std::string id() const { return id_; }
21 private:
22 bool generate_id();
23 std::string id_;
24};
25
26}; // namespace debugd
27
28#endif // PROCESS_WITH_ID_H