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 WEBKIT_PLUGINS_PPAPI_NPOBJECT_VAR_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_NPOBJECT_VAR_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_NPOBJECT_VAR_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_NPOBJECT_VAR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "ppapi/c/pp_instance.h" | 11 #include "ppapi/c/pp_instance.h" |
12 #include "ppapi/c/pp_module.h" | 12 #include "ppapi/c/pp_module.h" |
13 #include "ppapi/shared_impl/var.h" | 13 #include "ppapi/shared_impl/var.h" |
| 14 #include "webkit/plugins/webkit_plugins_export.h" |
14 | 15 |
15 typedef struct NPObject NPObject; | 16 typedef struct NPObject NPObject; |
16 typedef struct _NPVariant NPVariant; | 17 typedef struct _NPVariant NPVariant; |
17 typedef void* NPIdentifier; | 18 typedef void* NPIdentifier; |
18 | 19 |
19 namespace ppapi { | 20 namespace ppapi { |
20 | 21 |
21 // NPObjectVar ----------------------------------------------------------------- | 22 // NPObjectVar ----------------------------------------------------------------- |
22 | 23 |
23 // Represents a JavaScript object Var. By itself, this represents random | 24 // Represents a JavaScript object Var. By itself, this represents random |
(...skipping 23 matching lines...) Expand all Loading... |
47 | 48 |
48 // Notification that the instance was deleted, the internal reference will be | 49 // Notification that the instance was deleted, the internal reference will be |
49 // zeroed out. | 50 // zeroed out. |
50 void InstanceDeleted(); | 51 void InstanceDeleted(); |
51 | 52 |
52 // Possibly 0 if the object has outlived its instance. | 53 // Possibly 0 if the object has outlived its instance. |
53 PP_Instance pp_instance() const { return pp_instance_; } | 54 PP_Instance pp_instance() const { return pp_instance_; } |
54 | 55 |
55 // Helper function that converts a PP_Var to an object. This will return NULL | 56 // Helper function that converts a PP_Var to an object. This will return NULL |
56 // if the PP_Var is not of object type or the object is invalid. | 57 // if the PP_Var is not of object type or the object is invalid. |
57 static scoped_refptr<NPObjectVar> FromPPVar(PP_Var var); | 58 WEBKIT_PLUGINS_EXPORT static scoped_refptr<NPObjectVar> FromPPVar(PP_Var var); |
58 | 59 |
59 private: | 60 private: |
60 // Possibly 0 if the object has outlived its instance. | 61 // Possibly 0 if the object has outlived its instance. |
61 PP_Instance pp_instance_; | 62 PP_Instance pp_instance_; |
62 | 63 |
63 // Guaranteed non-NULL, this is the underlying object used by WebKit. We | 64 // Guaranteed non-NULL, this is the underlying object used by WebKit. We |
64 // hold a reference to this object. | 65 // hold a reference to this object. |
65 NPObject* np_object_; | 66 NPObject* np_object_; |
66 | 67 |
67 DISALLOW_COPY_AND_ASSIGN(NPObjectVar); | 68 DISALLOW_COPY_AND_ASSIGN(NPObjectVar); |
68 }; | 69 }; |
69 | 70 |
70 } // namespace | 71 } // namespace |
71 | 72 |
72 #endif // WEBKIT_PLUGINS_PPAPI_NPOBJECT_VAR_H_ | 73 #endif // WEBKIT_PLUGINS_PPAPI_NPOBJECT_VAR_H_ |
OLD | NEW |