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

Unified Diff: Source/bindings/core/v8/V8Binding.cpp

Issue 1021713003: [bindings] Let NativeValueTraits<T>::nativeValue be variadic function and merge various convers… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed the compiler error behind ASSERT flag Created 5 years, 9 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: Source/bindings/core/v8/V8Binding.cpp
diff --git a/Source/bindings/core/v8/V8Binding.cpp b/Source/bindings/core/v8/V8Binding.cpp
index a473a16d23097f154966c69e890bd8c03c4a14ac..a7bd2e9c750077eea87308237bfad71786a47713 100644
--- a/Source/bindings/core/v8/V8Binding.cpp
+++ b/Source/bindings/core/v8/V8Binding.cpp
@@ -835,7 +835,7 @@ v8::Isolate* toIsolate(LocalFrame* frame)
return frame->script().isolate();
}
-PassRefPtr<JSONValue> v8ToJSONValue(v8::Isolate* isolate, v8::Handle<v8::Value> value, int maxDepth)
+JSONValuePtr NativeValueTraits<JSONValuePtr>::nativeValue(v8::Local<v8::Value> value, v8::Isolate* isolate, ExceptionState& exceptionState, int maxDepth)
{
if (value.IsEmpty()) {
ASSERT_NOT_REACHED();
@@ -860,7 +860,7 @@ PassRefPtr<JSONValue> v8ToJSONValue(v8::Isolate* isolate, v8::Handle<v8::Value>
uint32_t length = array->Length();
for (uint32_t i = 0; i < length; i++) {
v8::Local<v8::Value> value = array->Get(v8::Int32::New(isolate, i));
- RefPtr<JSONValue> element = v8ToJSONValue(isolate, value, maxDepth);
+ RefPtr<JSONValue> element = nativeValue(value, isolate, exceptionState, maxDepth);
if (!element)
return nullptr;
inspectorArray->pushValue(element);
@@ -877,7 +877,7 @@ PassRefPtr<JSONValue> v8ToJSONValue(v8::Isolate* isolate, v8::Handle<v8::Value>
// FIXME(yurys): v8::Object should support GetOwnPropertyNames
if (name->IsString() && !object->HasRealNamedProperty(v8::Handle<v8::String>::Cast(name)))
continue;
- RefPtr<JSONValue> propertyValue = v8ToJSONValue(isolate, object->Get(name), maxDepth);
+ RefPtr<JSONValue> propertyValue = nativeValue(object->Get(name), isolate, exceptionState, maxDepth);
if (!propertyValue)
return nullptr;
TOSTRING_DEFAULT(V8StringResource<TreatNullAsNullString>, nameString, name, nullptr);

Powered by Google App Engine
This is Rietveld 408576698