OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file provides forward declarations for XPC symbols that are not | 5 // This file provides forward declarations for XPC symbols that are not |
6 // present in the 10.6 SDK. It uses generate_stubs to produce code to | 6 // present in the 10.6 SDK. It uses generate_stubs to produce code to |
7 // dynamically load the libxpc.dylib library and set up a stub table, with | 7 // dynamically load the libxpc.dylib library and set up a stub table, with |
8 // the same names as the real XPC functions. | 8 // the same names as the real XPC functions. |
9 | 9 |
10 #ifndef SANDBOX_MAC_XPC_H_ | 10 #ifndef SANDBOX_MAC_XPC_H_ |
11 #define SANDBOX_MAC_XPC_H_ | 11 #define SANDBOX_MAC_XPC_H_ |
12 | 12 |
13 #include <mach/mach.h> | 13 #include <mach/mach.h> |
14 | 14 |
| 15 #include "sandbox/sandbox_export.h" |
| 16 |
15 // C++ library loader. | 17 // C++ library loader. |
16 #include "sandbox/mac/xpc_stubs.h" | 18 #include "sandbox/mac/xpc_stubs.h" |
17 | 19 |
18 // Declares XPC object types. This includes <xpc/xpc.h> if available. | 20 // Declares XPC object types. This includes <xpc/xpc.h> if available. |
19 #include "sandbox/mac/xpc_stubs_header.fragment" | 21 #include "sandbox/mac/xpc_stubs_header.fragment" |
20 | 22 |
21 #if !defined(MAC_OS_X_VERSION_10_7) || \ | 23 #if !defined(MAC_OS_X_VERSION_10_7) || \ |
22 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | 24 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 |
23 | 25 |
24 extern "C" { | 26 extern "C" { |
25 // Signatures for XPC public functions that are loaded by xpc_stubs.h. | 27 // Signatures for XPC public functions that are loaded by xpc_stubs.h. |
26 #include "sandbox/mac/xpc_stubs.sig" | 28 #include "sandbox/mac/xpc_stubs.sig" |
27 // Signatures for private XPC functions. | 29 // Signatures for private XPC functions. |
28 #include "sandbox/mac/xpc_private_stubs.sig" | 30 #include "sandbox/mac/xpc_private_stubs.sig" |
29 } // extern "C" | 31 } // extern "C" |
30 | 32 |
31 #else | 33 #else |
32 | 34 |
33 // Signatures for private XPC functions. | 35 // Signatures for private XPC functions. |
34 extern "C" { | 36 extern "C" { |
35 #include "sandbox/mac/xpc_private_stubs.sig" | 37 #include "sandbox/mac/xpc_private_stubs.sig" |
36 } // extern "C" | 38 } // extern "C" |
37 | 39 |
38 #endif | 40 #endif |
39 | 41 |
| 42 namespace sandbox { |
| 43 |
| 44 // Dynamically loads the XPC library. |
| 45 bool SANDBOX_EXPORT InitializeXPC(); |
| 46 |
| 47 } // namespace sandbox |
| 48 |
40 #endif // SANDBOX_MAC_XPC_H_ | 49 #endif // SANDBOX_MAC_XPC_H_ |
OLD | NEW |