summaryrefslogtreecommitdiffstats
path: root/ppapi/api/trusted/ppp_broker.idl
blob: a9dc4fabad3ead4b4b93655f8fbcb5f835330c7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/**
 * This file defines functions that your module must implement to support a
 * broker.
 */

#inline c
// {PENDING: undefine PP_EXPORT?}

#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_stdint.h"


#if __GNUC__ >= 4

#define PP_EXPORT __attribute__ ((visibility("default")))
#elif defined(_MSC_VER)
#define PP_EXPORT __declspec(dllexport)
#endif



/* We don't want name mangling for these external functions.  We only need
 * 'extern "C"' if we're compiling with a C++ compiler.
 */
#ifdef __cplusplus
extern "C" {
#endif

/**
 * @addtogroup Typedefs
 * @{
 */

/**
 * PP_ConnectInstance_Func defines the signature that you implement to
 * receive notifications when a plugin instance connects to the broker.
 * The broker should listen on the socket before returning.
 *
 * @param[in] instance The plugin instance connecting to the broker.
 * @param[in] handle Handle to a socket the broker can use to communicate with
 * the plugin.
 * @return PP_OK on success. Any other value on failure.
 */
typedef int32_t (*PP_ConnectInstance_Func)(PP_Instance instance,
                                           int32_t handle);
/**
 * @}
 */

/**
 * @addtogroup Functions
 * @{
 */

/**
 * PPP_InitializeBroker() is the entry point for a broker and is
 * called by the browser when your module loads. Your code must implement this
 * function.
 *
 * Failure indicates to the browser that this broker can not be used. In this
 * case, the broker will be unloaded.
 *
 * @param[out] connect_instance_func A pointer to a connect instance function.
 * @return PP_OK on success. Any other value on failure.
*/
PP_EXPORT int32_t PPP_InitializeBroker(
    PP_ConnectInstance_Func* connect_instance_func);
/**
 * @}
 */

/**
 * @addtogroup Functions
 * @{
 */

/** PPP_ShutdownBroker() is called before the broker is unloaded.
 */
PP_EXPORT void PPP_ShutdownBroker();
/**
 * @}
 */

#ifdef __cplusplus
}  /* extern "C" */
#endif

#endinl