Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1782)

Unified Diff: content/renderer/pepper/plugin_object.cc

Issue 635593004: PPAPI: Make V8VarConverter longer-lived (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/plugin_object.cc
diff --git a/content/renderer/pepper/plugin_object.cc b/content/renderer/pepper/plugin_object.cc
index 7260b01bb0bf75d6ef81f9e24f76026a05d7de2e..849e44a02fd4bc99c0491aab2835994cac2b6252 100644
--- a/content/renderer/pepper/plugin_object.cc
+++ b/content/renderer/pepper/plugin_object.cc
@@ -71,7 +71,9 @@ PluginObject* PluginObject::FromV8Object(v8::Isolate* isolate,
PP_Var PluginObject::Create(PepperPluginInstanceImpl* instance,
const PPP_Class_Deprecated* ppp_class,
void* ppp_class_data) {
- PepperTryCatchVar try_catch(instance, NULL);
+ V8VarConverter var_converter(instance->pp_instance(),
+ V8VarConverter::kAllowObjectVars);
+ PepperTryCatchVar try_catch(instance, &var_converter, NULL);
gin::Handle<PluginObject> object =
gin::CreateHandle(instance->GetIsolate(),
new PluginObject(instance, ppp_class, ppp_class_data));
@@ -94,8 +96,9 @@ std::vector<std::string> PluginObject::EnumerateNamedProperties(
if (!instance_)
return result;
- PepperTryCatchV8 try_catch(instance_, V8VarConverter::kAllowObjectVars,
- isolate);
+ V8VarConverter var_converter(instance_->pp_instance(),
+ V8VarConverter::kAllowObjectVars);
+ PepperTryCatchV8 try_catch(instance_, &var_converter, isolate);
PP_Var* name_vars;
uint32_t count = 0;
@@ -147,8 +150,9 @@ v8::Local<v8::Value> PluginObject::GetPropertyOrMethod(v8::Isolate* isolate,
if (!instance_)
return v8::Local<v8::Value>();
- PepperTryCatchV8 try_catch(instance_, V8VarConverter::kAllowObjectVars,
- isolate);
+ V8VarConverter var_converter(instance_->pp_instance(),
+ V8VarConverter::kAllowObjectVars);
+ PepperTryCatchV8 try_catch(instance_, &var_converter, isolate);
bool has_property =
ppp_class_->HasProperty(ppp_class_data_, identifier_var,
try_catch.exception());
@@ -192,8 +196,9 @@ void PluginObject::Call(const std::string& identifier,
if (!instance_)
return;
- PepperTryCatchV8 try_catch(instance_, V8VarConverter::kAllowObjectVars,
- args->isolate());
+ V8VarConverter var_converter(instance_->pp_instance(),
+ V8VarConverter::kAllowObjectVars);
+ PepperTryCatchV8 try_catch(instance_, &var_converter, args->isolate());
ScopedPPVar identifier_var(ScopedPPVar::PassRef(),
StringVar::StringToPPVar(identifier));
ScopedPPVarArray argument_vars(args->Length());

Powered by Google App Engine
This is Rietveld 408576698