1 /* Copyright (c) 2012 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.
7 * This file defines functions that your module must implement to support a
12 // {PENDING: undefine PP_EXPORT?}
14 #include
"ppapi/c/pp_instance.h"
15 #include
"ppapi/c/pp_stdint.h"
20 #define PP_EXPORT __attribute__
((visibility
("default")))
21 #elif defined
(_MSC_VER
)
22 #define PP_EXPORT __declspec
(dllexport
)
27 /* We don't want name mangling for these external functions. We only need
28 * 'extern "C"' if we're compiling with a C++ compiler.
35 * @addtogroup Typedefs
40 * PP_ConnectInstance_Func defines the signature that you implement to
41 * receive notifications when a plugin instance connects to the broker.
42 * The broker should listen on the socket before returning.
44 * @param[in] instance The plugin instance connecting to the broker.
45 * @param[in] handle Handle to a socket the broker can use to communicate with
47 * @return PP_OK on success. Any other value on failure.
49 typedef int32_t
(*PP_ConnectInstance_Func
)(PP_Instance instance
,
56 * @addtogroup Functions
61 * PPP_InitializeBroker() is the entry point for a broker and is
62 * called by the browser when your module loads. Your code must implement this
65 * Failure indicates to the browser that this broker can not be used. In this
66 * case, the broker will be unloaded.
68 * @param[out] connect_instance_func A pointer to a connect instance function.
69 * @return PP_OK on success. Any other value on failure.
71 PP_EXPORT int32_t PPP_InitializeBroker
(
72 PP_ConnectInstance_Func
* connect_instance_func
);
78 * @addtogroup Functions
82 /** PPP_ShutdownBroker() is called before the broker is unloaded.
84 PP_EXPORT
void PPP_ShutdownBroker
();