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

Side by Side Diff: sandbox/linux/services/broker_process.h

Issue 11569028: Linux Sandbox: Basic support for GPU broker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_LINUX_SERVICES_BROKER_PROCESS_H_ 5 #ifndef SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_
6 #define SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ 6 #define SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/pickle.h" 12 #include "base/pickle.h"
13 #include "base/process.h" 13 #include "base/process.h"
14 14
15 namespace sandbox { 15 namespace sandbox {
16 16
17 // Create a new "broker" process to which we can send requests via an IPC 17 // Create a new "broker" process to which we can send requests via an IPC
18 // channel. 18 // channel.
19 // This is a low level IPC mechanism that is suitable to be called from a 19 // This is a low level IPC mechanism that is suitable to be called from a
20 // signal handler. 20 // signal handler.
21 // A process would typically create a broker process before entering 21 // A process would typically create a broker process before entering
22 // sandboxing. 22 // sandboxing.
23 // 1. BrokerProcess open_broker(file_whitelist); 23 // 1. BrokerProcess open_broker(read_whitelist, write_whitelist);
24 // 2. CHECK(open_broker.Init(NULL)); 24 // 2. CHECK(open_broker.Init(NULL));
25 // 3. Enable sandbox. 25 // 3. Enable sandbox.
26 // 4. Use open_broker.Open() to open files. 26 // 4. Use open_broker.Open() to open files.
27 class BrokerProcess { 27 class BrokerProcess {
28 public: 28 public:
29 // |allowed_file_names| is a white list of files that can be opened later via 29 // |allowed_file_names| is a white list of files that can be opened later via
30 // the Open() API. 30 // the Open() API.
31 // |fast_check_in_client| and |quiet_failures_for_tests| are reserved for 31 // |fast_check_in_client| and |quiet_failures_for_tests| are reserved for
32 // unit tests, don't use it. 32 // unit tests, don't use it.
33 explicit BrokerProcess(const std::vector<std::string>& allowed_r_files_, 33 explicit BrokerProcess(const std::vector<std::string>& allowed_r_files_,
(...skipping 28 matching lines...) Expand all
62 pid_t broker_pid_; // The PID of the broker (child). 62 pid_t broker_pid_; // The PID of the broker (child).
63 const std::vector<std::string> allowed_r_files_; // Files allowed for read. 63 const std::vector<std::string> allowed_r_files_; // Files allowed for read.
64 const std::vector<std::string> allowed_w_files_; // Files allowed for write. 64 const std::vector<std::string> allowed_w_files_; // Files allowed for write.
65 int ipc_socketpair_; // Our communication channel to parent or child. 65 int ipc_socketpair_; // Our communication channel to parent or child.
66 DISALLOW_IMPLICIT_CONSTRUCTORS(BrokerProcess); 66 DISALLOW_IMPLICIT_CONSTRUCTORS(BrokerProcess);
67 }; 67 };
68 68
69 } // namespace sandbox 69 } // namespace sandbox
70 70
71 #endif // SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ 71 #endif // SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_
OLDNEW
« content/common/sandbox_seccomp_bpf_linux.cc ('K') | « content/common/sandbox_seccomp_bpf_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698