| 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" | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 21 /** | 21 /** | 
| 22  * @addtogroup Interfaces | 22  * @addtogroup Interfaces | 
| 23  * @{ | 23  * @{ | 
| 24  */ | 24  */ | 
| 25 | 25 | 
| 26 /** | 26 /** | 
| 27  * The PPB_BrokerTrusted interface provides access to a trusted broker | 27  * The PPB_BrokerTrusted interface provides access to a trusted broker | 
| 28  * with greater privileges than the plugin. The interface only supports | 28  * with greater privileges than the plugin. The interface only supports | 
| 29  * out-of-process plugins and is to be used by proxy implementations.  All | 29  * out-of-process plugins and is to be used by proxy implementations.  All | 
| 30  * functions should be called from the main thread only. | 30  * functions should be called from the main thread only. | 
|  | 31  * | 
|  | 32  * A PPB_BrokerTrusted resource represents a connection to the broker. Its | 
|  | 33  * lifetime controls the lifetime of the broker, regardless of whether the | 
|  | 34  * handle is closed. The handle should be closed before the resource is | 
|  | 35  * released. | 
| 31  */ | 36  */ | 
| 32 struct PPB_BrokerTrusted { | 37 struct PPB_BrokerTrusted { | 
| 33   /** | 38   /** | 
| 34    * Returns a trusted broker resource. | 39    * Returns a trusted broker resource. | 
| 35    */ | 40    */ | 
| 36   PP_Resource (*CreateTrusted)(PP_Instance instance); | 41   PP_Resource (*CreateTrusted)(PP_Instance instance); | 
| 37 | 42 | 
| 38   /** | 43   /** | 
| 39    * Returns true if the resource is a trusted broker. | 44    * Returns true if the resource is a trusted broker. | 
| 40    */ | 45    */ | 
| 41   PP_Bool (*IsBrokerTrusted)(PP_Resource resource); | 46   PP_Bool (*IsBrokerTrusted)(PP_Resource resource); | 
| 42 | 47 | 
| 43   /** | 48   /** | 
| 44    * Connects to the trusted broker. It may have already | 49    * Connects to the trusted broker. It may have already | 
| 45    * been launched by another plugin instance. | 50    * been launched by another instance. | 
|  | 51    * The plugin takes ownership of the handle once the callback has been called | 
|  | 52    * with a result of PP_OK. The plugin should immediately call GetHandle and | 
|  | 53    * begin managing it. If the result is not PP_OK, the browser still owns the | 
|  | 54    * handle. | 
|  | 55    * | 
| 46    * Returns PP_ERROR_WOULD_BLOCK on success, and invokes | 56    * Returns PP_ERROR_WOULD_BLOCK on success, and invokes | 
| 47    * the |connect_callback| asynchronously to complete. | 57    * the |connect_callback| asynchronously to complete. | 
| 48    * As this function should always be invoked from the main thread, | 58    * As this function should always be invoked from the main thread, | 
| 49    * do not use the blocking variant of PP_CompletionCallback. | 59    * do not use the blocking variant of PP_CompletionCallback. | 
| 50    * Returns PP_ERROR_FAILED if called from an in-process plugin. | 60    * Returns PP_ERROR_FAILED if called from an in-process plugin. | 
| 51    */ | 61    */ | 
| 52   int32_t (*Connect)(PP_Resource broker, | 62   int32_t (*Connect)(PP_Resource broker, | 
| 53                      struct PP_CompletionCallback connect_callback); | 63                      struct PP_CompletionCallback connect_callback); | 
| 54 | 64 | 
| 55   /** | 65   /** | 
| 56    * Returns the handle to the pipe. Use once Connect has completed. | 66    * Returns the handle to the pipe. Use once Connect has completed. | 
| 57    * Returns PP_OK on success. | 67    * Returns PP_OK on success. | 
| 58    * Each plugin instance has its own pipe. | 68    * Each instance of this interface has its own pipe. | 
|  | 69    * handle is only set when returning PP_OK. | 
| 59    */ | 70    */ | 
| 60   int32_t (*GetHandle)(PP_Resource broker, int32_t* handle); | 71   int32_t (*GetHandle)(PP_Resource broker, int32_t* handle); | 
| 61 }; | 72 }; | 
| 62 /** | 73 /** | 
| 63  * @} | 74  * @} | 
| 64  */ | 75  */ | 
| 65 | 76 | 
| 66 #endif  /* PPAPI_C_PPB_BROKER_TRUSTED_H_ */ | 77 #endif  /* PPAPI_C_PPB_BROKER_TRUSTED_H_ */ | 
| OLD | NEW | 
|---|