Changeset 122608 in webkit


Ignore:
Timestamp:
Jul 13, 2012 11:15:52 AM (12 years ago)
Author:
haraken@chromium.org
Message:

[CallWith=XXX] arguments should be placed at the head of method arguments
https://bugs.webkit.org/show_bug.cgi?id=91217

Reviewed by Adam Barth.

The EFL build with the ENABLE_FILE_SYSTEM flag caused a build error,
because CodeGeneratorJS.pm assumes webkitEntries(ScriptExecutionContext*, HTMLInputElement*)
but the actual signature is webkitEntries(HTMLInputElement*, ScriptExecutionContext*) (bug 91185).

Per https://trac.webkit.org/wiki/WebKitIDL#CallWith, [CallWith=XXX] arguments should be placed
at the head of the arguments. (i.e. the behavior of CodeGeneratorJS.pm is correct.)

Thus the correct fix is (1) to change the signature of webkitEntries() and webkitGetAsEntry()
so that ScriptExecutionContext* comes first and (2) to modify CodeGeneratorV8.pm to support the order.

Test: bindings/scripts/test/TestObj.idl

  • Modules/filesystem/DataTransferItemFileSystem.h: Placed ScriptExecutionContext* at the head of arguments.

(DataTransferItemFileSystem):

  • Modules/filesystem/HTMLInputElementFileSystem.cpp: Ditto.

(WebCore::HTMLInputElementFileSystem::webkitEntries):

  • Modules/filesystem/HTMLInputElementFileSystem.h: Ditto.

(HTMLInputElementFileSystem):

  • Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp: Ditto.

(WebCore::DataTransferItemFileSystem::webkitGetAsEntry):

  • bindings/scripts/CodeGeneratorV8.pm: Modified to support the correct order.

(GenerateNormalAttrGetter):
(GenerateNormalAttrSetter):
(GenerateFunctionCallString):

  • bindings/scripts/test/V8/V8TestInterface.cpp: Updated run-bindings-tests results.

(WebCore::TestInterfaceV8Internal::supplementalMethod2Callback):

Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r122604 r122608  
     12012-07-13  Kentaro Hara  <haraken@chromium.org>
     2
     3        [CallWith=XXX] arguments should be placed at the head of method arguments
     4        https://bugs.webkit.org/show_bug.cgi?id=91217
     5
     6        Reviewed by Adam Barth.
     7
     8        The EFL build with the ENABLE_FILE_SYSTEM flag caused a build error,
     9        because CodeGeneratorJS.pm assumes webkitEntries(ScriptExecutionContext*, HTMLInputElement*)
     10        but the actual signature is webkitEntries(HTMLInputElement*, ScriptExecutionContext*) (bug 91185).
     11
     12        Per https://trac.webkit.org/wiki/WebKitIDL#CallWith, [CallWith=XXX] arguments should be placed
     13        at the head of the arguments. (i.e. the behavior of CodeGeneratorJS.pm is correct.)
     14
     15        Thus the correct fix is (1) to change the signature of webkitEntries() and webkitGetAsEntry()
     16        so that ScriptExecutionContext* comes first and (2) to modify CodeGeneratorV8.pm to support the order.
     17
     18        Test: bindings/scripts/test/TestObj.idl
     19
     20        * Modules/filesystem/DataTransferItemFileSystem.h: Placed ScriptExecutionContext* at the head of arguments.
     21        (DataTransferItemFileSystem):
     22        * Modules/filesystem/HTMLInputElementFileSystem.cpp: Ditto.
     23        (WebCore::HTMLInputElementFileSystem::webkitEntries):
     24        * Modules/filesystem/HTMLInputElementFileSystem.h: Ditto.
     25        (HTMLInputElementFileSystem):
     26        * Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp: Ditto.
     27        (WebCore::DataTransferItemFileSystem::webkitGetAsEntry):
     28
     29        * bindings/scripts/CodeGeneratorV8.pm: Modified to support the correct order.
     30        (GenerateNormalAttrGetter):
     31        (GenerateNormalAttrSetter):
     32        (GenerateFunctionCallString):
     33
     34        * bindings/scripts/test/V8/V8TestInterface.cpp: Updated run-bindings-tests results.
     35        (WebCore::TestInterfaceV8Internal::supplementalMethod2Callback):
     36
    1372012-07-13  Mary Wu  <mary.wu@torchmobile.com.cn>
    238
  • trunk/Source/WebCore/Modules/filesystem/DataTransferItemFileSystem.h

    r119371 r122608  
    4444class DataTransferItemFileSystem {
    4545public:
    46     static PassRefPtr<Entry> webkitGetAsEntry(DataTransferItem*, ScriptExecutionContext*);
     46    static PassRefPtr<Entry> webkitGetAsEntry(ScriptExecutionContext*, DataTransferItem*);
    4747
    4848private:
  • trunk/Source/WebCore/Modules/filesystem/HTMLInputElementFileSystem.cpp

    r120667 r122608  
    4747
    4848// static
    49 PassRefPtr<EntryArray> HTMLInputElementFileSystem::webkitEntries(HTMLInputElement* input, ScriptExecutionContext* scriptExecutionContext)
     49PassRefPtr<EntryArray> HTMLInputElementFileSystem::webkitEntries(ScriptExecutionContext* scriptExecutionContext, HTMLInputElement* input)
    5050{
    5151    RefPtr<EntryArray> array = EntryArray::create();
  • trunk/Source/WebCore/Modules/filesystem/HTMLInputElementFileSystem.h

    r120667 r122608  
    4242class HTMLInputElementFileSystem {
    4343public:
    44     static PassRefPtr<EntryArray> webkitEntries(HTMLInputElement*, ScriptExecutionContext*);
     44    static PassRefPtr<EntryArray> webkitEntries(ScriptExecutionContext*, HTMLInputElement*);
    4545
    4646private:
  • trunk/Source/WebCore/Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp

    r119371 r122608  
    5252
    5353// static
    54 PassRefPtr<Entry> DataTransferItemFileSystem::webkitGetAsEntry(DataTransferItem* item, ScriptExecutionContext* scriptExecutionContext)
     54PassRefPtr<Entry> DataTransferItemFileSystem::webkitGetAsEntry(ScriptExecutionContext* scriptExecutionContext, DataTransferItem* item)
    5555{
    5656    DataTransferItemPolicyWrapper* itemPolicyWrapper = static_cast<DataTransferItemPolicyWrapper*>(item);
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r122535 r122608  
    923923    if ($getterStringUsesImp) {
    924924        my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute);
    925 
    926         push(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContentDecls, "    ", 0, 0));
    927 
    928925        push(@arguments, "ec") if $useExceptions;
    929926        if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
     
    935932            $functionName = "imp->${functionName}";
    936933        }
     934        unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContentDecls, "    ", 0, 0));
    937935        $getterString = "${functionName}(" . join(", ", @arguments) . ")";
    938936    } else {
     
    12161214        } else {
    12171215            my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute);
    1218 
    1219             push(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContentDecls, "    ", 1, 0));
    1220 
    12211216            push(@arguments, $result);
    12221217            push(@arguments, "ec") if $useExceptions;
     
    12291224                $functionName = "imp->${functionName}";
    12301225            }
     1226            unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContentDecls, "    ", 1, 0));
    12311227            push(@implContentDecls, "    ${functionName}(" . join(", ", @arguments) . ");\n");
    12321228        }
     
    33753371    my @callWithArgs = GenerateCallWith($callWith, \@callWithOutput, $indent, 0, 1, $function);
    33763372    $result .= join("", @callWithOutput);
    3377     push(@arguments, @callWithArgs);
     3373    unshift(@arguments, @callWithArgs);
    33783374    $index += @callWithArgs;
    33793375    $numberOfParameters += @callWithArgs;
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp

    r120968 r122608  
    135135    if (!scriptContext)
    136136        return v8::Undefined();
    137     RefPtr<TestObj> result = TestSupplemental::supplementalMethod2(imp, scriptContext, strArg, objArg, ec);
     137    RefPtr<TestObj> result = TestSupplemental::supplementalMethod2(scriptContext, imp, strArg, objArg, ec);
    138138    if (UNLIKELY(ec))
    139139        goto fail;
Note: See TracChangeset for help on using the changeset viewer.