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

Unified Diff: sandbox/linux/services/broker_process.cc

Issue 11569028: Linux Sandbox: Basic support for GPU broker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a sandbox callback for the broker process. 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 side-by-side diff with in-line comments
Download patch
Index: sandbox/linux/services/broker_process.cc
diff --git a/sandbox/linux/services/broker_process.cc b/sandbox/linux/services/broker_process.cc
index 7c70118992a27d2adec37939c7e20724f5635056..d941ab6732250e14ecfd9e1680ef5a2269b4eef4 100644
--- a/sandbox/linux/services/broker_process.cc
+++ b/sandbox/linux/services/broker_process.cc
@@ -110,10 +110,8 @@ BrokerProcess::~BrokerProcess() {
}
}
-bool BrokerProcess::Init(void* sandbox_callback) {
+bool BrokerProcess::Init(bool (*sandbox_callback)(void)) {
CHECK(!initialized_);
- CHECK_EQ(sandbox_callback, (void*) NULL) <<
- "sandbox_callback is not implemented";
int socket_pair[2];
// Use SOCK_SEQPACKET, because we need to preserve message boundaries
// but we also want to be notified (recvmsg should return and not block)
@@ -148,7 +146,10 @@ bool BrokerProcess::Init(void* sandbox_callback) {
shutdown(socket_pair[0], SHUT_WR);
ipc_socketpair_ = socket_pair[0];
is_child_ = true;
- // TODO(jln): activate a sandbox here.
+ // Enable the sandbox if provided.
+ if (sandbox_callback) {
+ sandbox_callback();
+ }
initialized_ = true;
for (;;) {
HandleRequest();
« content/common/sandbox_seccomp_bpf_linux.cc ('K') | « sandbox/linux/services/broker_process.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698