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 WEBKIT_GLUE_PLUGINS_PEPPER_VAR_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_VAR_H_ |
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_VAR_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_VAR_H_ |
7 | 7 |
8 typedef struct _pp_Var PP_Var; | 8 typedef struct _pp_Var PP_Var; |
9 typedef struct _ppb_Var PPB_Var; | 9 typedef struct _ppb_Var PPB_Var; |
10 typedef struct NPObject NPObject; | 10 typedef struct NPObject NPObject; |
11 typedef struct _NPVariant NPVariant; | 11 typedef struct _NPVariant NPVariant; |
12 typedef void* NPIdentifier; | 12 typedef void* NPIdentifier; |
13 | 13 |
14 namespace pepper { | 14 namespace pepper { |
15 | 15 |
16 // There's no class implementing Var since it could represent a number of | 16 // There's no class implementing Var since it could represent a number of |
17 // objects. Instead, we just expose a getter for the interface implemented in | 17 // objects. Instead, we just expose a getter for the interface implemented in |
18 // the .cc file here. | 18 // the .cc file here. |
19 const PPB_Var* GetVarInterface(); | 19 const PPB_Var* GetVarInterface(); |
20 | 20 |
21 // Returns a PP_Var of type object that wraps the given NPObject. Calling this | 21 // Returns a PP_Var of type object that wraps the given NPObject. Calling this |
22 // function multiple times given the same NPObject results in the same PP_Var. | 22 // function multiple times given the same NPObject results in the same PP_Var. |
23 PP_Var NPObjectToPPVar(NPObject* object); | 23 PP_Var NPObjectToPPVar(NPObject* object); |
24 | 24 |
| 25 // Returns the NPObject corresponding to the PP_Var. This pointer has not been |
| 26 // retained, so you should not call WebBindings::releaseObject unless you first |
| 27 // call WebBindings::retainObject. |
| 28 NPObject* GetNPObject(PP_Var var); |
| 29 |
25 } // namespace pepper | 30 } // namespace pepper |
26 | 31 |
27 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_VAR_H_ | 32 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_VAR_H_ |
OLD | NEW |