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

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

Issue 744723002: remove some calls to to-be-deprecated v8::Value::To* functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/v8_var_converter.cc
diff --git a/content/renderer/pepper/v8_var_converter.cc b/content/renderer/pepper/v8_var_converter.cc
index 42d744d28729db928fddb3e532b4b59e8f68c9a6..5f506c8d3bc1ed8ac9214ba7c6d955efdc01b28b 100644
--- a/content/renderer/pepper/v8_var_converter.cc
+++ b/content/renderer/pepper/v8_var_converter.cc
@@ -199,34 +199,34 @@ bool GetOrCreateVar(v8::Handle<v8::Value> val,
CHECK(!val.IsEmpty());
*did_create = false;
+ v8::Isolate* isolate = context->GetIsolate();
// Even though every v8 string primitive encountered will be a unique object,
// we still add them to |visited_handles| so that the corresponding string
// PP_Var created will be properly refcounted.
if (val->IsObject() || val->IsString()) {
- if (parent_handles->count(HashedHandle(val->ToObject())) != 0)
+ if (parent_handles->count(HashedHandle(val->ToObject(isolate))) != 0)
return false;
HandleVarMap::const_iterator it =
- visited_handles->find(HashedHandle(val->ToObject()));
+ visited_handles->find(HashedHandle(val->ToObject(isolate)));
if (it != visited_handles->end()) {
*result = it->second.get();
return true;
}
}
- v8::Isolate* isolate = context->GetIsolate();
if (val->IsUndefined()) {
*result = PP_MakeUndefined();
} else if (val->IsNull()) {
*result = PP_MakeNull();
} else if (val->IsBoolean() || val->IsBooleanObject()) {
- *result = PP_MakeBool(PP_FromBool(val->ToBoolean()->Value()));
+ *result = PP_MakeBool(PP_FromBool(val->ToBoolean(isolate)->Value()));
} else if (val->IsInt32()) {
- *result = PP_MakeInt32(val->ToInt32()->Value());
+ *result = PP_MakeInt32(val->ToInt32(isolate)->Value());
} else if (val->IsNumber() || val->IsNumberObject()) {
- *result = PP_MakeDouble(val->ToNumber()->Value());
+ *result = PP_MakeDouble(val->ToNumber(isolate)->Value());
} else if (val->IsString() || val->IsStringObject()) {
- v8::String::Utf8Value utf8(val->ToString());
+ v8::String::Utf8Value utf8(val->ToString(isolate));
*result = StringVar::StringToPPVar(std::string(*utf8, utf8.length()));
} else if (val->IsObject()) {
// For any other v8 objects, the conversion happens as follows:
« no previous file with comments | « content/renderer/pepper/message_channel.cc ('k') | extensions/renderer/binding_generating_native_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698