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