| 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 CONTENT_RENDERER_PEPPER_PLUGIN_OBJECT_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_OBJECT_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_OBJECT_H_ | 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_OBJECT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 // Allocates a new PluginObject and returns it as a PP_Var with a | 42 // Allocates a new PluginObject and returns it as a PP_Var with a |
| 43 // refcount of 1. | 43 // refcount of 1. |
| 44 static PP_Var Create(PepperPluginInstanceImpl* instance, | 44 static PP_Var Create(PepperPluginInstanceImpl* instance, |
| 45 const PPP_Class_Deprecated* ppp_class, | 45 const PPP_Class_Deprecated* ppp_class, |
| 46 void* ppp_class_data); | 46 void* ppp_class_data); |
| 47 | 47 |
| 48 // gin::NamedPropertyInterceptor | 48 // gin::NamedPropertyInterceptor |
| 49 virtual v8::Local<v8::Value> GetNamedProperty( | 49 virtual v8::Local<v8::Value> GetNamedProperty( |
| 50 v8::Isolate* isolate, | 50 v8::Isolate* isolate, |
| 51 const std::string& property) OVERRIDE; | 51 const std::string& property) override; |
| 52 virtual std::vector<std::string> EnumerateNamedProperties( | 52 virtual std::vector<std::string> EnumerateNamedProperties( |
| 53 v8::Isolate* isolate) OVERRIDE; | 53 v8::Isolate* isolate) override; |
| 54 | 54 |
| 55 const PPP_Class_Deprecated* ppp_class() { return ppp_class_; } | 55 const PPP_Class_Deprecated* ppp_class() { return ppp_class_; } |
| 56 void* ppp_class_data() { return ppp_class_data_; } | 56 void* ppp_class_data() { return ppp_class_data_; } |
| 57 | 57 |
| 58 // Called when the instance is destroyed. | 58 // Called when the instance is destroyed. |
| 59 void InstanceDeleted(); | 59 void InstanceDeleted(); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 PluginObject(PepperPluginInstanceImpl* instance, | 62 PluginObject(PepperPluginInstanceImpl* instance, |
| 63 const PPP_Class_Deprecated* ppp_class, | 63 const PPP_Class_Deprecated* ppp_class, |
| 64 void* ppp_class_data); | 64 void* ppp_class_data); |
| 65 | 65 |
| 66 // gin::Wrappable | 66 // gin::Wrappable |
| 67 virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder( | 67 virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder( |
| 68 v8::Isolate* isolate) OVERRIDE; | 68 v8::Isolate* isolate) override; |
| 69 | 69 |
| 70 // Helper method to get named properties. | 70 // Helper method to get named properties. |
| 71 v8::Local<v8::Value> GetPropertyOrMethod(v8::Isolate* isolate, | 71 v8::Local<v8::Value> GetPropertyOrMethod(v8::Isolate* isolate, |
| 72 PP_Var identifier_var); | 72 PP_Var identifier_var); |
| 73 | 73 |
| 74 void Call(const std::string& identifier, gin::Arguments* args); | 74 void Call(const std::string& identifier, gin::Arguments* args); |
| 75 | 75 |
| 76 PepperPluginInstanceImpl* instance_; | 76 PepperPluginInstanceImpl* instance_; |
| 77 | 77 |
| 78 const PPP_Class_Deprecated* ppp_class_; | 78 const PPP_Class_Deprecated* ppp_class_; |
| 79 void* ppp_class_data_; | 79 void* ppp_class_data_; |
| 80 | 80 |
| 81 base::WeakPtrFactory<PluginObject> weak_factory_; | 81 base::WeakPtrFactory<PluginObject> weak_factory_; |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(PluginObject); | 83 DISALLOW_COPY_AND_ASSIGN(PluginObject); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace content | 86 } // namespace content |
| 87 | 87 |
| 88 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_OBJECT_H_ | 88 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_OBJECT_H_ |
| OLD | NEW |