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

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: Address a few nits. 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
« no previous file with comments | « sandbox/linux/services/broker_process.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f51533cc20caddd3f55077615d831c1ab2c545d1 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) {
+ CHECK(sandbox_callback());
+ }
initialized_ = true;
for (;;) {
HandleRequest();
« no previous file with comments | « sandbox/linux/services/broker_process.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698