OLD | NEW |
---|---|
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 /** | 6 /** |
7 * This file defines the <code>PPB_Var</code> struct. | 7 * This file defines the <code>PPB_Var</code> struct. |
8 */ | 8 */ |
9 | 9 |
10 label Chrome { | 10 label Chrome { |
11 M14 = 1.0, | 11 M14 = 1.0, |
12 M18 = 1.1 | 12 M18 = 1.1, |
13 M34 = 1.2 | |
13 }; | 14 }; |
14 | 15 |
15 /** | 16 /** |
16 * PPB_Var API | 17 * PPB_Var API |
17 */ | 18 */ |
18 interface PPB_Var { | 19 interface PPB_Var { |
19 /** | 20 /** |
20 * AddRef() adds a reference to the given var. If this is not a refcounted | 21 * AddRef() adds a reference to the given var. If this is not a refcounted |
21 * object, this function will do nothing so you can always call it no matter | 22 * object, this function will do nothing so you can always call it no matter |
22 * what the type. | 23 * what the type. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 * If the instance frees its reference, the string will be freed and the | 106 * If the instance frees its reference, the string will be freed and the |
106 * pointer will be to arbitrary memory. | 107 * pointer will be to arbitrary memory. |
107 * | 108 * |
108 * @param[in] var A PP_Var struct containing a string-type var. | 109 * @param[in] var A PP_Var struct containing a string-type var. |
109 * @param[in,out] len A pointer to the length of the string-type var. | 110 * @param[in,out] len A pointer to the length of the string-type var. |
110 * | 111 * |
111 * @return A char* encoded in UTF-8. | 112 * @return A char* encoded in UTF-8. |
112 */ | 113 */ |
113 [version=1.0] | 114 [version=1.0] |
114 str_t VarToUtf8([in] PP_Var var, [out] uint32_t len); | 115 str_t VarToUtf8([in] PP_Var var, [out] uint32_t len); |
116 | |
117 /** | |
118 * Converts a resource-type var to a <code>PP_Resource</code>. | |
119 * | |
120 * @param[in] var A <code>PP_Var</code> struct containing a resource-type var. | |
121 * | |
122 * @return A <code>PP_Resource</code> retrieved from the var, or 0 if the var | |
123 * is not a resource. The reference count of the resource is incremented on | |
124 * behalf of the caller. | |
125 */ | |
126 [version=1.2] | |
127 PP_Resource VarToResource([in] PP_Var var); | |
128 | |
129 /** | |
130 * Creates a new <code>PP_Var</code> from a given resource. | |
131 * | |
132 * @param[in] resource A <code>PP_Resource</code> to be wrapped in a var. | |
133 * | |
134 * @return A <code>PP_Var</code> created for this resource, with type | |
135 * <code>PP_VARTYPE_RESOURCE</code>. The reference count of the var is set to | |
136 * 1 on behalf of the caller. | |
137 */ | |
138 [version=1.2] | |
139 PP_Var VarFromResource([in] PP_Resource resource); | |
dmichael (off chromium)
2014/02/06 17:25:01
I can't remember, can this hold any PP_Resource, o
Matt Giuca
2014/02/07 03:11:22
Yes, it can hold any PP_Resource. It will only che
| |
115 }; | 140 }; |
116 | 141 |
OLD | NEW |