Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: ppapi/c/trusted/ppb_broker_trusted.h

Issue 11316316: Implement an IsAllowed function in the pepper PPB_Broker_Trusted API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 /* From trusted/ppb_broker_trusted.idl modified Wed Oct 5 14:06:02 2011. */ 6 /* From trusted/ppb_broker_trusted.idl modified Mon Dec 3 11:10:40 2012. */
7 7
8 #ifndef PPAPI_C_TRUSTED_PPB_BROKER_TRUSTED_H_ 8 #ifndef PPAPI_C_TRUSTED_PPB_BROKER_TRUSTED_H_
9 #define PPAPI_C_TRUSTED_PPB_BROKER_TRUSTED_H_ 9 #define PPAPI_C_TRUSTED_PPB_BROKER_TRUSTED_H_
10 10
11 #include "ppapi/c/pp_bool.h" 11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_completion_callback.h" 12 #include "ppapi/c/pp_completion_callback.h"
13 #include "ppapi/c/pp_instance.h" 13 #include "ppapi/c/pp_instance.h"
14 #include "ppapi/c/pp_macros.h" 14 #include "ppapi/c/pp_macros.h"
15 #include "ppapi/c/pp_resource.h" 15 #include "ppapi/c/pp_resource.h"
16 #include "ppapi/c/pp_stdint.h" 16 #include "ppapi/c/pp_stdint.h"
17 17
18 #define PPB_BROKER_TRUSTED_INTERFACE_0_2 "PPB_BrokerTrusted;0.2" 18 #define PPB_BROKER_TRUSTED_INTERFACE_0_2 "PPB_BrokerTrusted;0.2"
19 #define PPB_BROKER_TRUSTED_INTERFACE PPB_BROKER_TRUSTED_INTERFACE_0_2 19 #define PPB_BROKER_TRUSTED_INTERFACE_0_3 "PPB_BrokerTrusted;0.3"
20 #define PPB_BROKER_TRUSTED_INTERFACE PPB_BROKER_TRUSTED_INTERFACE_0_3
20 21
21 /** 22 /**
22 * @file 23 * @file
23 * This file defines the PPB_BrokerTrusted interface, which provides 24 * This file defines the PPB_BrokerTrusted interface, which provides
24 * access to a trusted broker with greater privileges than the plugin. 25 * access to a trusted broker with greater privileges than the plugin.
25 */ 26 */
26 27
27 28
28 /** 29 /**
29 * @addtogroup Interfaces 30 * @addtogroup Interfaces
30 * @{ 31 * @{
31 */ 32 */
32 /** 33 /**
33 * The PPB_BrokerTrusted interface provides access to a trusted broker 34 * The PPB_BrokerTrusted interface provides access to a trusted broker
34 * with greater privileges than the plugin. The interface only supports 35 * with greater privileges than the plugin. The interface only supports
35 * out-of-process plugins and is to be used by proxy implementations. All 36 * out-of-process plugins and is to be used by proxy implementations. All
36 * functions should be called from the main thread only. 37 * functions should be called from the main thread only.
37 * 38 *
38 * A PPB_BrokerTrusted resource represents a connection to the broker. Its 39 * A PPB_BrokerTrusted resource represents a connection to the broker. Its
39 * lifetime controls the lifetime of the broker, regardless of whether the 40 * lifetime controls the lifetime of the broker, regardless of whether the
40 * handle is closed. The handle should be closed before the resource is 41 * handle is closed. The handle should be closed before the resource is
41 * released. 42 * released.
42 */ 43 */
43 struct PPB_BrokerTrusted_0_2 { 44 struct PPB_BrokerTrusted_0_3 {
44 /** 45 /**
45 * Returns a trusted broker resource. 46 * Returns a trusted broker resource.
46 */ 47 */
47 PP_Resource (*CreateTrusted)(PP_Instance instance); 48 PP_Resource (*CreateTrusted)(PP_Instance instance);
48 /** 49 /**
49 * Returns true if the resource is a trusted broker. 50 * Returns true if the resource is a trusted broker.
50 */ 51 */
51 PP_Bool (*IsBrokerTrusted)(PP_Resource resource); 52 PP_Bool (*IsBrokerTrusted)(PP_Resource resource);
52 /** 53 /**
53 * Connects to the trusted broker. It may have already 54 * Connects to the trusted broker. It may have already
(...skipping 13 matching lines...) Expand all
67 struct PP_CompletionCallback connect_callback); 68 struct PP_CompletionCallback connect_callback);
68 /** 69 /**
69 * Gets the handle to the pipe. Use once Connect has completed. Each instance 70 * Gets the handle to the pipe. Use once Connect has completed. Each instance
70 * of this interface has its own pipe. 71 * of this interface has its own pipe.
71 * 72 *
72 * Returns PP_OK on success, and places the result into the given output 73 * Returns PP_OK on success, and places the result into the given output
73 * parameter. The handle is only set when returning PP_OK. Calling this 74 * parameter. The handle is only set when returning PP_OK. Calling this
74 * before connect has completed will return PP_ERROR_FAILED. 75 * before connect has completed will return PP_ERROR_FAILED.
75 */ 76 */
76 int32_t (*GetHandle)(PP_Resource broker, int32_t* handle); 77 int32_t (*GetHandle)(PP_Resource broker, int32_t* handle);
78 /**
79 * Returns PP_TRUE if the plugin has permission to launch the broker. A user
80 * must explicitly grant permission to launch the broker for a particular
81 * website. This is done through an infobar that is displayed when |Connect|
82 * is called. This function returns PP_TRUE if the user has already granted
83 * permission to launch the broker for the website containing this plugin
84 * instance. Returns PP_FALSE otherwise.
85 */
86 PP_Bool (*IsAllowed)(PP_Resource broker);
77 }; 87 };
78 88
79 typedef struct PPB_BrokerTrusted_0_2 PPB_BrokerTrusted; 89 typedef struct PPB_BrokerTrusted_0_3 PPB_BrokerTrusted;
90
91 struct PPB_BrokerTrusted_0_2 {
92 PP_Resource (*CreateTrusted)(PP_Instance instance);
93 PP_Bool (*IsBrokerTrusted)(PP_Resource resource);
94 int32_t (*Connect)(PP_Resource broker,
95 struct PP_CompletionCallback connect_callback);
96 int32_t (*GetHandle)(PP_Resource broker, int32_t* handle);
97 };
80 /** 98 /**
81 * @} 99 * @}
82 */ 100 */
83 101
84 #endif /* PPAPI_C_TRUSTED_PPB_BROKER_TRUSTED_H_ */ 102 #endif /* PPAPI_C_TRUSTED_PPB_BROKER_TRUSTED_H_ */
85 103
OLDNEW
« no previous file with comments | « ppapi/api/trusted/ppb_broker_trusted.idl ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698