OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_PP_RESOURCE_H_ | 5 #ifndef PPAPI_C_PP_RESOURCE_H_ |
6 #define PPAPI_C_PP_RESOURCE_H_ | 6 #define PPAPI_C_PP_RESOURCE_H_ |
7 | 7 |
| 8 #include "ppapi/c/pp_macros.h" |
8 #include "ppapi/c/pp_stdint.h" | 9 #include "ppapi/c/pp_stdint.h" |
9 | 10 |
10 /** | 11 /** |
11 * @file | 12 * @file |
12 * Defines the API ... | 13 * Defines the API ... |
13 * | 14 * |
14 * @addtogroup PP | 15 * @addtogroup PP |
15 * @{ | 16 * @{ |
16 */ | 17 */ |
17 | 18 |
18 /** | 19 /** |
19 * A resource is data associated with the Pepper plugin interface. While a | 20 * A resource is data associated with the Pepper plugin interface. While a |
20 * Var represents something callable to JS or from the plugin to the DOM, a | 21 * Var represents something callable to JS or from the plugin to the DOM, a |
21 * resource has no meaning or visibility outside of the plugin interface. | 22 * resource has no meaning or visibility outside of the plugin interface. |
22 * | 23 * |
23 * Resources are reference counted. Use AddRefResource and ReleaseResource to | 24 * Resources are reference counted. Use AddRefResource and ReleaseResource to |
24 * manage your reference count of a resource. The data will be automatically | 25 * manage your reference count of a resource. The data will be automatically |
25 * destroyed when the internal reference count reaches 0. | 26 * destroyed when the internal reference count reaches 0. |
26 * | 27 * |
27 * Value is an opaque handle assigned by the browser to the resource. It is | 28 * Value is an opaque handle assigned by the browser to the resource. It is |
28 * guaranteed never to be 0 for a valid resource, so a plugin can initialize | 29 * guaranteed never to be 0 for a valid resource, so a plugin can initialize |
29 * it to 0 to indicate a "NULL handle." Some interfaces may return a NULL | 30 * it to 0 to indicate a "NULL handle." Some interfaces may return a NULL |
30 * resource to indicate failure. | 31 * resource to indicate failure. |
31 */ | 32 */ |
32 typedef int64_t PP_Resource; | 33 typedef int64_t PP_Resource; |
| 34 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Resource, 8); |
33 | 35 |
34 /** | 36 /** |
35 * @} | 37 * @} |
36 * End addtogroup PP | 38 * End addtogroup PP |
37 */ | 39 */ |
38 | 40 |
39 #endif // PPAPI_C_PP_RESOURCE_H_ | 41 #endif // PPAPI_C_PP_RESOURCE_H_ |
OLD | NEW |