- Revision
- 122608
- Author
- [email protected]
- Date
- 2012-07-13 11:15:52 -0700 (Fri, 13 Jul 2012)
Log 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (122607 => 122608)
--- trunk/Source/WebCore/ChangeLog 2012-07-13 18:11:35 UTC (rev 122607)
+++ trunk/Source/WebCore/ChangeLog 2012-07-13 18:15:52 UTC (rev 122608)
@@ -1,3 +1,39 @@
+2012-07-13 Kentaro Hara <[email protected]>
+
+ [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):
+
2012-07-13 Mary Wu <[email protected]>
[BlackBerry] Some small changes in network code
Modified: trunk/Source/WebCore/Modules/filesystem/DataTransferItemFileSystem.h (122607 => 122608)
--- trunk/Source/WebCore/Modules/filesystem/DataTransferItemFileSystem.h 2012-07-13 18:11:35 UTC (rev 122607)
+++ trunk/Source/WebCore/Modules/filesystem/DataTransferItemFileSystem.h 2012-07-13 18:15:52 UTC (rev 122608)
@@ -43,7 +43,7 @@
class DataTransferItemFileSystem {
public:
- static PassRefPtr<Entry> webkitGetAsEntry(DataTransferItem*, ScriptExecutionContext*);
+ static PassRefPtr<Entry> webkitGetAsEntry(ScriptExecutionContext*, DataTransferItem*);
private:
DataTransferItemFileSystem();
Modified: trunk/Source/WebCore/Modules/filesystem/HTMLInputElementFileSystem.cpp (122607 => 122608)
--- trunk/Source/WebCore/Modules/filesystem/HTMLInputElementFileSystem.cpp 2012-07-13 18:11:35 UTC (rev 122607)
+++ trunk/Source/WebCore/Modules/filesystem/HTMLInputElementFileSystem.cpp 2012-07-13 18:15:52 UTC (rev 122608)
@@ -46,7 +46,7 @@
namespace WebCore {
// static
-PassRefPtr<EntryArray> HTMLInputElementFileSystem::webkitEntries(HTMLInputElement* input, ScriptExecutionContext* scriptExecutionContext)
+PassRefPtr<EntryArray> HTMLInputElementFileSystem::webkitEntries(ScriptExecutionContext* scriptExecutionContext, HTMLInputElement* input)
{
RefPtr<EntryArray> array = EntryArray::create();
Modified: trunk/Source/WebCore/Modules/filesystem/HTMLInputElementFileSystem.h (122607 => 122608)
--- trunk/Source/WebCore/Modules/filesystem/HTMLInputElementFileSystem.h 2012-07-13 18:11:35 UTC (rev 122607)
+++ trunk/Source/WebCore/Modules/filesystem/HTMLInputElementFileSystem.h 2012-07-13 18:15:52 UTC (rev 122608)
@@ -41,7 +41,7 @@
class HTMLInputElementFileSystem {
public:
- static PassRefPtr<EntryArray> webkitEntries(HTMLInputElement*, ScriptExecutionContext*);
+ static PassRefPtr<EntryArray> webkitEntries(ScriptExecutionContext*, HTMLInputElement*);
private:
HTMLInputElementFileSystem();
Modified: trunk/Source/WebCore/Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp (122607 => 122608)
--- trunk/Source/WebCore/Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp 2012-07-13 18:11:35 UTC (rev 122607)
+++ trunk/Source/WebCore/Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp 2012-07-13 18:15:52 UTC (rev 122608)
@@ -51,7 +51,7 @@
namespace WebCore {
// static
-PassRefPtr<Entry> DataTransferItemFileSystem::webkitGetAsEntry(DataTransferItem* item, ScriptExecutionContext* scriptExecutionContext)
+PassRefPtr<Entry> DataTransferItemFileSystem::webkitGetAsEntry(ScriptExecutionContext* scriptExecutionContext, DataTransferItem* item)
{
DataTransferItemPolicyWrapper* itemPolicyWrapper = static_cast<DataTransferItemPolicyWrapper*>(item);
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (122607 => 122608)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-07-13 18:11:35 UTC (rev 122607)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-07-13 18:15:52 UTC (rev 122608)
@@ -922,9 +922,6 @@
if ($getterStringUsesImp) {
my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute);
-
- push(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContentDecls, " ", 0, 0));
-
push(@arguments, "ec") if $useExceptions;
if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
@@ -934,6 +931,7 @@
} else {
$functionName = "imp->${functionName}";
}
+ unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContentDecls, " ", 0, 0));
$getterString = "${functionName}(" . join(", ", @arguments) . ")";
} else {
$getterString = "impInstance";
@@ -1215,9 +1213,6 @@
push(@implContentDecls, ");\n");
} else {
my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute);
-
- push(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContentDecls, " ", 1, 0));
-
push(@arguments, $result);
push(@arguments, "ec") if $useExceptions;
if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
@@ -1228,6 +1223,7 @@
} else {
$functionName = "imp->${functionName}";
}
+ unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContentDecls, " ", 1, 0));
push(@implContentDecls, " ${functionName}(" . join(", ", @arguments) . ");\n");
}
}
@@ -3374,7 +3370,7 @@
my @callWithOutput = ();
my @callWithArgs = GenerateCallWith($callWith, \@callWithOutput, $indent, 0, 1, $function);
$result .= join("", @callWithOutput);
- push(@arguments, @callWithArgs);
+ unshift(@arguments, @callWithArgs);
$index += @callWithArgs;
$numberOfParameters += @callWithArgs;
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp (122607 => 122608)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp 2012-07-13 18:11:35 UTC (rev 122607)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp 2012-07-13 18:15:52 UTC (rev 122608)
@@ -134,7 +134,7 @@
ScriptExecutionContext* scriptContext = getScriptExecutionContext();
if (!scriptContext)
return v8::Undefined();
- RefPtr<TestObj> result = TestSupplemental::supplementalMethod2(imp, scriptContext, strArg, objArg, ec);
+ RefPtr<TestObj> result = TestSupplemental::supplementalMethod2(scriptContext, imp, strArg, objArg, ec);
if (UNLIKELY(ec))
goto fail;
return toV8(result.release(), args.GetIsolate());