Diff
Modified: trunk/Source/WebCore/ChangeLog (97286 => 97287)
--- trunk/Source/WebCore/ChangeLog 2011-10-12 19:28:12 UTC (rev 97286)
+++ trunk/Source/WebCore/ChangeLog 2011-10-12 19:28:29 UTC (rev 97287)
@@ -1,3 +1,30 @@
+2011-10-12 Anna Cavender <[email protected]>
+
+ Moving ScriptExecutionContext to the front of the argument list for
+ IDL constructors that use ConstructorWith=ScriptExecutionContext.
+ https://bugs.webkit.org/show_bug.cgi?id=69799
+
+ Reviewed by Adam Barth.
+
+ Tests:
+ - http/tests/eventsource/* (for EventSource)
+ - fast/filesystem/* (for Worker)
+
+ * bindings/js/JSEventSourceCustom.cpp:
+ (WebCore::JSEventSourceConstructor::constructJSEventSource):
+ * bindings/js/JSWorkerCustom.cpp:
+ (WebCore::JSWorkerConstructor::constructJSWorker):
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateConstructorCallback):
+ * bindings/scripts/test/V8/V8TestInterface.cpp:
+ (WebCore::V8TestInterface::constructorCallback):
+ * page/EventSource.cpp:
+ (WebCore::EventSource::create):
+ * page/EventSource.h:
+ * workers/Worker.cpp:
+ (WebCore::Worker::create):
+ * workers/Worker.h:
+
2011-10-11 David Hyatt <[email protected]>
https://bugs.webkit.org/show_bug.cgi?id=69896
Modified: trunk/Source/WebCore/bindings/js/JSEventSourceCustom.cpp (97286 => 97287)
--- trunk/Source/WebCore/bindings/js/JSEventSourceCustom.cpp 2011-10-12 19:28:12 UTC (rev 97286)
+++ trunk/Source/WebCore/bindings/js/JSEventSourceCustom.cpp 2011-10-12 19:28:29 UTC (rev 97287)
@@ -56,7 +56,7 @@
return throwVMError(exec, createReferenceError(exec, "EventSource constructor associated document is unavailable"));
ExceptionCode ec = 0;
- RefPtr<EventSource> eventSource = EventSource::create(ustringToString(url), context, ec);
+ RefPtr<EventSource> eventSource = EventSource::create(context, ustringToString(url), ec);
if (ec) {
setDOMException(exec, ec);
return JSValue::encode(JSValue());
Modified: trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp (97286 => 97287)
--- trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp 2011-10-12 19:28:12 UTC (rev 97286)
+++ trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp 2011-10-12 19:28:29 UTC (rev 97287)
@@ -65,7 +65,7 @@
DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
ExceptionCode ec = 0;
- RefPtr<Worker> worker = Worker::create(ustringToString(scriptURL), window->document(), ec);
+ RefPtr<Worker> worker = Worker::create(window->document(), ustringToString(scriptURL), ec);
if (ec) {
setDOMException(exec, ec);
return JSValue::encode(JSValue());
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (97286 => 97287)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2011-10-12 19:28:12 UTC (rev 97286)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2011-10-12 19:28:29 UTC (rev 97287)
@@ -1545,8 +1545,9 @@
my ($parameterCheckString, $paramIndex) = GenerateParametersCheck($function, $implClassName);
push(@implContent, $parameterCheckString);
+ my @contextArgument;
if ($dataNode->extendedAttributes->{"ConstructorWith"} && $dataNode->extendedAttributes->{"ConstructorWith"} eq "ScriptExecutionContext") {
- push(@extraArgumentList, "context");
+ push(@contextArgument, "context");
push(@implContent, <<END);
ScriptExecutionContext* context = getScriptExecutionContext();
@@ -1567,7 +1568,7 @@
$index++;
}
- my $argumentString = join(", ", @argumentList, @extraArgumentList);
+ my $argumentString = join(", ", @contextArgument, @argumentList, @extraArgumentList);
push(@implContent, "\n");
push(@implContent, " RefPtr<${implClassName}> obj = ${implClassName}::create(${argumentString});\n");
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp (97286 => 97287)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp 2011-10-12 19:28:12 UTC (rev 97286)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp 2011-10-12 19:28:29 UTC (rev 97287)
@@ -61,7 +61,7 @@
if (!context)
return throwError("TestInterface constructor's associated context is not available", V8Proxy::ReferenceError);
- RefPtr<TestInterface> obj = TestInterface::create(str1, str2, context, ec);
+ RefPtr<TestInterface> obj = TestInterface::create(context, str1, str2, ec);
if (ec)
goto fail;
Modified: trunk/Source/WebCore/page/EventSource.cpp (97286 => 97287)
--- trunk/Source/WebCore/page/EventSource.cpp 2011-10-12 19:28:12 UTC (rev 97286)
+++ trunk/Source/WebCore/page/EventSource.cpp 2011-10-12 19:28:29 UTC (rev 97287)
@@ -69,7 +69,7 @@
{
}
-PassRefPtr<EventSource> EventSource::create(const String& url, ScriptExecutionContext* context, ExceptionCode& ec)
+PassRefPtr<EventSource> EventSource::create(ScriptExecutionContext* context, const String& url, ExceptionCode& ec)
{
if (url.isEmpty()) {
ec = SYNTAX_ERR;
Modified: trunk/Source/WebCore/page/EventSource.h (97286 => 97287)
--- trunk/Source/WebCore/page/EventSource.h 2011-10-12 19:28:12 UTC (rev 97286)
+++ trunk/Source/WebCore/page/EventSource.h 2011-10-12 19:28:29 UTC (rev 97287)
@@ -51,7 +51,7 @@
class EventSource : public RefCounted<EventSource>, public EventTarget, private ThreadableLoaderClient, public ActiveDOMObject {
WTF_MAKE_FAST_ALLOCATED;
public:
- static PassRefPtr<EventSource> create(const String& url, ScriptExecutionContext*, ExceptionCode&);
+ static PassRefPtr<EventSource> create(ScriptExecutionContext*, const String& url, ExceptionCode&);
virtual ~EventSource();
static const unsigned long long defaultReconnectDelay;
Modified: trunk/Source/WebCore/workers/Worker.cpp (97286 => 97287)
--- trunk/Source/WebCore/workers/Worker.cpp 2011-10-12 19:28:12 UTC (rev 97286)
+++ trunk/Source/WebCore/workers/Worker.cpp 2011-10-12 19:28:29 UTC (rev 97287)
@@ -56,7 +56,7 @@
{
}
-PassRefPtr<Worker> Worker::create(const String& url, ScriptExecutionContext* context, ExceptionCode& ec)
+PassRefPtr<Worker> Worker::create(ScriptExecutionContext* context, const String& url, ExceptionCode& ec)
{
RefPtr<Worker> worker = adoptRef(new Worker(context));
Modified: trunk/Source/WebCore/workers/Worker.h (97286 => 97287)
--- trunk/Source/WebCore/workers/Worker.h 2011-10-12 19:28:12 UTC (rev 97286)
+++ trunk/Source/WebCore/workers/Worker.h 2011-10-12 19:28:29 UTC (rev 97287)
@@ -51,7 +51,7 @@
class Worker : public AbstractWorker, private WorkerScriptLoaderClient {
public:
- static PassRefPtr<Worker> create(const String& url, ScriptExecutionContext*, ExceptionCode&);
+ static PassRefPtr<Worker> create(ScriptExecutionContext*, const String& url, ExceptionCode&);
virtual ~Worker();
virtual Worker* toWorker() { return this; }