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

Unified Diff: sandbox/mac/seatbelt.h

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 | « sandbox/mac/sandbox_mac.gypi ('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
new file mode 100644
index 0000000000000000000000000000000000000000..c5dd386bfe2d4f6a573ceb486a8dc023b8b5b2b1
--- /dev/null
+++ b/sandbox/mac/seatbelt.h
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SANDBOX_MAC_SEATBELT_H_
+#define SANDBOX_MAC_SEATBELT_H_
+
+#include <cstdint>
+
+#include "base/macros.h"
+#include "sandbox/mac/seatbelt_export.h"
+
+namespace sandbox {
+
+// This class exists because OS X deprecated the sandbox functions,
+// and did not supply replacements that are suitable for Chrome.
+// This class wraps the functions in deprecation warning supressions.
+class SEATBELT_EXPORT Seatbelt {
+ public:
+ static int Init(const char* profile, uint64_t flags, char** errorbuf);
+
+ static int InitWithParams(const char* profile,
+ uint64_t flags,
+ const char* const parameters[],
+ char** errorbuf);
+
+ static void FreeError(char* errorbuf);
+
+ private:
+ Seatbelt();
+ DISALLOW_COPY_AND_ASSIGN(Seatbelt);
+};
+
+} // sandbox
+
+#endif // SANDBOX_MAC_SEATBELT_H_
« no previous file with comments | « sandbox/mac/sandbox_mac.gypi ('k') | sandbox/mac/seatbelt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698