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

Unified Diff: Source/bindings/v8/ScriptValue.cpp

Issue 23961005: Pass isolate to v8 integers factory functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/bindings/v8/ScriptPromiseResolverTest.cpp ('k') | Source/bindings/v8/custom/V8BlobCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptValue.cpp
diff --git a/Source/bindings/v8/ScriptValue.cpp b/Source/bindings/v8/ScriptValue.cpp
index dd41b0d1f010c32cf76c495ae4cc81504fe49c3b..b342697e1a64862b83b6e02b902417371b0f60f0 100644
--- a/Source/bindings/v8/ScriptValue.cpp
+++ b/Source/bindings/v8/ScriptValue.cpp
@@ -84,7 +84,7 @@ String ScriptValue::toString(ScriptState*) const
return v8StringToWebCoreString<String>(string, DoNotExternalize);
}
-static PassRefPtr<JSONValue> v8ToJSONValue(v8::Handle<v8::Value> value, int maxDepth)
+static PassRefPtr<JSONValue> v8ToJSONValue(v8::Handle<v8::Value> value, int maxDepth, v8::Isolate* isolate)
{
if (value.IsEmpty()) {
ASSERT_NOT_REACHED();
@@ -108,8 +108,8 @@ static PassRefPtr<JSONValue> v8ToJSONValue(v8::Handle<v8::Value> value, int maxD
RefPtr<JSONArray> inspectorArray = JSONArray::create();
uint32_t length = array->Length();
for (uint32_t i = 0; i < length; i++) {
- v8::Local<v8::Value> value = array->Get(v8::Int32::New(i));
- RefPtr<JSONValue> element = v8ToJSONValue(value, maxDepth);
+ v8::Local<v8::Value> value = array->Get(v8::Int32::New(i, isolate));
+ RefPtr<JSONValue> element = v8ToJSONValue(value, maxDepth, isolate);
if (!element)
return 0;
inspectorArray->pushValue(element);
@@ -122,11 +122,11 @@ static PassRefPtr<JSONValue> v8ToJSONValue(v8::Handle<v8::Value> value, int maxD
v8::Local<v8::Array> propertyNames = object->GetPropertyNames();
uint32_t length = propertyNames->Length();
for (uint32_t i = 0; i < length; i++) {
- v8::Local<v8::Value> name = propertyNames->Get(v8::Int32::New(i));
+ v8::Local<v8::Value> name = propertyNames->Get(v8::Int32::New(i, isolate));
// FIXME(yurys): v8::Object should support GetOwnPropertyNames
if (name->IsString() && !object->HasRealNamedProperty(v8::Handle<v8::String>::Cast(name)))
continue;
- RefPtr<JSONValue> propertyValue = v8ToJSONValue(object->Get(name), maxDepth);
+ RefPtr<JSONValue> propertyValue = v8ToJSONValue(object->Get(name), maxDepth, isolate);
if (!propertyValue)
return 0;
jsonObject->setValue(toWebCoreStringWithNullCheck(name), propertyValue);
@@ -142,7 +142,7 @@ PassRefPtr<JSONValue> ScriptValue::toJSONValue(ScriptState* scriptState) const
v8::HandleScope handleScope(scriptState->isolate());
// v8::Object::GetPropertyNames() expects current context to be not null.
v8::Context::Scope contextScope(scriptState->context());
- return v8ToJSONValue(v8Value(), JSONValue::maxDepth);
+ return v8ToJSONValue(v8Value(), JSONValue::maxDepth, scriptState->isolate());
}
} // namespace WebCore
« no previous file with comments | « Source/bindings/v8/ScriptPromiseResolverTest.cpp ('k') | Source/bindings/v8/custom/V8BlobCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698