Diff
Modified: trunk/Source/WebCore/ChangeLog (111415 => 111416)
--- trunk/Source/WebCore/ChangeLog 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/ChangeLog 2012-03-20 18:26:51 UTC (rev 111416)
@@ -1,3 +1,52 @@
+2012-03-20 Vineet Chaudhary <[email protected]>
+
+ https://bugs.webkit.org/show_bug.cgi?id=80696
+ Remove custom bindings for attribute type Array.
+
+ Reviewed by Kentaro Hara.
+
+ No new tests.
+
+ * bindings/js/JSConsoleCustom.cpp: Removed custom function.
+ (WebCore):
+ * bindings/js/JSDOMBinding.h: Added template jsArray and toNativeArray.
+ (WebCore):
+ (WebCore::jsArray):
+ (WebCore::toNativeArray):
+ * bindings/scripts/CodeGenerator.pm: Modified codegenerators to generate appropriate code.
+ (GetArrayType): Added GetArrayType to get return type of attribute interface.
+ * bindings/scripts/CodeGeneratorGObject.pm: Modified codegenerators to generate appropriate code.
+ (SkipAttribute):
+ * bindings/scripts/CodeGeneratorJS.pm: Modified codegenerators to generate appropriate code.
+ (AddIncludesForType):
+ (JSValueToNative):
+ (NativeToJSValue):
+ * bindings/scripts/CodeGeneratorV8.pm: Modified codegenerators to generate appropriate code.
+ (GenerateNormalAttrGetter):
+ (GenerateNormalAttrSetter):
+ (JSValueToNative):
+ (NativeToJSValue):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Updated results from running binding tests.
+ (webkit_dom_test_obj_get_property):
+ (webkit_dom_test_obj_class_init):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h: Ditto.
+ * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
+ (WebCore::jsTestObjSequenceAttr):
+ (WebCore::setJSTestObjSequenceAttr):
+ (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence):
+ * bindings/scripts/test/V8/V8TestObj.cpp: Ditto.
+ (WebCore::TestObjInternal::sequenceAttrAttrGetter):
+ (WebCore::TestObjInternal::sequenceAttrAttrSetter):
+ (WebCore::TestObjInternal::methodReturningSequenceCallback):
+ * bindings/v8/V8Binding.h: Added template v8Array and toNativeArray.
+ (WebCore):
+ (WebCore::v8Array):
+ (WebCore::toNativeArray):
+ * bindings/v8/custom/V8ConsoleCustom.cpp: Removed custom function.
+ (WebCore):
+ * page/Console.idl: Replaced attribute type Array to sequence<SriptProfile> to remove
+ custom bindings.
+
2012-03-20 Sheriff Bot <[email protected]>
Unreviewed, rolling out r111310.
Modified: trunk/Source/WebCore/bindings/js/JSConsoleCustom.cpp (111415 => 111416)
--- trunk/Source/WebCore/bindings/js/JSConsoleCustom.cpp 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/bindings/js/JSConsoleCustom.cpp 2012-03-20 18:26:51 UTC (rev 111416)
@@ -30,31 +30,14 @@
#include "JSConsole.h"
#include "Console.h"
-#include "JSScriptProfile.h"
#include "ScriptCallStack.h"
#include "ScriptCallStackFactory.h"
-#include "ScriptProfile.h"
-#include <runtime/JSArray.h>
#include <wtf/OwnPtr.h>
using namespace JSC;
namespace WebCore {
-typedef Vector<RefPtr<ScriptProfile> > ProfilesArray;
-
-JSValue JSConsole::profiles(ExecState* exec) const
-{
- const ProfilesArray& profiles = impl()->profiles();
- MarkedArgumentBuffer list;
-
- ProfilesArray::const_iterator end = profiles.end();
- for (ProfilesArray::const_iterator iter = profiles.begin(); iter != end; ++iter)
- list.append(toJS(exec, globalObject(), iter->get()));
-
- return constructArray(exec, globalObject(), list);
-}
-
JSValue JSConsole::profile(ExecState* exec)
{
RefPtr<ScriptCallStack> callStack(createScriptCallStack(exec, 1));
Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (111415 => 111416)
--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2012-03-20 18:26:51 UTC (rev 111416)
@@ -35,6 +35,7 @@
#include "StyledElement.h"
#include <heap/Weak.h>
#include <runtime/FunctionPrototype.h>
+#include <runtime/JSArray.h>
#include <runtime/Lookup.h>
#include <runtime/ObjectPrototype.h>
#include <wtf/Forward.h>
@@ -278,6 +279,34 @@
return toJS(exec, globalObject, ptr.get());
}
+ template <typename Iterable>
+ JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Iterable& iterator)
+ {
+ JSC::MarkedArgumentBuffer list;
+ typename Iterable::const_iterator end = iterator.end();
+
+ for (typename Iterable::const_iterator iter = iterator.begin(); iter != end; ++iter)
+ list.append(toJS(exec, globalObject, WTF::getPtr(*iter)));
+
+ return JSC::constructArray(exec, list);
+ }
+
+ template <class T>
+ Vector<T> toNativeArray(JSC::ExecState* exec, JSC::JSValue value)
+ {
+ if (!isJSArray(value))
+ return Vector<T>();
+
+ Vector<T> result;
+ JSC::JSArray* array = asArray(value);
+
+ for (unsigned i = 0; i < array->length(); ++i) {
+ String indexedValue = ustringToString(array->getIndex(i).toString(exec)->value(exec));
+ result.append(indexedValue);
+ }
+ return result;
+ }
+
// Validates that the passed object is a sequence type per section 4.1.13 of the WebIDL spec.
JSC::JSObject* toJSSequence(JSC::ExecState*, JSC::JSValue, unsigned&);
Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (111415 => 111416)
--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2012-03-20 18:26:51 UTC (rev 111416)
@@ -445,6 +445,15 @@
return 0;
}
+sub GetArrayType
+{
+ my $object = shift;
+ my $type = shift;
+
+ return $1 if $type =~ /^sequence<([\w\d_]+)>.*/;
+ return "";
+}
+
# Uppercase the first letter while respecting WebKit style guidelines.
# E.g., xmlEncoding becomes XMLEncoding, but xmlllang becomes Xmllang.
sub WK_ucfirst
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (111415 => 111416)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm 2012-03-20 18:26:51 UTC (rev 111416)
@@ -164,6 +164,10 @@
return 1;
}
+ if ($codeGenerator->GetArrayType($propType)) {
+ return 1;
+ }
+
# This is for DOMWindow.idl location attribute
if ($attribute->signature->name eq "location") {
return 1;
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (111415 => 111416)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2012-03-20 18:26:51 UTC (rev 111416)
@@ -266,6 +266,7 @@
$includesRef->{"JS${type}.h"} = 1;
} elsif (IsTypedArrayType($type)) {
$includesRef->{"<wtf/${type}.h>"} = 1;
+ } elsif ($codeGenerator->GetArrayType($type)) {
} else {
# default, include the same named file
$includesRef->{"${type}.h"} = 1;
@@ -2945,6 +2946,10 @@
AddToImplIncludes("JSCustomVoidCallback.h", $conditional) if $type eq "VoidCallback";
AddToImplIncludes("Event.h", $conditional) if $type eq "Event";
+ if ($codeGenerator->GetArrayType($type)) {
+ return "toNativeArray(exec, $value)";
+ }
+
# Default, assume autogenerated type conversion routines
AddToImplIncludes("JS$type.h", $conditional);
return "to$type($value)";
@@ -3004,6 +3009,14 @@
AddToImplIncludes("NameNodeList.h", $conditional);
}
+ my $arrayType = $codeGenerator->GetArrayType($type);
+ if ($arrayType) {
+ AddToImplIncludes("<runtime/JSArray.h>", $conditional);
+ AddToImplIncludes("JS$arrayType.h", $conditional);
+ AddToImplIncludes("$arrayType.h", $conditional);
+ return "jsArray(exec, $thisValue->globalObject(), $value)";
+ }
+
if ($type eq "DOMObject") {
if ($implClassName eq "Document") {
AddToImplIncludes("JSCanvasRenderingContext2D.h", $conditional);
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (111415 => 111416)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-03-20 18:26:51 UTC (rev 111416)
@@ -923,6 +923,17 @@
if (!IsNodeSubType($dataNode) && $attrName ne "self" && (IsWrapperType($returnType) && ($attribute->type =~ /^readonly/ || $attribute->signature->extendedAttributes->{"Replaceable"})
&& $returnType ne "EventTarget" && $returnType ne "SerializedScriptValue" && $returnType ne "DOMWindow"
&& $returnType !~ /SVG/ && $returnType !~ /HTML/ && !IsDOMNodeType($returnType))) {
+
+ my $arrayType = $codeGenerator->GetArrayType($returnType);
+ if ($arrayType) {
+ AddToImplIncludes("V8$arrayType.h");
+ AddToImplIncludes("$arrayType.h");
+ push(@implContentDecls, " const Vector<RefPtr<$arrayType> > vector = ${getterString};\n");
+ push(@implContentDecls, " return v8Array(vector);\n");
+ push(@implContentDecls, "}\n\n");
+ return;
+ }
+
AddIncludesForType($returnType);
# Check for a wrapper in the wrapper cache. If there is one, we know that a hidden reference has already
# been created. If we don't find a wrapper, we create both a wrapper and a hidden reference.
@@ -1097,16 +1108,20 @@
}
} else {
my $value = JSValueToNative($attribute->signature, "value");
+ my $arrayType = $codeGenerator->GetArrayType($nativeType);
+
if ($nativeType =~ /^V8Parameter/) {
- push(@implContentDecls, " " . ConvertToV8Parameter($attribute->signature, $nativeType, "v", $value, "VOID") . "\n");
+ push(@implContentDecls, " " . ConvertToV8Parameter($attribute->signature, $nativeType, "v", $value, "VOID") . "\n");
+ } elsif ($arrayType) {
+ push(@implContentDecls, " Vector<$arrayType> v = $value;\n");
} else {
- push(@implContentDecls, " $nativeType v = $value;\n");
+ push(@implContentDecls, " $nativeType v = $value;\n");
}
}
my $result = "v";
my $returnType = GetTypeFromSignature($attribute->signature);
- if (IsRefPtrType($returnType)) {
+ if (IsRefPtrType($returnType) && !$codeGenerator->GetArrayType($returnType)) {
$result = "WTF::getPtr(" . $result . ")";
}
@@ -3554,6 +3569,10 @@
return "V8DOMWrapper::getXPathNSResolver($value)";
}
+ if ($codeGenerator->GetArrayType($type)) {
+ return "toNativeArray($value)";
+ }
+
AddIncludesForType($type);
if (IsDOMNodeType($type)) {
@@ -3767,6 +3786,13 @@
return "v8String($value)";
}
+ my $arrayType = $codeGenerator->GetArrayType($type);
+ if ($arrayType) {
+ AddToImplIncludes("V8$arrayType.h");
+ AddToImplIncludes("$arrayType.h");
+ return "v8Array($value)";
+ }
+
AddIncludesForType($type);
# special case for non-DOM node interfaces
Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp (111415 => 111416)
--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp 2012-03-20 18:26:51 UTC (rev 111416)
@@ -810,32 +810,6 @@
item->setTestObjAttr(converted_value);
}
-WebKitDOMsequence<ScriptProfile>*
-webkit_dom_test_obj_get_sequence_attr(WebKitDOMTestObj* self)
-{
- g_return_val_if_fail(self, 0);
- WebCore::JSMainThreadNullState state;
- WebCore::TestObj * item = WebKit::core(self);
- PassRefPtr<WebCore::sequence<ScriptProfile>> g_res = WTF::getPtr(item->sequenceAttr());
- WebKitDOMsequence<ScriptProfile>* res = WebKit::kit(g_res.get());
- return res;
-}
-
-void
-webkit_dom_test_obj_set_sequence_attr(WebKitDOMTestObj* self, WebKitDOMsequence<ScriptProfile>* value)
-{
- g_return_if_fail(self);
- WebCore::JSMainThreadNullState state;
- WebCore::TestObj * item = WebKit::core(self);
- g_return_if_fail(value);
- WebCore::sequence<ScriptProfile> * converted_value = NULL;
- if (value != NULL) {
- converted_value = WebKit::core(value);
- g_return_if_fail(converted_value);
- }
- item->setSequenceAttr(converted_value);
-}
-
WebKitDOMTestObj*
webkit_dom_test_obj_get_xml_obj_attr(WebKitDOMTestObj* self)
{
@@ -1595,7 +1569,6 @@
PROP_UNSIGNED_LONG_LONG_ATTR,
PROP_STRING_ATTR,
PROP_TEST_OBJ_ATTR,
- PROP_SEQUENCE_ATTR,
PROP_XML_OBJ_ATTR,
PROP_CREATE,
PROP_REFLECTED_STRING_ATTR,
@@ -1855,12 +1828,6 @@
g_value_set_object(value, WebKit::kit(ptr.get()));
break;
}
- case PROP_SEQUENCE_ATTR:
- {
- RefPtr<WebCore::sequence<ScriptProfile>> ptr = coreSelf->sequenceAttr();
- g_value_set_object(value, WebKit::kit(ptr.get()));
- break;
- }
case PROP_XML_OBJ_ATTR:
{
RefPtr<WebCore::TestObj> ptr = coreSelf->xmlObjAttr();
@@ -2153,13 +2120,6 @@
WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
- PROP_SEQUENCE_ATTR,
- g_param_spec_object("sequence-attr", /* name */
- "test_obj_sequence-attr", /* short description */
- "read-write WebKitDOMsequence<ScriptProfile>* TestObj.sequence-attr", /* longer - could do with some extra doc stuff here */
- WEBKIT_TYPE_DOM_SEQUENCE<SCRIPT_PROFILE>, /* gobject type */
- WEBKIT_PARAM_READWRITE));
- g_object_class_install_property(gobjectClass,
PROP_XML_OBJ_ATTR,
g_param_spec_object("xml-obj-attr", /* name */
"test_obj_xml-obj-attr", /* short description */
Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h (111415 => 111416)
--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h 2012-03-20 18:26:51 UTC (rev 111416)
@@ -697,27 +697,6 @@
webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value);
/**
- * webkit_dom_test_obj_get_sequence_attr:
- * @self: A #WebKitDOMTestObj
- *
- * Returns: (transfer none):
- *
-**/
-WEBKIT_API WebKitDOMsequence<ScriptProfile>*
-webkit_dom_test_obj_get_sequence_attr(WebKitDOMTestObj* self);
-
-/**
- * webkit_dom_test_obj_set_sequence_attr:
- * @self: A #WebKitDOMTestObj
- * @value: A #WebKitDOMsequence<ScriptProfile>
- *
- * Returns: (transfer none):
- *
-**/
-WEBKIT_API void
-webkit_dom_test_obj_set_sequence_attr(WebKitDOMTestObj* self, WebKitDOMsequence<ScriptProfile>* value);
-
-/**
* webkit_dom_test_obj_get_xml_obj_attr:
* @self: A #WebKitDOMTestObj
*
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (111415 => 111416)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2012-03-20 18:26:51 UTC (rev 111416)
@@ -33,6 +33,7 @@
#include "JSEventListener.h"
#include "JSSVGDocument.h"
#include "JSSVGPoint.h"
+#include "JSScriptProfile.h"
#include "JSTestCallback.h"
#include "JSTestObj.h"
#include "JSa.h"
@@ -43,18 +44,18 @@
#include "JSe.h"
#include "JSint.h"
#include "JSsequence.h"
-#include "JSsequence<ScriptProfile>.h"
#include "KURL.h"
#include "SVGDocument.h"
#include "SVGStaticPropertyTearOff.h"
#include "ScriptArguments.h"
#include "ScriptCallStack.h"
#include "ScriptCallStackFactory.h"
+#include "ScriptProfile.h"
#include "SerializedScriptValue.h"
#include "TestObj.h"
#include "bool.h"
-#include "sequence<ScriptProfile>.h"
#include <runtime/Error.h>
+#include <runtime/JSArray.h>
#include <runtime/JSString.h>
#include <wtf/GetPtr.h>
@@ -477,7 +478,7 @@
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->sequenceAttr()));
+ JSValue result = jsArray(exec, castedThis->globalObject(), impl->sequenceAttr());
return result;
}
@@ -965,7 +966,7 @@
{
JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- impl->setSequenceAttr(tosequence<ScriptProfile>(value));
+ impl->setSequenceAttr(toNativeArray(exec, value));
}
@@ -1423,7 +1424,7 @@
if (exec->hadException())
return JSValue::encode(jsUndefined());
- JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->methodReturningSequence(intArg)));
+ JSC::JSValue result = jsArray(exec, castedThis->globalObject(), impl->methodReturningSequence(intArg));
return JSValue::encode(result);
}
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp (111415 => 111416)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp 2012-03-20 18:26:51 UTC (rev 111416)
@@ -32,6 +32,7 @@
#include "ScriptArguments.h"
#include "ScriptCallStack.h"
#include "ScriptCallStackFactory.h"
+#include "ScriptProfile.h"
#include "SerializedScriptValue.h"
#include "V8Binding.h"
#include "V8BindingMacros.h"
@@ -42,6 +43,7 @@
#include "V8Proxy.h"
#include "V8SVGDocument.h"
#include "V8SVGPoint.h"
+#include "V8ScriptProfile.h"
#include "V8TestCallback.h"
#include "V8a.h"
#include "V8any.h"
@@ -52,7 +54,6 @@
#include "V8e.h"
#include "V8int.h"
#include "V8sequence.h"
-#include "V8sequence<ScriptProfile>.h"
#include <wtf/GetPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
@@ -223,15 +224,15 @@
{
INC_STATS("DOM.TestObj.sequenceAttr._get");
TestObj* imp = V8TestObj::toNative(info.Holder());
- return toV8(imp->sequenceAttr());
+ return v8Array(imp->sequenceAttr());
}
static void sequenceAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.TestObj.sequenceAttr._set");
TestObj* imp = V8TestObj::toNative(info.Holder());
- sequence<ScriptProfile>* v = V8sequence<ScriptProfile>::HasInstance(value) ? V8sequence<ScriptProfile>::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
- imp->setSequenceAttr(WTF::getPtr(v));
+ Vector<ScriptProfile> v = toNativeArray(value);
+ imp->setSequenceAttr(v);
return;
}
@@ -1071,7 +1072,7 @@
return throwError("Not enough arguments", V8Proxy::TypeError);
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
- return toV8(imp->methodReturningSequence(intArg));
+ return v8Array(imp->methodReturningSequence(intArg));
}
static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsCallback(const v8::Arguments& args)
Modified: trunk/Source/WebCore/bindings/v8/V8Binding.h (111415 => 111416)
--- trunk/Source/WebCore/bindings/v8/V8Binding.h 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.h 2012-03-20 18:26:51 UTC (rev 111416)
@@ -286,6 +286,35 @@
return v8ExternalString(string);
}
+ template<typename Iterable>
+ v8::Handle<v8::Value> v8Array(const Iterable& iterator)
+ {
+ v8::Local<v8::Array> result = v8::Array::New(iterator.size());
+ int index = 0;
+ typename Iterable::const_iterator end = iterator.end();
+ for (typename Iterable::const_iterator iter = iterator.begin(); iter != end; ++iter)
+ result->Set(v8::Integer::New(index++), toV8(WTF::getPtr(*iter)));
+ return result;
+ }
+
+ template <class T>
+ Vector<T> toNativeArray(v8::Handle<v8::Value> value)
+ {
+ if (!value->IsArray())
+ return Vector<T>();
+
+ Vector<T> result;
+ v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(value));
+ v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(v8Value);
+ size_t length = array->Length();
+
+ for (size_t i = 0; i < length; ++i) {
+ String indexedValue = v8StringToWebCoreString(array->Get(i));
+ result.append(indexedValue);
+ }
+ return result;
+ }
+
// Enables caching v8 wrappers created for WTF::StringImpl. Currently this cache requires
// all the calls (both to convert WTF::String to v8::String and to GC the handle)
// to be performed on the main thread.
Modified: trunk/Source/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp (111415 => 111416)
--- trunk/Source/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp 2012-03-20 18:26:51 UTC (rev 111416)
@@ -36,32 +36,13 @@
#include "ScriptArguments.h"
#include "ScriptCallStack.h"
#include "ScriptCallStackFactory.h"
-#include "ScriptProfile.h"
#include "V8Binding.h"
#include "V8BindingMacros.h"
#include "V8MemoryInfo.h"
#include "V8Proxy.h"
-#include "V8ScriptProfile.h"
namespace WebCore {
-typedef Vector<RefPtr<ScriptProfile> > ProfilesArray;
-
-#if ENABLE(_javascript__DEBUGGER)
-v8::Handle<v8::Value> V8Console::profilesAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- INC_STATS("DOM.Console.profilesAccessorGetter");
- Console* imp = V8Console::toNative(info.Holder());
- const ProfilesArray& profiles = imp->profiles();
- v8::Handle<v8::Array> result = v8::Array::New(profiles.size());
- int index = 0;
- ProfilesArray::const_iterator end = profiles.end();
- for (ProfilesArray::const_iterator iter = profiles.begin(); iter != end; ++iter)
- result->Set(v8::Integer::New(index++), toV8(iter->get()));
- return result;
-}
-#endif
-
v8::Handle<v8::Value> V8Console::traceCallback(const v8::Arguments& args)
{
INC_STATS("DOM.Console.traceCallback");
Modified: trunk/Source/WebCore/page/Console.idl (111415 => 111416)
--- trunk/Source/WebCore/page/Console.idl 2012-03-20 18:18:22 UTC (rev 111415)
+++ trunk/Source/WebCore/page/Console.idl 2012-03-20 18:26:51 UTC (rev 111416)
@@ -46,7 +46,7 @@
[CallWith=ScriptArguments|CallStack] void markTimeline();
#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
- readonly attribute [CustomGetter] Array profiles;
+ readonly attribute sequence<ScriptProfile> profiles;
[Custom] void profile(in DOMString title);
[Custom] void profileEnd(in DOMString title);
#endif