Changeset 112506 in webkit


Ignore:
Timestamp:
Mar 29, 2012 1:32:50 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Remove custom bindings form Internals.idl of attribute type Array.
https://bugs.webkit.org/show_bug.cgi?id=82319

Patch by Vineet Chaudhary <Vineet> 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:
Location:
trunk
Files:
2 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112505 r112506  
     12012-03-29  Vineet Chaudhary  <rgf748@motorola.com>
     2
     3        Remove custom bindings form Internals.idl of attribute type Array.
     4        https://bugs.webkit.org/show_bug.cgi?id=82319
     5
     6        Reviewed by Kentaro Hara.
     7
     8        Remove custom bindings for Array type and replace Array type with sequence<String>.
     9
     10        No new tests. LayoutTests/fast/harness/user-preferred-language.html should pass
     11        even after these changes.
     12
     13        * Target.pri: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
     14        * UseJSC.cmake: Remove JSInternalsCustom.cpp.
     15        * UseV8.cmake: Remove V8InternalsCustom.cpp.
     16        * WebCore.gypi: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
     17        * WebCore.vcproj/WebCoreTestSupport.vcproj: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
     18        * WebCore.xcodeproj/project.pbxproj: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
     19        * bindings/js/JSDOMBinding.h:
     20        (WebCore):
     21        (WebCore::jsArray): Added new specialize function template for Strings.
     22        * bindings/scripts/CodeGeneratorJS.pm:
     23        (JSValueToNative): Add jsArray<String>() to deduce return type.
     24        (NativeToJSValue): Added check for type String.
     25        * bindings/scripts/CodeGeneratorV8.pm:
     26        (JSValueToNative): Add v8Array<String>() to deduce return type.
     27        (NativeToJSValue): Added check for type String.
     28        * bindings/scripts/test/JS/JSTestObj.cpp:
     29        (WebCore::setJSTestObjSequenceAttr): Modified results from run-binding-tests.
     30        * bindings/scripts/test/V8/V8TestObj.cpp: Modified results from run-binding-tests.
     31        (WebCore::TestObjInternal::sequenceAttrAttrSetter):
     32        * bindings/v8/V8Binding.h: Added new specialize function template for Strings.
     33        (WebCore):
     34        (WebCore::v8Array):
     35        (WebCore::toNativeArray):
     36        * testing/Internals.idl: Replace Array type with sequence<String>
     37        * testing/js/JSInternalsCustom.cpp: Removed.
     38        * testing/v8/V8InternalsCustom.cpp: Removed.
     39
    1402012-03-29  Sheriff Bot  <webkit.review.bot@gmail.com>
    241
  • trunk/Source/WebCore/Target.pri

    r112453 r112506  
    238238        bindings/v8/custom/V8SQLTransactionSyncCustom.cpp \
    239239        bindings/v8/V8WorkerContextErrorHandler.cpp \
    240         testing/v8/V8InternalsCustom.cpp \
    241240        testing/v8/WebCoreTestSupport.cpp
    242241} else {
     
    399398        bridge/runtime_object.cpp \
    400399        bridge/runtime_root.cpp \
    401         testing/js/JSInternalsCustom.cpp \
    402400        testing/js/WebCoreTestSupport.cpp
    403401}
  • trunk/Source/WebCore/UseJSC.cmake

    r109787 r112506  
    170170
    171171LIST(APPEND WebCoreTestSupport_SOURCES
    172     testing/js/JSInternalsCustom.cpp
    173172    testing/js/WebCoreTestSupport.cpp
    174173)
  • trunk/Source/WebCore/UseV8.cmake

    r110788 r112506  
    165165
    166166LIST(APPEND WebCoreTestSupport_SOURCES
    167     testing/v8/V8InternalsCustom.cpp
    168167    testing/v8/WebCoreTestSupport.cpp
    169168)
  • trunk/Source/WebCore/WebCore.gypi

    r112490 r112506  
    61496149        ],
    61506150        'webcore_test_support_files': [
    6151             'testing/v8/V8InternalsCustom.cpp',
    61526151            'testing/v8/WebCoreTestSupport.cpp',
    61536152            'testing/v8/WebCoreTestSupport.h',
    6154             'testing/js/JSInternalsCustom.cpp',
    61556153            'testing/js/WebCoreTestSupport.cpp',
    61566154            'testing/js/WebCoreTestSupport.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCoreTestSupport.vcproj

    r105900 r112506  
    692692                                >
    693693                        </File>
    694                         <File
    695                                 RelativePath="..\testing\js\JSInternalsCustom.cpp"
    696                                 >
    697                                 <FileConfiguration
    698                                         Name="Debug|Win32"
    699                                         >
    700                                         <Tool
    701                                                 Name="VCCLCompilerTool"
    702                                                 UsePrecompiledHeader="0"
    703                                                 DisableSpecificWarnings="4065;4273;4565;4701;4702"
    704                                                 ForcedIncludeFiles="$(NOINHERIT)"
    705                                         />
    706                                 </FileConfiguration>
    707                                 <FileConfiguration
    708                                         Name="Release|Win32"
    709                                         >
    710                                         <Tool
    711                                                 Name="VCCLCompilerTool"
    712                                                 UsePrecompiledHeader="0"
    713                                                 DisableSpecificWarnings="4065;4273;4565;4701;4702"
    714                                                 ForcedIncludeFiles="$(NOINHERIT)"
    715                                         />
    716                                 </FileConfiguration>
    717                                 <FileConfiguration
    718                                         Name="Debug_Cairo_CFLite|Win32"
    719                                         >
    720                                         <Tool
    721                                                 Name="VCCLCompilerTool"
    722                                                 UsePrecompiledHeader="0"
    723                                                 DisableSpecificWarnings="4065;4273;4565;4701;4702"
    724                                                 ForcedIncludeFiles="$(NOINHERIT)"
    725                                         />
    726                                 </FileConfiguration>
    727                                 <FileConfiguration
    728                                         Name="Release_Cairo_CFLite|Win32"
    729                                         >
    730                                         <Tool
    731                                                 Name="VCCLCompilerTool"
    732                                                 UsePrecompiledHeader="0"
    733                                                 DisableSpecificWarnings="4065;4273;4565;4701;4702"
    734                                                 ForcedIncludeFiles="$(NOINHERIT)"
    735                                         />
    736                                 </FileConfiguration>
    737                                 <FileConfiguration
    738                                         Name="Debug_All|Win32"
    739                                         >
    740                                         <Tool
    741                                                 Name="VCCLCompilerTool"
    742                                                 UsePrecompiledHeader="0"
    743                                                 DisableSpecificWarnings="4065;4273;4565;4701;4702"
    744                                                 ForcedIncludeFiles="$(NOINHERIT)"
    745                                         />
    746                                 </FileConfiguration>
    747                                 <FileConfiguration
    748                                         Name="Production|Win32"
    749                                         >
    750                                         <Tool
    751                                                 Name="VCCLCompilerTool"
    752                                                 UsePrecompiledHeader="0"
    753                                                 DisableSpecificWarnings="4065;4273;4565;4701;4702"
    754                                                 ForcedIncludeFiles="$(NOINHERIT)"
    755                                         />
    756                                 </FileConfiguration>
    757                         </File>
    758                         <File
    759                                 RelativePath="..\testing\js\JSInternalsCustom.h"
    760                                 >
    761                         </File>
    762694                </Filter>
    763695                <File
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r112490 r112506  
    110110                0720B0A014D3323500642955 /* GenericEventQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0720B09E14D3323500642955 /* GenericEventQueue.cpp */; };
    111111                0720B0A114D3323500642955 /* GenericEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0720B09F14D3323500642955 /* GenericEventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
    112                 07230CBC14C10ED900F6B702 /* JSInternalsCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07230CBB14C10ED900F6B702 /* JSInternalsCustom.cpp */; };
    113112                072C8B11131C518600A4FCE9 /* MediaPlayerPrivateAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076F0D0912B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.cpp */; };
    114113                0735EE6A0F40C5E4004A2604 /* MediaPlayerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    68966895                0720B09E14D3323500642955 /* GenericEventQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GenericEventQueue.cpp; sourceTree = "<group>"; };
    68976896                0720B09F14D3323500642955 /* GenericEventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericEventQueue.h; sourceTree = "<group>"; };
    6898                 07230CBB14C10ED900F6B702 /* JSInternalsCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInternalsCustom.cpp; sourceTree = "<group>"; };
    68996897                0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerProxy.h; sourceTree = "<group>"; };
    69006898                0753860014489E9800B78452 /* CachedTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedTextTrack.cpp; sourceTree = "<group>"; };
     
    1453814536                        isa = PBXGroup;
    1453914537                        children = (
    14540                                 07230CBB14C10ED900F6B702 /* JSInternalsCustom.cpp */,
    1454114538                                41815C1C138319830057AAA4 /* WebCoreTestSupport.cpp */,
    1454214539                                41815C1D138319830057AAA4 /* WebCoreTestSupport.h */,
     
    2499624993                                A7BF7EDF14C9175A0014489D /* InternalSettings.cpp in Sources */,
    2499724994                                417DA71D13735DFA007C57FB /* JSInternals.cpp in Sources */,
    24998                                 07230CBC14C10ED900F6B702 /* JSInternalsCustom.cpp in Sources */,
    2499924995                                A740B5A714C935AF00A77FA4 /* JSInternalSettings.cpp in Sources */,
    2500024996                                41815C1E138319830057AAA4 /* WebCoreTestSupport.cpp in Sources */,
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.h

    r111520 r112506  
    280280    }
    281281
    282     template <typename Iterable>
    283     JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Iterable& iterator)
     282    template <typename T>
     283    JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<T>& iterator)
    284284    {
    285285        JSC::MarkedArgumentBuffer list;
    286         typename Iterable::const_iterator end = iterator.end();
    287 
    288         for (typename Iterable::const_iterator iter = iterator.begin(); iter != end; ++iter)
     286        typename Vector<T>::const_iterator end = iterator.end();
     287
     288        for (typename Vector<T>::const_iterator iter = iterator.begin(); iter != end; ++iter)
    289289            list.append(toJS(exec, globalObject, WTF::getPtr(*iter)));
    290290
    291291        return JSC::constructArray(exec, globalObject, list);
     292    }
     293
     294    template<>
     295    inline JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<String>& iterator)
     296    {
     297        JSC::MarkedArgumentBuffer array;
     298        Vector<String>::const_iterator end = iterator.end();
     299
     300        for (Vector<String>::const_iterator it = iterator.begin(); it != end; ++it)
     301            array.append(jsString(exec, stringToUString(*it)));
     302
     303        return JSC::constructArray(exec, globalObject, array);
    292304    }
    293305
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r112036 r112506  
    29382938    AddToImplIncludes("Event.h", $conditional) if $type eq "Event";
    29392939
    2940     if ($codeGenerator->GetArrayType($type)) {
    2941         return "toNativeArray(exec, $value)";
     2940    my $arrayType = $codeGenerator->GetArrayType($type);
     2941    if ($arrayType) {
     2942        return "toNativeArray<$arrayType>(exec, $value)";
    29422943    }
    29432944
     
    30033004    my $arrayType = $codeGenerator->GetArrayType($type);
    30043005    if ($arrayType) {
     3006        if ($arrayType ne "String") {
     3007            AddToImplIncludes("JS$arrayType.h", $conditional);
     3008            AddToImplIncludes("$arrayType.h", $conditional);
     3009        }
    30053010        AddToImplIncludes("<runtime/JSArray.h>", $conditional);
    3006         AddToImplIncludes("JS$arrayType.h", $conditional);
    3007         AddToImplIncludes("$arrayType.h", $conditional);
    30083011        return "jsArray(exec, $thisValue->globalObject(), $value)";
    30093012    }
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r112318 r112506  
    35503550    }
    35513551
    3552     if ($codeGenerator->GetArrayType($type)) {
    3553         return "toNativeArray($value)";
     3552    my $arrayType = $codeGenerator->GetArrayType($type);
     3553    if ($arrayType) {
     3554        return "toNativeArray<$arrayType>($value)";
    35543555    }
    35553556
     
    37693770    my $arrayType = $codeGenerator->GetArrayType($type);
    37703771    if ($arrayType) {
    3771         AddToImplIncludes("V8$arrayType.h");
    3772         AddToImplIncludes("$arrayType.h");
     3772        if ($arrayType ne "String") {
     3773            AddToImplIncludes("V8$arrayType.h");
     3774            AddToImplIncludes("$arrayType.h");
     3775        }
    37733776        return "v8Array($value)";
    37743777    }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r111865 r112506  
    985985    JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
    986986    TestObj* impl = static_cast<TestObj*>(castedThis->impl());
    987     impl->setSequenceAttr(toNativeArray(exec, value));
     987    impl->setSequenceAttr(toNativeArray<ScriptProfile>(exec, value));
    988988}
    989989
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp

    r112318 r112506  
    232232    INC_STATS("DOM.TestObj.sequenceAttr._set");
    233233    TestObj* imp = V8TestObj::toNative(info.Holder());
    234     Vector<ScriptProfile> v = toNativeArray(value);
     234    Vector<ScriptProfile> v = toNativeArray<ScriptProfile>(value);
    235235    imp->setSequenceAttr(v);
    236236    return;
  • trunk/Source/WebCore/bindings/v8/V8Binding.h

    r111416 r112506  
    287287    }
    288288
    289     template<typename Iterable>
    290     v8::Handle<v8::Value> v8Array(const Iterable& iterator)
     289    template<typename T>
     290    v8::Handle<v8::Value> v8Array(const Vector<T>& iterator)
    291291    {
    292292        v8::Local<v8::Array> result = v8::Array::New(iterator.size());
    293293        int index = 0;
    294         typename Iterable::const_iterator end = iterator.end();
    295         for (typename Iterable::const_iterator iter = iterator.begin(); iter != end; ++iter)
     294        typename Vector<T>::const_iterator end = iterator.end();
     295        for (typename Vector<T>::const_iterator iter = iterator.begin(); iter != end; ++iter)
    296296            result->Set(v8::Integer::New(index++), toV8(WTF::getPtr(*iter)));
    297297        return result;
     298    }
     299
     300    template<>
     301    inline v8::Handle<v8::Value> v8Array(const Vector<String>& iterator)
     302    {
     303        v8::Local<v8::Array> array = v8::Array::New(iterator.size());
     304        Vector<String>::const_iterator end = iterator.end();
     305        int index = 0;
     306        for (Vector<String>::const_iterator iter = iterator.begin(); iter != end; ++iter)
     307            array->Set(v8::Integer::New(index++), v8String(*iter));
     308        return array;
    298309    }
    299310
     
    310321
    311322        for (size_t i = 0; i < length; ++i) {
    312             String indexedValue = v8StringToWebCoreString(array->Get(i));
    313             result.append(indexedValue);
     323            result.append(v8ValueToWebCoreString(array->Get(i)));
    314324        }
    315325        return result;
  • trunk/Source/WebCore/testing/Internals.idl

    r112055 r112506  
    108108#endif
    109109
    110         attribute [Custom] Array userPreferredLanguages;
     110        attribute sequence<String> userPreferredLanguages;
    111111
    112112        unsigned long wheelEventHandlerCount(in Document document) raises (DOMException);
  • trunk/Tools/ChangeLog

    r112486 r112506  
     12012-03-29  Vineet Chaudhary  <rgf748@motorola.com>
     2
     3        Remove custom bindings form Internals.idl of attribute type Array.
     4        https://bugs.webkit.org/show_bug.cgi?id=82319
     5
     6        Reviewed by Kentaro Hara.
     7
     8        Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp as no longer required.
     9
     10        * GNUmakefile.am:
     11
    1122012-03-28  Mark Rowe  <mrowe@apple.com>
    213
  • trunk/Tools/GNUmakefile.am

    r111340 r112506  
    4646        Source/WebCore/testing/InternalSettings.cpp \
    4747        Source/WebCore/testing/InternalSettings.h \
    48         Source/WebCore/testing/js/JSInternalsCustom.cpp \
    4948        Source/WebCore/testing/js/WebCoreTestSupport.cpp \
    5049        Source/WebCore/testing/js/WebCoreTestSupport.h
Note: See TracChangeset for help on using the changeset viewer.