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_macros.h" |
9 #include "ppapi/c/pp_stdint.h" | 9 #include "ppapi/c/pp_stdint.h" |
10 | 10 |
11 /** | 11 /** |
12 * @file | 12 * @file |
13 * This file defines the PP_Resource type which represents data associated with | 13 * This file defines the <code>PP_Resource</code> type which represents data |
14 * the module. | 14 * associated with the module. |
15 */ | 15 */ |
16 | 16 |
17 /** | 17 /** |
18 * @addtogroup Typedefs | 18 * @addtogroup Typedefs |
19 * @{ | 19 * @{ |
20 */ | 20 */ |
21 | 21 |
22 /** | 22 /** |
23 * This typdef represents an opaque handle assigned by the browser to the | 23 * This typdef represents an opaque handle assigned by the browser to the |
24 * resource. The handle is guaranteed never to be 0 for a valid resource, so a | 24 * resource. The handle is guaranteed never to be 0 for a valid resource, so a |
25 * module can initialize it to 0 to indicate a "NULL handle." Some interfaces | 25 * module can initialize it to 0 to indicate a "NULL handle." Some interfaces |
26 * may return a NULL resource to indicate failure. | 26 * may return a NULL resource to indicate failure. |
27 * | 27 * |
28 * While a Var represents something callable to JS or from the module to | 28 * While a Var represents something callable to JS or from the module to |
29 * the DOM, a resource has no meaning or visibility outside of the module | 29 * the DOM, a resource has no meaning or visibility outside of the module |
30 * interface. | 30 * interface. |
31 * | 31 * |
32 * Resources are reference counted. Use AddRefResource and ReleaseResource in | 32 * Resources are reference counted. Use <code>AddRefResource()</code> |
33 * ppb_core.h to manage the reference count of a resource. The data will be | 33 * and <code>ReleaseResource()</code> in <code>ppb_core.h</code> to manage the |
34 * automatically destroyed when the internal reference count reaches 0. | 34 * reference count of a resource. The data will be automatically destroyed when |
| 35 * the internal reference count reaches 0. |
35 */ | 36 */ |
36 typedef int32_t PP_Resource; | 37 typedef int32_t PP_Resource; |
37 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Resource, 4); | 38 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Resource, 4); |
38 /** | 39 /** |
39 * @} | 40 * @} |
40 */ | 41 */ |
41 | 42 |
42 #endif /* PPAPI_C_PP_RESOURCE_H_ */ | 43 #endif /* PPAPI_C_PP_RESOURCE_H_ */ |
43 | 44 |
OLD | NEW |