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.
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"
15 * This file defines functions that your module must implement to support a
20 // {PENDING: undefine PP_EXPORT?}
22 #include "ppapi/c/pp_instance.h"
23 #include "ppapi/c/pp_stdint.h"
28 #define PP_EXPORT __attribute__ ((visibility("default")))
29 #elif defined(_MSC_VER)
30 #define PP_EXPORT __declspec(dllexport)
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.
43 * @addtogroup Typedefs
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
55 * @return PP_OK on success. Any other value on failure.
57 typedef int32_t (*PP_ConnectInstance_Func
)(PP_Instance instance
,
64 * @addtogroup Functions
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
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
);
86 * @addtogroup Functions
90 /** PPP_ShutdownBroker() is called before the broker is unloaded.
92 PP_EXPORT
void PPP_ShutdownBroker();
101 #endif /* PPAPI_C_TRUSTED_PPP_BROKER_H_ */