Roll leveldb from r73 to r75.
[chromium-blink-merge.git] / ppapi / c / trusted / ppp_broker.h
blobccd67063bb08c216fba64b2f65cd8f768c616f55
1 /* Copyright (c) 2011 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.
4 */
6 /* From trusted/ppp_broker.idl modified Sat Jul 16 16:51:03 2011. */
8 #ifndef PPAPI_C_TRUSTED_PPP_BROKER_H_
9 #define PPAPI_C_TRUSTED_PPP_BROKER_H_
11 #include "ppapi/c/pp_macros.h"
13 /**
14 * @file
15 * This file defines functions that your module must implement to support a
16 * broker.
20 // {PENDING: undefine PP_EXPORT?}
22 #include "ppapi/c/pp_instance.h"
23 #include "ppapi/c/pp_stdint.h"
26 #if __GNUC__ >= 4
28 #define PP_EXPORT __attribute__ ((visibility("default")))
29 #elif defined(_MSC_VER)
30 #define PP_EXPORT __declspec(dllexport)
31 #endif
35 /* We don't want name mangling for these external functions. We only need
36 * 'extern "C"' if we're compiling with a C++ compiler.
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
42 /**
43 * @addtogroup Typedefs
44 * @{
47 /**
48 * PP_ConnectInstance_Func defines the signature that you implement to
49 * receive notifications when a plugin instance connects to the broker.
50 * The broker should listen on the socket before returning.
52 * @param[in] instance The plugin instance connecting to the broker.
53 * @param[in] handle Handle to a socket the broker can use to communicate with
54 * the plugin.
55 * @return PP_OK on success. Any other value on failure.
57 typedef int32_t (*PP_ConnectInstance_Func)(PP_Instance instance,
58 int32_t handle);
59 /**
60 * @}
63 /**
64 * @addtogroup Functions
65 * @{
68 /**
69 * PPP_InitializeBroker() is the entry point for a broker and is
70 * called by the browser when your module loads. Your code must implement this
71 * function.
73 * Failure indicates to the browser that this broker can not be used. In this
74 * case, the broker will be unloaded.
76 * @param[out] connect_instance_func A pointer to a connect instance function.
77 * @return PP_OK on success. Any other value on failure.
79 PP_EXPORT int32_t PPP_InitializeBroker(
80 PP_ConnectInstance_Func* connect_instance_func);
81 /**
82 * @}
85 /**
86 * @addtogroup Functions
87 * @{
90 /** PPP_ShutdownBroker() is called before the broker is unloaded.
92 PP_EXPORT void PPP_ShutdownBroker();
93 /**
94 * @}
97 #ifdef __cplusplus
98 } /* extern "C" */
99 #endif
101 #endif /* PPAPI_C_TRUSTED_PPP_BROKER_H_ */