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

Side by Side Diff: Source/bindings/core/v8/V8Binding.cpp

Issue 368313005: IDL: Add support for [TreatNullAs=EmptyString] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix debug compilation Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 v8::Local<v8::Array> propertyNames = object->GetPropertyNames(); 876 v8::Local<v8::Array> propertyNames = object->GetPropertyNames();
877 uint32_t length = propertyNames->Length(); 877 uint32_t length = propertyNames->Length();
878 for (uint32_t i = 0; i < length; i++) { 878 for (uint32_t i = 0; i < length; i++) {
879 v8::Local<v8::Value> name = propertyNames->Get(v8::Int32::New(isolat e, i)); 879 v8::Local<v8::Value> name = propertyNames->Get(v8::Int32::New(isolat e, i));
880 // FIXME(yurys): v8::Object should support GetOwnPropertyNames 880 // FIXME(yurys): v8::Object should support GetOwnPropertyNames
881 if (name->IsString() && !object->HasRealNamedProperty(v8::Handle<v8: :String>::Cast(name))) 881 if (name->IsString() && !object->HasRealNamedProperty(v8::Handle<v8: :String>::Cast(name)))
882 continue; 882 continue;
883 RefPtr<JSONValue> propertyValue = v8ToJSONValue(isolate, object->Get (name), maxDepth); 883 RefPtr<JSONValue> propertyValue = v8ToJSONValue(isolate, object->Get (name), maxDepth);
884 if (!propertyValue) 884 if (!propertyValue)
885 return nullptr; 885 return nullptr;
886 TOSTRING_DEFAULT(V8StringResource<WithNullCheck>, nameString, name, nullptr); 886 TOSTRING_DEFAULT(V8StringResource<TreatNullAsNullString>, nameString , name, nullptr);
887 jsonObject->setValue(nameString, propertyValue); 887 jsonObject->setValue(nameString, propertyValue);
888 } 888 }
889 return jsonObject; 889 return jsonObject;
890 } 890 }
891 ASSERT_NOT_REACHED(); 891 ASSERT_NOT_REACHED();
892 return nullptr; 892 return nullptr;
893 } 893 }
894 894
895 V8TestingScope::V8TestingScope(v8::Isolate* isolate) 895 V8TestingScope::V8TestingScope(v8::Isolate* isolate)
896 : m_handleScope(isolate) 896 : m_handleScope(isolate)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate) 932 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate)
933 { 933 {
934 int scriptId = 0; 934 int scriptId = 0;
935 String resourceName; 935 String resourceName;
936 int lineNumber = 1; 936 int lineNumber = 1;
937 GetDevToolsFunctionInfo(function, isolate, scriptId, resourceName, lineNumbe r); 937 GetDevToolsFunctionInfo(function, isolate, scriptId, resourceName, lineNumbe r);
938 return InspectorFunctionCallEvent::data(context, scriptId, resourceName, lin eNumber); 938 return InspectorFunctionCallEvent::data(context, scriptId, resourceName, lin eNumber);
939 } 939 }
940 940
941 } // namespace WebCore 941 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptEventListener.cpp ('k') | Source/bindings/core/v8/V8StringResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698