Skip to content

Commit

Permalink
Suppress deprecation warnings for OS X sandbox functions.
Browse files Browse the repository at this point in the history
OS X deprecated sandbox_init and sandbox_free_error, but never
provided suitable replacements. This supresses the warning.

BUG=547071

Review URL: https://codereview.chromium.org/1839243004

Cr-Commit-Position: refs/heads/master@{#384310}
  • Loading branch information
kerrnel90 authored and Commit bot committed Mar 31, 2016
1 parent 94711d0 commit 4a7c803
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions content/common/sandbox_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ NOINLINE void FatalStringQuoteException(const std::string& str) {
if (sandbox_init_with_parameters(profile_str_.c_str(), 0, params.data(),
&error_internal)) {
error->assign(error_internal);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
sandbox_free_error(error_internal);
#pragma clang diagnostic pop
return false;
}
return true;
Expand Down
3 changes: 3 additions & 0 deletions ipc/ipc_send_fds_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,16 @@ 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);
bool success = (error == 0 && error_buff == NULL);
if (!success)
return -1;

sandbox_free_error(error_buff);
#pragma clang diagnostic pop

// Make sure sandbox is really enabled.
if (open(kDevZeroPath, O_RDONLY) != -1) {
Expand Down

0 comments on commit 4a7c803

Please sign in to comment.