Roll src/third_party/WebKit 0c4ac17:a1f4c5d (svn 202354:202355)
[chromium-blink-merge.git] / sandbox / mac / xpc_stubs_header.fragment
blob4daa850b2f913216e76032e8684e6a136dfd5677
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
3 // found in the LICENSE file.
5 #ifndef SANDBOX_MAC_XPC_STUBS_HEADER_FRAGMENT_
6 #define SANDBOX_MAC_XPC_STUBS_HEADER_FRAGMENT_
8 #include <bsm/libbsm.h>
10 #include "sandbox/sandbox_export.h"
12 // Declare or include public types.
13 #if !defined(MAC_OS_X_VERSION_10_7) || \
14     MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
16 extern "C" {
17 typedef void* xpc_object_t;
18 }  // extern "C"
20 #else
22 #include <xpc/xpc.h>
24 #endif
26 // Declare private types.
27 extern "C" {
28 typedef struct _xpc_pipe_s* xpc_pipe_t;
29 }  // extern "C"
31 #if defined(MAC_OS_X_VERSION_10_7) && \
32     MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
33 // Redeclare methods that only exist on 10.7+ to suppress
34 // -Wpartial-availability warnings.
35 extern "C" {
36 XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 void
37 xpc_dictionary_set_int64(xpc_object_t xdict, const char* key, int64_t value);
39 XPC_EXPORT XPC_NONNULL1 void xpc_release(xpc_object_t object);
41 XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
42 bool xpc_dictionary_get_bool(xpc_object_t xdict, const char* key);
44 XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL int64_t
45 xpc_dictionary_get_int64(xpc_object_t xdict, const char* key);
47 XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
48 const char* xpc_dictionary_get_string(xpc_object_t xdict, const char* key);
50 XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL uint64_t
51 xpc_dictionary_get_uint64(xpc_object_t xdict, const char* key);
53 XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 void
54 xpc_dictionary_set_uint64(xpc_object_t xdict, const char* key, uint64_t value);
56 XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT xpc_object_t
57 xpc_dictionary_create(const char* const* keys,
58                       const xpc_object_t* values,
59                       size_t count);
60 XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL_ALL
61     xpc_object_t
62     xpc_dictionary_create_reply(xpc_object_t original);
64 XPC_EXPORT XPC_MALLOC XPC_WARN_RESULT XPC_NONNULL1
65 char* xpc_copy_description(xpc_object_t object);
66 }  // extern "C"
67 #endif
69 #endif  // SANDBOX_MAC_XPC_STUBS_HEADER_FRAGMENT_