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

Unified Diff: sandbox/mac/seatbelt.h

Issue 2914693002: Add IsSandboxed() function to seatbelt wrapper. (Closed)
Patch Set: Improve function documentation Created 3 years, 7 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 | « sandbox/mac/sandbox_mac_compiler_unittest.mm ('k') | sandbox/mac/seatbelt.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/mac/seatbelt.h
diff --git a/sandbox/mac/seatbelt.h b/sandbox/mac/seatbelt.h
index 2a5db08e4b6f3a38b9c19eac383fb62cab6a52b5..f19715902f0f526efe811500b1868e86e204961e 100644
--- a/sandbox/mac/seatbelt.h
+++ b/sandbox/mac/seatbelt.h
@@ -17,15 +17,28 @@ namespace sandbox {
// This class wraps the functions in deprecation warning supressions.
class SEATBELT_EXPORT Seatbelt {
public:
+ // Initializes the specified sandbox profile. Returns 0 on success, else -1
+ // and |errorbuf| is populated. |errorbuf| is allocated by the API and must be
+ // freed with FreeError().
static int Init(const char* profile, uint64_t flags, char** errorbuf);
+ // Initializes the specified sandbox profile and passes the parameters to the
+ // |profile|. |parameters| is a null terminated list containing key,value
+ // pairs in sequence. [key1,val1,key2,val2,nullptr]. |errorbuf| is allocated
+ // by the API and is set to a string description of the error. |errorbuf| must
+ // be freed with FreeError(). This function eturns 0 on success, else -1 and
+ // |errorbuf| is populated.
static int InitWithParams(const char* profile,
uint64_t flags,
const char* const parameters[],
char** errorbuf);
+ // Frees the |errorbuf| allocated and set by InitWithParams.
static void FreeError(char* errorbuf);
+ // Returns whether or not the process is currently sandboxed.
+ static bool IsSandboxed();
+
static const char* kProfileNoInternet;
static const char* kProfileNoNetwork;
« no previous file with comments | « sandbox/mac/sandbox_mac_compiler_unittest.mm ('k') | sandbox/mac/seatbelt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698