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

Unified Diff: ipc/ipc_send_fds_test.cc

Issue 1855303003: Wrap deprecated sandbox functions in C++ class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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 | « ipc/ipc.gyp ('k') | sandbox/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_send_fds_test.cc
diff --git a/ipc/ipc_send_fds_test.cc b/ipc/ipc_send_fds_test.cc
index 264aa855f91080fdd2d09352b15e3af6df70e16f..2d5616bf47660c6cdd2abd0c206a8ae3682aa12e 100644
--- a/ipc/ipc_send_fds_test.cc
+++ b/ipc/ipc_send_fds_test.cc
@@ -8,7 +8,7 @@
#if defined(OS_MACOSX)
extern "C" {
#include <sandbox.h>
-}
+};
#endif
#include <fcntl.h>
#include <stddef.h>
@@ -33,6 +33,10 @@ extern "C" {
#include "base/macros.h"
#endif
+#if defined(OS_MACOSX)
+#include "sandbox/mac/seatbelt.h"
+#endif
+
namespace {
const unsigned kNumFDsToSend = 7; // per message
@@ -193,16 +197,13 @@ MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendFdsSandboxedClient) {
// Enable the sandbox.
char* error_buff = NULL;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- int error = sandbox_init(kSBXProfilePureComputation, SANDBOX_NAMED,
- &error_buff);
+ int error = sandbox::Seatbelt::Init(kSBXProfilePureComputation, SANDBOX_NAMED,
+ &error_buff);
bool success = (error == 0 && error_buff == NULL);
if (!success)
return -1;
- sandbox_free_error(error_buff);
-#pragma clang diagnostic pop
+ sandbox::Seatbelt::FreeError(error_buff);
// Make sure sandbox is really enabled.
if (open(kDevZeroPath, O_RDONLY) != -1) {
« no previous file with comments | « ipc/ipc.gyp ('k') | sandbox/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698