Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef PPAPI_C_PPB_BROKER_TRUSTED_H_ | 5 #ifndef PPAPI_C_PPB_BROKER_TRUSTED_H_ |
| 6 #define PPAPI_C_PPB_BROKER_TRUSTED_H_ | 6 #define PPAPI_C_PPB_BROKER_TRUSTED_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_completion_callback.h" | 8 #include "ppapi/c/pp_completion_callback.h" |
| 9 #include "ppapi/c/pp_bool.h" | 9 #include "ppapi/c/pp_bool.h" |
| 10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
| 11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
| 12 | 12 |
| 13 // DO NOT USE THIS INTERFACE | |
|
brettw
2011/04/15 16:09:25
I'd probably just delete this. It's a trusted one
ddorwin
2011/04/15 18:41:32
Done.
| |
| 14 // TODO(ddorwin): Implement the required UX. | |
| 13 #define PPB_BROKER_TRUSTED_INTERFACE "PPB_BrokerTrusted;0.1" | 15 #define PPB_BROKER_TRUSTED_INTERFACE "PPB_BrokerTrusted;0.1" |
| 14 | 16 |
| 15 /** | 17 /** |
| 16 * @file | 18 * @file |
| 17 * This file defines the PPB_BrokerTrusted interface, which provides | 19 * This file defines the PPB_BrokerTrusted interface, which provides |
| 18 * access to a trusted broker with greater privileges than the plugin. | 20 * access to a trusted broker with greater privileges than the plugin. |
| 19 */ | 21 */ |
| 20 | 22 |
| 21 /** | 23 /** |
| 22 * @addtogroup Interfaces | 24 * @addtogroup Interfaces |
| 23 * @{ | 25 * @{ |
| 24 */ | 26 */ |
| 25 | 27 |
| 26 /** | 28 /** |
| 27 * The PPB_BrokerTrusted interface provides access to a trusted broker | 29 * The PPB_BrokerTrusted interface provides access to a trusted broker |
| 28 * with greater privileges than the plugin. The interface only supports | 30 * with greater privileges than the plugin. The interface only supports |
| 29 * out-of-process plugins and is to be used by proxy implementations. All | 31 * out-of-process plugins and is to be used by proxy implementations. All |
| 30 * functions should be called from the main thread only. | 32 * functions should be called from the main thread only. |
| 33 * | |
| 34 * A PPB_BrokerTrusted resource represents a connection to the broker. Its | |
| 35 * lifetime controls the lifetime of the broker, regardless of whether the | |
| 36 * handle is closed. The handle should be closed before the resource is | |
| 37 * released. | |
| 31 */ | 38 */ |
| 32 struct PPB_BrokerTrusted { | 39 struct PPB_BrokerTrusted { |
| 33 /** | 40 /** |
| 34 * Returns a trusted broker resource. | 41 * Returns a trusted broker resource. |
| 35 */ | 42 */ |
| 36 PP_Resource (*CreateTrusted)(PP_Instance instance); | 43 PP_Resource (*CreateTrusted)(PP_Instance instance); |
| 37 | 44 |
| 38 /** | 45 /** |
| 39 * Returns true if the resource is a trusted broker. | 46 * Returns true if the resource is a trusted broker. |
| 40 */ | 47 */ |
| 41 PP_Bool (*IsBrokerTrusted)(PP_Resource resource); | 48 PP_Bool (*IsBrokerTrusted)(PP_Resource resource); |
| 42 | 49 |
| 43 /** | 50 /** |
| 44 * Connects to the trusted broker. It may have already | 51 * Connects to the trusted broker. It may have already |
| 45 * been launched by another plugin instance. | 52 * been launched by another instance. |
| 53 * The plugin takes ownership of the handle once the callback has been called | |
| 54 * with a result of PP_OK. The plugin should immediately call GetHandle and | |
| 55 * begin managing it. If the result is not PP_OK, the browser still owns the | |
| 56 * handle. | |
| 57 * | |
| 46 * Returns PP_ERROR_WOULD_BLOCK on success, and invokes | 58 * Returns PP_ERROR_WOULD_BLOCK on success, and invokes |
| 47 * the |connect_callback| asynchronously to complete. | 59 * the |connect_callback| asynchronously to complete. |
| 48 * As this function should always be invoked from the main thread, | 60 * As this function should always be invoked from the main thread, |
| 49 * do not use the blocking variant of PP_CompletionCallback. | 61 * do not use the blocking variant of PP_CompletionCallback. |
| 50 * Returns PP_ERROR_FAILED if called from an in-process plugin. | 62 * Returns PP_ERROR_FAILED if called from an in-process plugin. |
| 51 */ | 63 */ |
| 52 int32_t (*Connect)(PP_Resource broker, | 64 int32_t (*Connect)(PP_Resource broker, |
| 53 struct PP_CompletionCallback connect_callback); | 65 struct PP_CompletionCallback connect_callback); |
| 54 | 66 |
| 55 /** | 67 /** |
| 56 * Returns the handle to the pipe. Use once Connect has completed. | 68 * Returns the handle to the pipe. Use once Connect has completed. |
| 57 * Returns PP_OK on success. | 69 * Returns PP_OK on success. |
| 58 * Each plugin instance has its own pipe. | 70 * Each instance of this interface has its own pipe. |
| 71 * handle is only set when returning PP_OK. | |
| 59 */ | 72 */ |
| 60 int32_t (*GetHandle)(PP_Resource broker, int32_t* handle); | 73 int32_t (*GetHandle)(PP_Resource broker, int32_t* handle); |
| 61 }; | 74 }; |
| 62 /** | 75 /** |
| 63 * @} | 76 * @} |
| 64 */ | 77 */ |
| 65 | 78 |
| 66 #endif /* PPAPI_C_PPB_BROKER_TRUSTED_H_ */ | 79 #endif /* PPAPI_C_PPB_BROKER_TRUSTED_H_ */ |
| OLD | NEW |