Chromium Code Reviews| 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 #include "content/renderer/pepper/plugin_object.h" | 5 #include "content/renderer/pepper/plugin_object.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 | 42 |
| 43 namespace { | 43 namespace { |
| 44 | 44 |
| 45 const char kInvalidValueException[] = "Error: Invalid value"; | 45 const char kInvalidValueException[] = "Error: Invalid value"; |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 // PluginObject ---------------------------------------------------------------- | 49 // PluginObject ---------------------------------------------------------------- |
| 50 | 50 |
| 51 PluginObject::~PluginObject() { | 51 PluginObject::~PluginObject() { |
| 52 if (instance_) { | 52 ppp_class_->Deallocate(ppp_class_data_); |
|
piman
2016/03/29 18:28:51
So, in theory, we are not supposed to call back in
| |
| 53 ppp_class_->Deallocate(ppp_class_data_); | 53 if (instance_) |
| 54 instance_->RemovePluginObject(this); | 54 instance_->RemovePluginObject(this); |
| 55 } | |
| 56 } | 55 } |
| 57 | 56 |
| 58 // static | 57 // static |
| 59 gin::WrapperInfo PluginObject::kWrapperInfo = {gin::kEmbedderNativeGin}; | 58 gin::WrapperInfo PluginObject::kWrapperInfo = {gin::kEmbedderNativeGin}; |
| 60 | 59 |
| 61 // static | 60 // static |
| 62 PluginObject* PluginObject::FromV8Object(v8::Isolate* isolate, | 61 PluginObject* PluginObject::FromV8Object(v8::Isolate* isolate, |
| 63 v8::Local<v8::Object> v8_object) { | 62 v8::Local<v8::Object> v8_object) { |
| 64 PluginObject* plugin_object; | 63 PluginObject* plugin_object; |
| 65 if (!v8_object.IsEmpty() && | 64 if (!v8_object.IsEmpty() && |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 297 return function_template; | 296 return function_template; |
| 298 function_template = | 297 function_template = |
| 299 gin::CreateFunctionTemplate( | 298 gin::CreateFunctionTemplate( |
| 300 isolate, base::Bind(&PluginObject::Call, weak_factory_.GetWeakPtr(), | 299 isolate, base::Bind(&PluginObject::Call, weak_factory_.GetWeakPtr(), |
| 301 name)); | 300 name)); |
| 302 template_cache_.Set(name, function_template); | 301 template_cache_.Set(name, function_template); |
| 303 return function_template; | 302 return function_template; |
| 304 } | 303 } |
| 305 | 304 |
| 306 } // namespace content | 305 } // namespace content |
| OLD | NEW |