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

Side by Side Diff: sandbox/mac/seatbelt.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 unified diff | Download patch
« sandbox/mac/seatbelt.h ('K') | « sandbox/mac/seatbelt.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "sandbox/mac/seatbelt.h"
6
7 extern "C" {
8 #include <sandbox.h>
9
10 int sandbox_init_with_parameters(const char* profile,
11 uint64_t flags,
12 const char* const parameters[],
13 char** errorbuf);
14 };
15
16 namespace sandbox {
17
18 // static
19 int Seatbelt::Init(const char* profile, uint64_t flags, char** errorbuf) {
20 #pragma clang diagnostic push
Nico 2016/04/05 18:37:18 This still needs a comment why ignoring the diagno
Greg K 2016/04/05 18:44:53 Done.
21 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
22 return ::sandbox_init(profile, flags, errorbuf);
23 #pragma clang diagnostic pop
24 }
25
26 // static
27 int Seatbelt::InitWithParams(const char* profile,
28 uint64_t flags,
29 const char* const parameters[],
30 char** errorbuf) {
31 return ::sandbox_init_with_parameters(profile, flags, parameters, errorbuf);
32 }
33
34 // static
35 void Seatbelt::FreeError(char* errorbuf) {
36 #pragma clang diagnostic push
37 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
38 return ::sandbox_free_error(errorbuf);
Nico 2016/04/05 18:37:18 likewise
Greg K 2016/04/05 18:44:54 Done.
39 #pragma clang diagnostic pop
40 }
41
42 } // namespace sandbox
OLDNEW
« sandbox/mac/seatbelt.h ('K') | « sandbox/mac/seatbelt.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698