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

Unified Diff: sandbox/mac/os_compatibility.h

Issue 264923003: Initial implementation of the Mac Bootstrap Sandbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase for sandbox_export.h Created 6 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/launchd_interception_server.cc ('k') | sandbox/mac/os_compatibility.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/mac/os_compatibility.h
diff --git a/sandbox/mac/os_compatibility.h b/sandbox/mac/os_compatibility.h
new file mode 100644
index 0000000000000000000000000000000000000000..2d9b096c4fc07f605865814631b4796a94515bc0
--- /dev/null
+++ b/sandbox/mac/os_compatibility.h
@@ -0,0 +1,45 @@
+// Copyright 2014 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.
+
+// This file is used to handle differences in Mach message IDs and structures
+// that occur between different OS versions. The Mach messages that the sandbox
+// is interested in are decoded using information derived from the open-source
+// libraries, i.e. <http://www.opensource.apple.com/source/launchd/>. While
+// these messages definitions are open source, they are not considered part of
+// the stable OS API, and so differences do exist between OS versions.
+
+#ifndef SANDBOX_MAC_OS_COMPATIBILITY_H_
+#define SANDBOX_MAC_OS_COMPATIBILITY_H_
+
+#include <mach/mach.h>
+
+#include <string>
+
+namespace sandbox {
+
+typedef std::string (*LookUp2GetRequestName)(const mach_msg_header_t*);
+typedef void (*LookUp2FillReply)(mach_msg_header_t*, mach_port_t service_port);
+
+struct LaunchdCompatibilityShim {
+ // The msgh_id for look_up2.
+ mach_msg_id_t msg_id_look_up2;
+
+ // The msgh_id for swap_integer.
+ mach_msg_id_t msg_id_swap_integer;
+
+ // A function to take a look_up2 message and return the string service name
+ // that was requested via the message.
+ LookUp2GetRequestName look_up2_get_request_name;
+
+ // A function to formulate a reply to a look_up2 message, given the reply
+ // message and the port to return as the service.
+ LookUp2FillReply look_up2_fill_reply;
+};
+
+// Gets the compatibility shim for the launchd job subsystem.
+const LaunchdCompatibilityShim GetLaunchdCompatibilityShim();
+
+} // namespace sandbox
+
+#endif // SANDBOX_MAC_OS_COMPATIBILITY_H_
« no previous file with comments | « sandbox/mac/launchd_interception_server.cc ('k') | sandbox/mac/os_compatibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698