Remove custom bindings form Internals.idl of attribute type Array.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2012 08:32:50 +0000 (08:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2012 08:32:50 +0000 (08:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82319

Patch by Vineet Chaudhary <rgf748@motorola.com> on 2012-03-29
Reviewed by Kentaro Hara.

Source/WebCore:

Remove custom bindings for Array type and replace Array type with sequence<String>.

No new tests. LayoutTests/fast/harness/user-preferred-language.html should pass
even after these changes.

* Target.pri: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
* UseJSC.cmake: Remove JSInternalsCustom.cpp.
* UseV8.cmake: Remove V8InternalsCustom.cpp.
* WebCore.gypi: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
* WebCore.vcproj/WebCoreTestSupport.vcproj: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
* WebCore.xcodeproj/project.pbxproj: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
* bindings/js/JSDOMBinding.h:
(WebCore):
(WebCore::jsArray): Added new specialize function template for Strings.
* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative): Add jsArray<String>() to deduce return type.
(NativeToJSValue): Added check for type String.
* bindings/scripts/CodeGeneratorV8.pm:
(JSValueToNative): Add v8Array<String>() to deduce return type.
(NativeToJSValue): Added check for type String.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::setJSTestObjSequenceAttr): Modified results from run-binding-tests.
* bindings/scripts/test/V8/V8TestObj.cpp: Modified results from run-binding-tests.
(WebCore::TestObjInternal::sequenceAttrAttrSetter):
* bindings/v8/V8Binding.h: Added new specialize function template for Strings.
(WebCore):
(WebCore::v8Array):
(WebCore::toNativeArray):
* testing/Internals.idl: Replace Array type with sequence<String>
* testing/js/JSInternalsCustom.cpp: Removed.
* testing/v8/V8InternalsCustom.cpp: Removed.

Tools:

Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp as no longer required.

* GNUmakefile.am:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112506 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Target.pri
Source/WebCore/UseJSC.cmake
Source/WebCore/UseV8.cmake
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCoreTestSupport.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
Source/WebCore/bindings/v8/V8Binding.h
Source/WebCore/testing/Internals.idl
Source/WebCore/testing/js/JSInternalsCustom.cpp [deleted file]
Source/WebCore/testing/v8/V8InternalsCustom.cpp [deleted file]
Tools/ChangeLog
Tools/GNUmakefile.am

index cf0633a..012dfeb 100644 (file)
@@ -1,3 +1,42 @@
+2012-03-29  Vineet Chaudhary  <rgf748@motorola.com>
+
+        Remove custom bindings form Internals.idl of attribute type Array.
+        https://bugs.webkit.org/show_bug.cgi?id=82319
+
+        Reviewed by Kentaro Hara.
+
+        Remove custom bindings for Array type and replace Array type with sequence<String>.
+
+        No new tests. LayoutTests/fast/harness/user-preferred-language.html should pass
+        even after these changes.
+
+        * Target.pri: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
+        * UseJSC.cmake: Remove JSInternalsCustom.cpp.
+        * UseV8.cmake: Remove V8InternalsCustom.cpp.
+        * WebCore.gypi: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
+        * WebCore.vcproj/WebCoreTestSupport.vcproj: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
+        * WebCore.xcodeproj/project.pbxproj: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
+        * bindings/js/JSDOMBinding.h:
+        (WebCore):
+        (WebCore::jsArray): Added new specialize function template for Strings.
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (JSValueToNative): Add jsArray<String>() to deduce return type.
+        (NativeToJSValue): Added check for type String.
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (JSValueToNative): Add v8Array<String>() to deduce return type.
+        (NativeToJSValue): Added check for type String.
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::setJSTestObjSequenceAttr): Modified results from run-binding-tests.
+        * bindings/scripts/test/V8/V8TestObj.cpp: Modified results from run-binding-tests.
+        (WebCore::TestObjInternal::sequenceAttrAttrSetter):
+        * bindings/v8/V8Binding.h: Added new specialize function template for Strings.
+        (WebCore):
+        (WebCore::v8Array):
+        (WebCore::toNativeArray):
+        * testing/Internals.idl: Replace Array type with sequence<String>
+        * testing/js/JSInternalsCustom.cpp: Removed.
+        * testing/v8/V8InternalsCustom.cpp: Removed.
+
 2012-03-29  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r112500.
index ff4dae2..1fdc69c 100644 (file)
@@ -237,7 +237,6 @@ v8 {
         bindings/v8/custom/V8ConsoleCustom.cpp \
         bindings/v8/custom/V8SQLTransactionSyncCustom.cpp \
         bindings/v8/V8WorkerContextErrorHandler.cpp \
-        testing/v8/V8InternalsCustom.cpp \
         testing/v8/WebCoreTestSupport.cpp
 } else {
     SOURCES += \
@@ -398,7 +397,6 @@ v8 {
         bridge/runtime_method.cpp \
         bridge/runtime_object.cpp \
         bridge/runtime_root.cpp \
-        testing/js/JSInternalsCustom.cpp \
         testing/js/WebCoreTestSupport.cpp
 }
 
index 09038dd..06497a4 100644 (file)
@@ -169,7 +169,6 @@ LIST(APPEND WebCore_SOURCES
 )
 
 LIST(APPEND WebCoreTestSupport_SOURCES
-    testing/js/JSInternalsCustom.cpp
     testing/js/WebCoreTestSupport.cpp
 )
 
index 09f2908..22f94fe 100755 (executable)
@@ -164,7 +164,6 @@ LIST(APPEND WebCore_SOURCES
 )
 
 LIST(APPEND WebCoreTestSupport_SOURCES
-    testing/v8/V8InternalsCustom.cpp
     testing/v8/WebCoreTestSupport.cpp
 )
 
index 8ce42dd..2a38f77 100644 (file)
           'testing/InternalSettings.idl',
         ],
         'webcore_test_support_files': [
-            'testing/v8/V8InternalsCustom.cpp',
             'testing/v8/WebCoreTestSupport.cpp',
             'testing/v8/WebCoreTestSupport.h',
-            'testing/js/JSInternalsCustom.cpp',
             'testing/js/WebCoreTestSupport.cpp',
             'testing/js/WebCoreTestSupport.h',
             'testing/Internals.cpp',
index 0606ade..b07d1a7 100644 (file)
                                RelativePath="..\testing\js\WebCoreTestSupport.h"
                                >
                        </File>
-                       <File
-                               RelativePath="..\testing\js\JSInternalsCustom.cpp"
-                               >
-                               <FileConfiguration
-                                       Name="Debug|Win32"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               UsePrecompiledHeader="0"
-                                               DisableSpecificWarnings="4065;4273;4565;4701;4702"
-                                               ForcedIncludeFiles="$(NOINHERIT)"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release|Win32"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               UsePrecompiledHeader="0"
-                                               DisableSpecificWarnings="4065;4273;4565;4701;4702"
-                                               ForcedIncludeFiles="$(NOINHERIT)"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug_Cairo_CFLite|Win32"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               UsePrecompiledHeader="0"
-                                               DisableSpecificWarnings="4065;4273;4565;4701;4702"
-                                               ForcedIncludeFiles="$(NOINHERIT)"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release_Cairo_CFLite|Win32"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               UsePrecompiledHeader="0"
-                                               DisableSpecificWarnings="4065;4273;4565;4701;4702"
-                                               ForcedIncludeFiles="$(NOINHERIT)"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug_All|Win32"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               UsePrecompiledHeader="0"
-                                               DisableSpecificWarnings="4065;4273;4565;4701;4702"
-                                               ForcedIncludeFiles="$(NOINHERIT)"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Production|Win32"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               UsePrecompiledHeader="0"
-                                               DisableSpecificWarnings="4065;4273;4565;4701;4702"
-                                               ForcedIncludeFiles="$(NOINHERIT)"
-                                       />
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\testing\js\JSInternalsCustom.h"
-                               >
-                       </File>
                </Filter>
                <File
                        RelativePath="..\config.h"
index b81dcfb..f2008c3 100644 (file)
                0709FC4E1025DEE30059CDBA /* AccessibilitySlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 0709FC4D1025DEE30059CDBA /* AccessibilitySlider.h */; };
                0720B0A014D3323500642955 /* GenericEventQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0720B09E14D3323500642955 /* GenericEventQueue.cpp */; };
                0720B0A114D3323500642955 /* GenericEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0720B09F14D3323500642955 /* GenericEventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               07230CBC14C10ED900F6B702 /* JSInternalsCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07230CBB14C10ED900F6B702 /* JSInternalsCustom.cpp */; };
                072C8B11131C518600A4FCE9 /* MediaPlayerPrivateAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076F0D0912B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.cpp */; };
                0735EE6A0F40C5E4004A2604 /* MediaPlayerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0753860214489E9800B78452 /* CachedTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0753860014489E9800B78452 /* CachedTextTrack.cpp */; };
                070DD8F50F01868000727DEB /* mediaControls.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mediaControls.css; sourceTree = "<group>"; };
                0720B09E14D3323500642955 /* GenericEventQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GenericEventQueue.cpp; sourceTree = "<group>"; };
                0720B09F14D3323500642955 /* GenericEventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericEventQueue.h; sourceTree = "<group>"; };
-               07230CBB14C10ED900F6B702 /* JSInternalsCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInternalsCustom.cpp; sourceTree = "<group>"; };
                0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerProxy.h; sourceTree = "<group>"; };
                0753860014489E9800B78452 /* CachedTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedTextTrack.cpp; sourceTree = "<group>"; };
                0753860114489E9800B78452 /* CachedTextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedTextTrack.h; sourceTree = "<group>"; };
                41815C1B138319630057AAA4 /* js */ = {
                        isa = PBXGroup;
                        children = (
-                               07230CBB14C10ED900F6B702 /* JSInternalsCustom.cpp */,
                                41815C1C138319830057AAA4 /* WebCoreTestSupport.cpp */,
                                41815C1D138319830057AAA4 /* WebCoreTestSupport.h */,
                        );
                                417DA6D913734E6E007C57FB /* Internals.cpp in Sources */,
                                A7BF7EDF14C9175A0014489D /* InternalSettings.cpp in Sources */,
                                417DA71D13735DFA007C57FB /* JSInternals.cpp in Sources */,
-                               07230CBC14C10ED900F6B702 /* JSInternalsCustom.cpp in Sources */,
                                A740B5A714C935AF00A77FA4 /* JSInternalSettings.cpp in Sources */,
                                41815C1E138319830057AAA4 /* WebCoreTestSupport.cpp in Sources */,
                        );
index 79a3daf..b049d9b 100644 (file)
@@ -279,18 +279,30 @@ enum ParameterDefaultPolicy {
         return toJS(exec, globalObject, ptr.get());
     }
 
-    template <typename Iterable>
-    JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Iterable& iterator)
+    template <typename T>
+    JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<T>& iterator)
     {
         JSC::MarkedArgumentBuffer list;
-        typename Iterable::const_iterator end = iterator.end();
+        typename Vector<T>::const_iterator end = iterator.end();
 
-        for (typename Iterable::const_iterator iter = iterator.begin(); iter != end; ++iter)
+        for (typename Vector<T>::const_iterator iter = iterator.begin(); iter != end; ++iter)
             list.append(toJS(exec, globalObject, WTF::getPtr(*iter)));
 
         return JSC::constructArray(exec, globalObject, list);
     }
 
+    template<>
+    inline JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<String>& iterator)
+    {
+        JSC::MarkedArgumentBuffer array;
+        Vector<String>::const_iterator end = iterator.end();
+
+        for (Vector<String>::const_iterator it = iterator.begin(); it != end; ++it)
+            array.append(jsString(exec, stringToUString(*it)));
+
+        return JSC::constructArray(exec, globalObject, array);
+    }
+
     template <class T>
     Vector<T> toNativeArray(JSC::ExecState* exec, JSC::JSValue value)
     {
index cea2f52..f77878c 100644 (file)
@@ -2937,8 +2937,9 @@ sub JSValueToNative
     AddToImplIncludes("JSCustomVoidCallback.h", $conditional) if $type eq "VoidCallback";
     AddToImplIncludes("Event.h", $conditional) if $type eq "Event";
 
-    if ($codeGenerator->GetArrayType($type)) {
-        return "toNativeArray(exec, $value)";
+    my $arrayType = $codeGenerator->GetArrayType($type);
+    if ($arrayType) {
+        return "toNativeArray<$arrayType>(exec, $value)";
     }
 
     # Default, assume autogenerated type conversion routines
@@ -3002,9 +3003,11 @@ sub NativeToJSValue
 
     my $arrayType = $codeGenerator->GetArrayType($type);
     if ($arrayType) {
+        if ($arrayType ne "String") {
+            AddToImplIncludes("JS$arrayType.h", $conditional);
+            AddToImplIncludes("$arrayType.h", $conditional);
+        }
         AddToImplIncludes("<runtime/JSArray.h>", $conditional);
-        AddToImplIncludes("JS$arrayType.h", $conditional);
-        AddToImplIncludes("$arrayType.h", $conditional);
         return "jsArray(exec, $thisValue->globalObject(), $value)";
     }
 
index ebd8aae..84c6873 100644 (file)
@@ -3549,8 +3549,9 @@ sub JSValueToNative
         return "V8DOMWrapper::getXPathNSResolver($value)";
     }
 
-    if ($codeGenerator->GetArrayType($type)) {
-        return "toNativeArray($value)";
+    my $arrayType = $codeGenerator->GetArrayType($type);
+    if ($arrayType) {
+        return "toNativeArray<$arrayType>($value)";
     }
 
     AddIncludesForType($type);
@@ -3768,8 +3769,10 @@ sub NativeToJSValue
 
     my $arrayType = $codeGenerator->GetArrayType($type);
     if ($arrayType) {
-        AddToImplIncludes("V8$arrayType.h");
-        AddToImplIncludes("$arrayType.h");
+        if ($arrayType ne "String") {
+            AddToImplIncludes("V8$arrayType.h");
+            AddToImplIncludes("$arrayType.h");
+        }
         return "v8Array($value)";
     }
 
index 33a4ea1..3182b5e 100644 (file)
@@ -984,7 +984,7 @@ void setJSTestObjSequenceAttr(ExecState* exec, JSObject* thisObject, JSValue val
 {
     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setSequenceAttr(toNativeArray(exec, value));
+    impl->setSequenceAttr(toNativeArray<ScriptProfile>(exec, value));
 }
 
 
index 4c2e2cf..99654f5 100644 (file)
@@ -231,7 +231,7 @@ static void sequenceAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Val
 {
     INC_STATS("DOM.TestObj.sequenceAttr._set");
     TestObj* imp = V8TestObj::toNative(info.Holder());
-    Vector<ScriptProfile> v = toNativeArray(value);
+    Vector<ScriptProfile> v = toNativeArray<ScriptProfile>(value);
     imp->setSequenceAttr(v);
     return;
 }
index bacd7e9..84ff237 100644 (file)
@@ -286,17 +286,28 @@ namespace WebCore {
         return v8ExternalString(string);
     }
 
-    template<typename Iterable>
-    v8::Handle<v8::Value> v8Array(const Iterable& iterator)
+    template<typename T>
+    v8::Handle<v8::Value> v8Array(const Vector<T>& 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)
+        typename Vector<T>::const_iterator end = iterator.end();
+        for (typename Vector<T>::const_iterator iter = iterator.begin(); iter != end; ++iter)
             result->Set(v8::Integer::New(index++), toV8(WTF::getPtr(*iter)));
         return result;
     }
 
+    template<>
+    inline v8::Handle<v8::Value> v8Array(const Vector<String>& iterator)
+    {
+        v8::Local<v8::Array> array = v8::Array::New(iterator.size());
+        Vector<String>::const_iterator end = iterator.end();
+        int index = 0;
+        for (Vector<String>::const_iterator iter = iterator.begin(); iter != end; ++iter)
+            array->Set(v8::Integer::New(index++), v8String(*iter));
+        return array;
+    }
+
     template <class T>
     Vector<T> toNativeArray(v8::Handle<v8::Value> value)
     {
@@ -309,8 +320,7 @@ namespace WebCore {
         size_t length = array->Length();
 
         for (size_t i = 0; i < length; ++i) {
-            String indexedValue = v8StringToWebCoreString(array->Get(i));
-            result.append(indexedValue);
+            result.append(v8ValueToWebCoreString(array->Get(i)));
         }
         return result;
     }
index 95fe9dc..7d98bea 100644 (file)
@@ -107,7 +107,7 @@ module window {
         boolean shouldDisplayTrackKind(in Document document, in DOMString trackKind) raises (DOMException);
 #endif
 
-        attribute [Custom] Array userPreferredLanguages;
+        attribute sequence<String> userPreferredLanguages;
 
         unsigned long wheelEventHandlerCount(in Document document) raises (DOMException);
         unsigned long touchEventHandlerCount(in Document document) raises (DOMException);
diff --git a/Source/WebCore/testing/js/JSInternalsCustom.cpp b/Source/WebCore/testing/js/JSInternalsCustom.cpp
deleted file mode 100644 (file)
index 93f9307..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-#include "JSInternals.h"
-
-#include <runtime/Error.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSInternals::userPreferredLanguages(ExecState* exec) const
-{
-    Internals* imp = static_cast<Internals*>(impl());
-    const Vector<String> languages = imp->userPreferredLanguages();
-    
-    MarkedArgumentBuffer array;
-    Vector<String>::const_iterator end = languages.end();
-    for (Vector<String>::const_iterator it = languages.begin(); it != end; ++it)
-        array.append(jsString(exec, stringToUString(*it)));
-    return constructArray(exec, globalObject(), array);
-}
-
-void JSInternals::setUserPreferredLanguages(ExecState* exec, JSValue value)
-{
-    if (!isJSArray(value)) {
-        throwError(exec, createSyntaxError(exec, "setUserPreferredLanguages: Expected Array"));
-        return;
-    }
-    
-    Vector<String> languages;
-    JSArray* array = asArray(value);
-    for (unsigned i = 0; i < array->length(); ++i) {
-        String language = ustringToString(array->getIndex(i).toString(exec)->value(exec));
-        languages.append(language);
-    }
-    
-    Internals* imp = static_cast<Internals*>(impl());
-    imp->setUserPreferredLanguages(languages);
-}
-    
-} // namespace WebCore
diff --git a/Source/WebCore/testing/v8/V8InternalsCustom.cpp b/Source/WebCore/testing/v8/V8InternalsCustom.cpp
deleted file mode 100644 (file)
index f704541..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-#include "V8Internals.h"
-
-#include "V8Binding.h"
-#include "V8Proxy.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8Internals::userPreferredLanguagesAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
-    Internals* internals = V8Internals::toNative(info.Holder());
-    const Vector<String> languages = internals->userPreferredLanguages();
-
-    v8::Local<v8::Array> array = v8::Array::New(languages.size());
-    Vector<String>::const_iterator end = languages.end();
-    int index = 0;
-    for (Vector<String>::const_iterator iter = languages.begin(); iter != end; ++iter)
-        array->Set(v8::Integer::New(index++), v8String(*iter));
-    return array;
-}
-
-void V8Internals::userPreferredLanguagesAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
-{
-    if (!value->IsArray()) {
-        throwError("setUserPreferredLanguages: Expected Array");
-        return;
-    }
-    
-    Vector<String> languages;
-
-    v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(value);
-    for (size_t i = 0; i < array->Length(); ++i)
-        languages.append(toWebCoreString(array->Get(i)));
-    
-    Internals* internals = V8Internals::toNative(info.Holder());
-    internals->setUserPreferredLanguages(languages);
-}
-    
-} // namespace WebCore
index e025402..059deca 100644 (file)
@@ -1,3 +1,14 @@
+2012-03-29  Vineet Chaudhary  <rgf748@motorola.com>
+
+        Remove custom bindings form Internals.idl of attribute type Array.
+        https://bugs.webkit.org/show_bug.cgi?id=82319
+
+        Reviewed by Kentaro Hara.
+
+        Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp as no longer required.
+
+        * GNUmakefile.am:
+
 2012-03-28  Mark Rowe  <mrowe@apple.com>
 
         Fix --no-saved-state.
index 982e271..e4a880a 100644 (file)
@@ -45,7 +45,6 @@ libWebCoreInternals_la_SOURCES = \
        Source/WebCore/testing/Internals.h \
        Source/WebCore/testing/InternalSettings.cpp \
        Source/WebCore/testing/InternalSettings.h \
-       Source/WebCore/testing/js/JSInternalsCustom.cpp \
        Source/WebCore/testing/js/WebCoreTestSupport.cpp \
        Source/WebCore/testing/js/WebCoreTestSupport.h