[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
japhet at chromium.org
japhet at chromium.org
Wed Mar 17 17:56:01 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit ba49a928e4bbf9123facaabc856ed8d1a2b3c371
Author: japhet at chromium.org <japhet at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Feb 22 19:53:59 2010 +0000
2010-02-22 Nate Chapin <japhet at chromium.org>
Reviewed by Dimitri Glazkov.
[V8] Streamline V8 event listener code. Merge all the variants of
V8DOMWrapper::getEventListner() into a single version and generate
addEventListener() and removeEventListener() bindings for all objects
except DOMWindow.
https://bugs.webkit.org/show_bug.cgi?id=35245
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/Android.v8bindings.mk b/WebCore/Android.v8bindings.mk
index 5227a4a..fecf531 100644
--- a/WebCore/Android.v8bindings.mk
+++ b/WebCore/Android.v8bindings.mk
@@ -86,7 +86,6 @@ LOCAL_SRC_FILES += \
\
bindings/v8/npruntime.cpp \
\
- bindings/v8/custom/V8AbstractWorkerCustom.cpp \
bindings/v8/custom/V8AttrCustom.cpp \
bindings/v8/custom/V8BarInfoCustom.cpp \
bindings/v8/custom/V8CSSRuleCustom.cpp \
@@ -106,7 +105,6 @@ LOCAL_SRC_FILES += \
bindings/v8/custom/V8CustomSQLTransactionCallback.cpp \
bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp \
bindings/v8/custom/V8CustomVoidCallback.cpp \
- bindings/v8/custom/V8DOMApplicationCacheCustom.cpp \
bindings/v8/custom/V8DOMSelectionCustom.cpp \
bindings/v8/custom/V8DOMWindowCustom.cpp \
bindings/v8/custom/V8DataGridColumnListCustom.cpp \
@@ -117,7 +115,6 @@ LOCAL_SRC_FILES += \
bindings/v8/custom/V8ElementCustom.cpp \
bindings/v8/custom/V8EventCustom.cpp \
bindings/v8/custom/V8EventSourceConstructor.cpp \
- bindings/v8/custom/V8EventSourceCustom.cpp \
bindings/v8/custom/V8FileListCustom.cpp \
bindings/v8/custom/V8GeolocationCustom.cpp \
bindings/v8/custom/V8HTMLAllCollectionCustom.cpp \
@@ -157,7 +154,6 @@ ifeq ($(ENABLE_SVG), true)
LOCAL_SRC_FILES += \
bindings/v8/custom/V8SVGDocumentCustom.cpp \
bindings/v8/custom/V8SVGElementCustom.cpp \
- bindings/v8/custom/V8SVGElementInstanceCustom.cpp \
bindings/v8/custom/V8SVGLengthCustom.cpp \
bindings/v8/custom/V8SVGMatrixCustom.cpp
bindings/v8/custom/V8SVGPathSegCustom.cpp \
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7cba3f4..9106ebf 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,48 @@
+2010-02-22 Nate Chapin <japhet at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [V8] Streamline V8 event listener code. Merge all the variants of
+ V8DOMWrapper::getEventListner() into a single version and generate
+ addEventListener() and removeEventListener() bindings for all objects
+ except DOMWindow.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35245
+
+ * Android.v8bindings.mk:
+ * WebCore.gypi:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore::V8DOMWrapper::getEventListener):
+ * bindings/v8/V8DOMWrapper.h:
+ * bindings/v8/WorkerContextExecutionProxy.cpp:
+ * bindings/v8/WorkerContextExecutionProxy.h:
+ * bindings/v8/custom/V8AbstractWorkerCustom.cpp: Removed.
+ * bindings/v8/custom/V8DOMApplicationCacheCustom.cpp: Removed.
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::addEventListenerCallback):
+ (WebCore::V8DOMWindow::removeEventListenerCallback):
+ * bindings/v8/custom/V8EventSourceCustom.cpp: Removed.
+ * bindings/v8/custom/V8MessagePortCustom.cpp:
+ * bindings/v8/custom/V8NodeCustom.cpp:
+ * bindings/v8/custom/V8NotificationCenterCustom.cpp:
+ * bindings/v8/custom/V8SVGElementInstanceCustom.cpp: Removed.
+ * bindings/v8/custom/V8WebSocketCustom.cpp:
+ * bindings/v8/custom/V8WorkerContextCustom.cpp:
+ * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+ * bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp:
+ * dom/MessagePort.idl:
+ * dom/Node.idl:
+ * loader/appcache/DOMApplicationCache.idl:
+ * notifications/Notification.idl:
+ * page/EventSource.idl:
+ * svg/SVGElementInstance.idl:
+ * websockets/WebSocket.idl:
+ * workers/AbstractWorker.idl:
+ * workers/WorkerContext.idl:
+ * xml/XMLHttpRequest.idl:
+ * xml/XMLHttpRequestUpload.idl:
+
2010-02-22 Chris Fleizach <cfleizach at apple.com>
Reviewed by Beth Dakin.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 6fe815c..f0bf518 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -662,7 +662,6 @@
'bindings/ScriptControllerBase.cpp',
'bindings/v8/ChildThreadDOMData.cpp',
'bindings/v8/ChildThreadDOMData.h',
- 'bindings/v8/custom/V8AbstractWorkerCustom.cpp',
'bindings/v8/custom/V8AttrCustom.cpp',
'bindings/v8/custom/V8BarInfoCustom.cpp',
'bindings/v8/custom/V8CanvasPixelArrayCustom.cpp',
@@ -706,14 +705,12 @@
'bindings/v8/custom/V8DataGridColumnListCustom.cpp',
'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
'bindings/v8/custom/V8DocumentLocationCustom.cpp',
- 'bindings/v8/custom/V8DOMApplicationCacheCustom.cpp',
'bindings/v8/custom/V8DOMSelectionCustom.cpp',
'bindings/v8/custom/V8DOMWindowCustom.cpp',
'bindings/v8/custom/V8DocumentCustom.cpp',
'bindings/v8/custom/V8ElementCustom.cpp',
'bindings/v8/custom/V8EventCustom.cpp',
'bindings/v8/custom/V8EventSourceConstructor.cpp',
- 'bindings/v8/custom/V8EventSourceCustom.cpp',
'bindings/v8/custom/V8GeolocationCustom.cpp',
'bindings/v8/custom/V8HistoryCustom.cpp',
'bindings/v8/custom/V8HTMLAudioElementConstructor.cpp',
@@ -761,7 +758,6 @@
'bindings/v8/custom/V8SQLTransactionCustom.cpp',
'bindings/v8/custom/V8SVGDocumentCustom.cpp',
'bindings/v8/custom/V8SVGElementCustom.cpp',
- 'bindings/v8/custom/V8SVGElementInstanceCustom.cpp',
'bindings/v8/custom/V8SVGLengthCustom.cpp',
'bindings/v8/custom/V8SVGMatrixCustom.cpp',
'bindings/v8/custom/V8SVGPathSegCustom.cpp',
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index ee51ec3..fff5cbe 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -948,7 +948,7 @@ END
} elsif ($attribute->signature->type eq "EventListener") {
$implIncludes{"V8AbstractEventListener.h"} = 1;
push(@implContentDecls, " transferHiddenDependency(info.Holder(), imp->$attrName(), value, V8${interfaceName}::cacheIndex);\n");
- push(@implContentDecls, " imp->set$implSetterFunctionName(V8DOMWrapper::getEventListener(imp, value, true, ListenerFindOrCreate)");
+ push(@implContentDecls, " imp->set$implSetterFunctionName(V8DOMWrapper::getEventListener(value, true, ListenerFindOrCreate)");
} else {
push(@implContentDecls, " imp->set$implSetterFunctionName($result");
}
@@ -1010,6 +1010,29 @@ sub GenerateNewFunctionTemplate
return "v8::FunctionTemplate::New($callback, v8::Handle<v8::Value>(), $signature)";
}
+sub GenerateNewFunctionTemplatellback
+{
+ my $implClassName = shift;
+ my $functionName = shift;
+ my $lookupType = ($functionName eq "add") ? "OrCreate" : "Only";
+ my $passRefPtrHandling = ($functionName eq "add") ? "" : ".get()";
+ my $hiddenDependencyAction = ($functionName eq "add") ? "create" : "remove";
+
+ push(@implContentDecls, <<END);
+ static v8::Handle<v8::Value> ${functionName}EventListenerCallback(const v8::Arguments& args)
+ {
+ INC_STATS("DOM.${implClassName}.${functionName}EventListener()");
+ RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFind${lookupType});
+ if (listener) {
+ V8${implClassName}::toNative(args.Holder())->${functionName}EventListener(v8ValueToAtomicWebCoreString(args[0]), listener${passRefPtrHandling}, args[2]->BooleanValue());
+ ${hiddenDependencyAction}HiddenDependency(args.Holder(), args[1], V8${implClassName}::cacheIndex);
+ }
+ return v8::Undefined();
+ }
+
+END
+}
+
sub GenerateFunctionCallback
{
my $function = shift;
@@ -1020,6 +1043,17 @@ sub GenerateFunctionCallback
my $interfaceName = $dataNode->name;
my $name = $function->signature->name;
+ # Adding and removing event listeners are not standard callback behavior,
+ # but they are extremely consistent across the various classes that take event listeners,
+ # so we can generate them as a "special case".
+ if ($name eq "addEventListener") {
+ GenerateEventListenerCallback($implClassName, "add");
+ return;
+ } elsif ($name eq "removeEventListener") {
+ GenerateEventListenerCallback($implClassName, "remove");
+ return;
+ }
+
push(@implContentDecls,
" static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments& args) {\n" .
" INC_STATS(\"DOM.$implClassName.$name\");\n");
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index a057b9a..6225b62 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -66,6 +66,7 @@
#include "V8WebSocket.h"
#include "V8Worker.h"
#include "V8WorkerContext.h"
+#include "V8WorkerContextEventListener.h"
#include "V8XMLHttpRequest.h"
#include "WebGLArray.h"
#include "WebGLContextAttributes.h"
@@ -464,89 +465,21 @@ v8::Handle<v8::Value> V8DOMWrapper::convertEventTargetToV8Object(EventTarget* ta
return notHandledByInterceptor();
}
-PassRefPtr<EventListener> V8DOMWrapper::getEventListener(Node* node, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
+PassRefPtr<EventListener> V8DOMWrapper::getEventListener(v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
{
- return (lookup == ListenerFindOnly) ? V8EventListenerList::findWrapper(value, isAttribute) : V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute);
-}
-
-#if ENABLE(SVG)
-PassRefPtr<EventListener> V8DOMWrapper::getEventListener(SVGElementInstance* element, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
-{
- return getEventListener(element->correspondingElement(), value, isAttribute, lookup);
-}
-#endif
-
-PassRefPtr<EventListener> V8DOMWrapper::getEventListener(AbstractWorker* worker, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
-{
- if (worker->scriptExecutionContext()->isWorkerContext()) {
- WorkerContextExecutionProxy* workerContextProxy = WorkerContextExecutionProxy::retrieve();
- ASSERT(workerContextProxy);
- return workerContextProxy->findOrCreateEventListener(value, isAttribute, lookup == ListenerFindOnly);
- }
-
- return (lookup == ListenerFindOnly) ? V8EventListenerList::findWrapper(value, isAttribute) : V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute);
-}
-
-#if ENABLE(NOTIFICATIONS)
-PassRefPtr<EventListener> V8DOMWrapper::getEventListener(Notification* notification, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
-{
- if (notification->scriptExecutionContext()->isWorkerContext()) {
- WorkerContextExecutionProxy* workerContextProxy = WorkerContextExecutionProxy::retrieve();
- ASSERT(workerContextProxy);
- return workerContextProxy->findOrCreateEventListener(value, isAttribute, lookup == ListenerFindOnly);
- }
-
- return (lookup == ListenerFindOnly) ? V8EventListenerList::findWrapper(value, isAttribute) : V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute);
-}
-#endif
-
-PassRefPtr<EventListener> V8DOMWrapper::getEventListener(WorkerContext* workerContext, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
-{
- WorkerContextExecutionProxy* workerContextProxy = workerContext->script()->proxy();
- if (workerContextProxy)
- return workerContextProxy->findOrCreateEventListener(value, isAttribute, lookup == ListenerFindOnly);
-
- return 0;
-}
-
-PassRefPtr<EventListener> V8DOMWrapper::getEventListener(XMLHttpRequestUpload* upload, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
-{
- return getEventListener(upload->associatedXMLHttpRequest(), value, isAttribute, lookup);
-}
-
-#if ENABLE(EVENTSOURCE)
-PassRefPtr<EventListener> V8DOMWrapper::getEventListener(EventSource* eventSource, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
-{
- if (V8Proxy::retrieve(eventSource->scriptExecutionContext()))
- return (lookup == ListenerFindOnly) ? V8EventListenerList::findWrapper(value, isAttribute) : V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute);
-
+ v8::Handle<v8::Context> context = v8::Context::GetCurrent();
+ if (context.IsEmpty())
+ return 0;
+ if (lookup == ListenerFindOnly)
+ return V8EventListenerList::findWrapper(value, isAttribute);
+ v8::Handle<v8::Object> globalPrototype = v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype());
+ if (globalObjectPrototypeIsDOMWindow(globalPrototype))
+ return V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute);
#if ENABLE(WORKERS)
- WorkerContextExecutionProxy* workerContextProxy = WorkerContextExecutionProxy::retrieve();
- if (workerContextProxy)
- return workerContextProxy->findOrCreateEventListener(value, isAttribute, lookup == ListenerFindOnly);
-#endif
-
+ return V8EventListenerList::findOrCreateWrapper<V8WorkerContextEventListener>(value, isAttribute);
+#else
return 0;
-}
-#endif
-
-PassRefPtr<EventListener> V8DOMWrapper::getEventListener(EventTarget* eventTarget, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
-{
- if (V8Proxy::retrieve(eventTarget->scriptExecutionContext()))
- return (lookup == ListenerFindOnly) ? V8EventListenerList::findWrapper(value, isAttribute) : V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute);
-
-#if ENABLE(WORKERS)
- WorkerContextExecutionProxy* workerContextProxy = WorkerContextExecutionProxy::retrieve();
- if (workerContextProxy)
- return workerContextProxy->findOrCreateEventListener(value, isAttribute, lookup == ListenerFindOnly);
#endif
-
- return 0;
-}
-
-PassRefPtr<EventListener> V8DOMWrapper::getEventListener(V8Proxy* proxy, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
-{
- return (lookup == ListenerFindOnly) ? V8EventListenerList::findWrapper(value, isAttribute) : V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute);
}
} // namespace WebCore
diff --git a/WebCore/bindings/v8/V8DOMWrapper.h b/WebCore/bindings/v8/V8DOMWrapper.h
index 8a3fa3f..baf89f0 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.h
+++ b/WebCore/bindings/v8/V8DOMWrapper.h
@@ -47,54 +47,11 @@
namespace WebCore {
- // FIXME: This probably aren't all needed.
- class CSSRule;
- class CSSRuleList;
- class CSSStyleDeclaration;
- class CSSValue;
- class CSSValueList;
- class ClientRectList;
- class DOMImplementation;
class DOMWindow;
- class Document;
- class Element;
- class Event;
- class EventListener;
class EventTarget;
class Frame;
- class HTMLCollection;
- class HTMLDocument;
- class HTMLElement;
- class HTMLOptionsCollection;
- class MediaList;
- class MimeType;
- class MimeTypeArray;
- class NamedNodeMap;
- class Navigator;
class Node;
- class NodeFilter;
- class NodeList;
- class Plugin;
- class PluginArray;
- class SVGElement;
-#if ENABLE(SVG)
- class SVGElementInstance;
-#endif
- class Screen;
- class ScriptExecutionContext;
-#if ENABLE(DOM_STORAGE)
- class Storage;
- class StorageEvent;
-#endif
- class String;
- class StyleSheet;
- class StyleSheetList;
- class V8EventListener;
- class V8ObjectEventListener;
class V8Proxy;
-#if ENABLE(WEB_SOCKETS)
- class WebSocket;
-#endif
class WorkerContext;
enum ListenerLookupType {
@@ -131,27 +88,7 @@ namespace WebCore {
static v8::Handle<v8::Value> convertEventTargetToV8Object(EventTarget*);
- static PassRefPtr<EventListener> getEventListener(Node* node, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-
- static PassRefPtr<EventListener> getEventListener(SVGElementInstance* element, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-
- static PassRefPtr<EventListener> getEventListener(AbstractWorker* worker, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-
-#if ENABLE(NOTIFICATIONS)
- static PassRefPtr<EventListener> getEventListener(Notification* notification, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-#endif
-
- static PassRefPtr<EventListener> getEventListener(WorkerContext* workerContext, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-
- static PassRefPtr<EventListener> getEventListener(XMLHttpRequestUpload* upload, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-
-#if ENABLE(EVENTSOURCE)
- static PassRefPtr<EventListener> getEventListener(EventSource* eventTarget, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-#endif
-
- static PassRefPtr<EventListener> getEventListener(EventTarget* eventTarget, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-
- static PassRefPtr<EventListener> getEventListener(V8Proxy* proxy, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
+ static PassRefPtr<EventListener> getEventListener(v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
#if ENABLE(XPATH)
// XPath-related utilities
diff --git a/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp b/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
index e4b417e..b7e147f 100644
--- a/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
+++ b/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
@@ -35,15 +35,8 @@
#include "WorkerContextExecutionProxy.h"
-#include "DOMCoreException.h"
#include "DedicatedWorkerContext.h"
#include "Event.h"
-#include "EventSource.h"
-#include "Notification.h"
-#include "NotificationCenter.h"
-#include "EventException.h"
-#include "MessagePort.h"
-#include "RangeException.h"
#include "SharedWorker.h"
#include "SharedWorkerContext.h"
#include "V8Binding.h"
@@ -51,17 +44,9 @@
#include "V8Index.h"
#include "V8Proxy.h"
#include "V8WorkerContext.h"
-#include "V8WorkerContextEventListener.h"
-#if ENABLE(WEB_SOCKETS)
-#include "WebSocket.h"
-#endif
#include "Worker.h"
#include "WorkerContext.h"
-#include "WorkerLocation.h"
-#include "WorkerNavigator.h"
#include "WorkerScriptController.h"
-#include "XMLHttpRequest.h"
-#include "XMLHttpRequestException.h"
namespace WebCore {
@@ -247,11 +232,6 @@ v8::Local<v8::Value> WorkerContextExecutionProxy::runScript(v8::Handle<v8::Scrip
return result;
}
-PassRefPtr<V8EventListener> WorkerContextExecutionProxy::findOrCreateEventListener(v8::Local<v8::Value> object, bool isInline, bool findOnly)
-{
- return findOnly ? V8EventListenerList::findWrapper(object, isInline) : V8EventListenerList::findOrCreateWrapper<V8WorkerContextEventListener>(object, isInline);
-}
-
void WorkerContextExecutionProxy::trackEvent(Event* event)
{
m_events.append(event);
diff --git a/WebCore/bindings/v8/WorkerContextExecutionProxy.h b/WebCore/bindings/v8/WorkerContextExecutionProxy.h
index 67a472b..35173f4 100644
--- a/WebCore/bindings/v8/WorkerContextExecutionProxy.h
+++ b/WebCore/bindings/v8/WorkerContextExecutionProxy.h
@@ -35,7 +35,6 @@
#if ENABLE(WORKERS)
#include "ScriptValue.h"
-#include "V8EventListenerList.h"
#include "V8Index.h"
#include <v8.h>
#include <wtf/OwnPtr.h>
@@ -45,8 +44,6 @@ namespace WebCore {
class Event;
class EventTarget;
- class V8EventListener;
- class V8WorkerContextEventListener;
class WorkerContext;
struct WorkerContextExecutionState {
@@ -64,9 +61,6 @@ namespace WebCore {
WorkerContextExecutionProxy(WorkerContext*);
~WorkerContextExecutionProxy();
- // Finds/creates event listener wrappers.
- PassRefPtr<V8EventListener> findOrCreateEventListener(v8::Local<v8::Value> listener, bool isInline, bool findOnly);
-
// Track the event so that we can detach it from the JS wrapper when a worker
// terminates. This is needed because we need to be able to dispose these
// events and releases references to their event targets: WorkerContext.
diff --git a/WebCore/bindings/v8/custom/V8AbstractWorkerCustom.cpp b/WebCore/bindings/v8/custom/V8AbstractWorkerCustom.cpp
deleted file mode 100644
index e776438..0000000
--- a/WebCore/bindings/v8/custom/V8AbstractWorkerCustom.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2009 Google 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:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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 THE COPYRIGHT
- * OWNER 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"
-
-#if ENABLE(WORKERS)
-#include "V8AbstractWorker.h"
-
-#include "AbstractWorker.h"
-#include "ExceptionCode.h"
-#include "ScriptExecutionContext.h"
-#include "V8Binding.h"
-#include "V8Proxy.h"
-#include "V8Utilities.h"
-#include "WorkerContextExecutionProxy.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8AbstractWorker::addEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS(L"DOM.AbstractWorker.addEventListener()");
- AbstractWorker* worker = V8AbstractWorker::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(worker, args[1], false, ListenerFindOrCreate);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- worker->addEventListener(type, listener, useCapture);
-
- createHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8AbstractWorker::removeEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS(L"DOM.AbstractWorker.removeEventListener()");
- AbstractWorker* worker = V8AbstractWorker::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(worker, args[1], false, ListenerFindOnly);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- worker->removeEventListener(type, listener.get(), useCapture);
-
- removeHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
-
- return v8::Undefined();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WORKERS)
diff --git a/WebCore/bindings/v8/custom/V8CustomBinding.h b/WebCore/bindings/v8/custom/V8CustomBinding.h
deleted file mode 100644
index e69de29..0000000
diff --git a/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp b/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp
deleted file mode 100644
index 61760b3..0000000
--- a/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2009 Google 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:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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 THE COPYRIGHT
- * OWNER 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 "V8DOMApplicationCache.h"
-
-#if ENABLE(OFFLINE_WEB_APPLICATIONS)
-
-#include "ApplicationCacheHost.h"
-#include "DOMApplicationCache.h"
-#include "V8Binding.h"
-#include "V8Document.h"
-#include "V8Proxy.h"
-#include "V8Utilities.h"
-#include "WorkerContextExecutionProxy.h"
-
-namespace WebCore {
-
-// Handles appcache.addEventListner(name, func, capture) method calls
-v8::Handle<v8::Value> V8DOMApplicationCache::addEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOMApplicationCache.addEventListener()");
- DOMApplicationCache* appcache = V8DOMApplicationCache::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(appcache, args[1], false, ListenerFindOrCreate);
- if (listener) {
- createHiddenDependency(args.Holder(), args[1], cacheIndex);
- String eventType = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- appcache->addEventListener(eventType, listener, useCapture);
- }
- return v8::Undefined();
-}
-
-// Handles appcache.removeEventListner(name, func, capture) method calls
-v8::Handle<v8::Value> V8DOMApplicationCache::removeEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOMApplicationCache.removeEventListener()");
- DOMApplicationCache* appcache = V8DOMApplicationCache::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(appcache, args[1], false, ListenerFindOnly);
- if (listener) {
- removeHiddenDependency(args.Holder(), args[1], cacheIndex);
- String eventType = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- appcache->removeEventListener(eventType, listener.get(), useCapture);
- }
- return v8::Undefined();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(OFFLINE_WEB_APPLICATIONS)
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 9719837..93e34b3 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -289,7 +289,7 @@ v8::Handle<v8::Value> V8DOMWindow::addEventListenerCallback(const v8::Arguments&
if (!proxy)
return v8::Undefined();
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(proxy, args[1], false, ListenerFindOrCreate);
+ RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOrCreate);
if (listener) {
imp->addEventListener(eventType, listener, useCapture);
@@ -321,7 +321,7 @@ v8::Handle<v8::Value> V8DOMWindow::removeEventListenerCallback(const v8::Argumen
if (!proxy)
return v8::Undefined();
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(proxy, args[1], false, ListenerFindOnly);
+ RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOnly);
if (listener) {
imp->removeEventListener(eventType, listener.get(), useCapture);
diff --git a/WebCore/bindings/v8/custom/V8EventSourceCustom.cpp b/WebCore/bindings/v8/custom/V8EventSourceCustom.cpp
deleted file mode 100644
index a7f79db..0000000
--- a/WebCore/bindings/v8/custom/V8EventSourceCustom.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2010, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER 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"
-
-#if ENABLE(EVENTSOURCE)
-#include "V8EventSource.h"
-
-#include "EventSource.h"
-
-#include "V8Binding.h"
-#include "V8Proxy.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8EventSource::addEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.EventSource.addEventListener()");
- EventSource* eventSource = V8EventSource::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(eventSource, args[1], false, ListenerFindOrCreate);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- eventSource->addEventListener(type, listener, useCapture);
-
- createHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8EventSource::removeEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.EventSource.removeEventListener()");
- EventSource* eventSource = V8EventSource::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(eventSource, args[1], false, ListenerFindOnly);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- eventSource->removeEventListener(type, listener.get(), useCapture);
-
- removeHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
-
- return v8::Undefined();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(EVENTSOURCE)
diff --git a/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp b/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
index 9890668..640041b 100644
--- a/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
@@ -42,37 +42,6 @@
namespace WebCore {
-v8::Handle<v8::Value> V8MessagePort::addEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.MessagePort.addEventListener()");
- MessagePort* messagePort = V8MessagePort::toNative(args.Holder());
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(messagePort, args[1], false, ListenerFindOrCreate);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- messagePort->addEventListener(type, listener, useCapture);
-
- createHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8MessagePort::removeEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.MessagePort.removeEventListener()");
- MessagePort* messagePort = V8MessagePort::toNative(args.Holder());
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(messagePort, args[1], false, ListenerFindOnly);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- messagePort->removeEventListener(type, listener.get(), useCapture);
-
- removeHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
-
- return v8::Undefined();
-}
-
v8::Handle<v8::Value> V8MessagePort::postMessageCallback(const v8::Arguments& args)
{
INC_STATS("DOM.MessagePort.postMessage");
diff --git a/WebCore/bindings/v8/custom/V8NodeCustom.cpp b/WebCore/bindings/v8/custom/V8NodeCustom.cpp
index 7907283..b5b2385 100644
--- a/WebCore/bindings/v8/custom/V8NodeCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8NodeCustom.cpp
@@ -56,40 +56,6 @@
namespace WebCore {
-v8::Handle<v8::Value> V8Node::addEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.Node.addEventListener()");
- Node* node = V8Node::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(node, args[1], false, ListenerFindOrCreate);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- node->addEventListener(type, listener, useCapture);
- createHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8Node::removeEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.Node.removeEventListener()");
- Node* node = V8Node::toNative(args.Holder());
-
- // It is possbile that the owner document of the node is detached
- // from the frame.
- // See issue http://b/878909
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(node, args[1], false, ListenerFindOnly);
- if (listener) {
- AtomicString type = v8ValueToAtomicWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- node->removeEventListener(type, listener.get(), useCapture);
- removeHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
-
- return v8::Undefined();
-}
-
// This function is customized to take advantage of the optional 4th argument: shouldLazyAttach
v8::Handle<v8::Value> V8Node::insertBeforeCallback(const v8::Arguments& args)
{
diff --git a/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp b/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
index 9c3ab45..30773e3 100644
--- a/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
@@ -46,38 +46,6 @@
namespace WebCore {
-v8::Handle<v8::Value> V8Notification::addEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.Notification.addEventListener()");
- Notification* notification = V8Notification::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(notification, args[1], false, ListenerFindOrCreate);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- notification->addEventListener(type, listener, useCapture);
- createHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
-
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8Notification::removeEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.Notification.removeEventListener()");
- Notification* notification = V8Notification::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(notification, args[1], false, ListenerFindOnly);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- notification->removeEventListener(type, listener.get(), useCapture);
- removeHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
-
- return v8::Undefined();
-}
-
v8::Handle<v8::Value> V8NotificationCenter::createHTMLNotificationCallback(const v8::Arguments& args)
{
INC_STATS(L"DOM.NotificationCenter.CreateHTMLNotification()");
diff --git a/WebCore/bindings/v8/custom/V8SVGElementInstanceCustom.cpp b/WebCore/bindings/v8/custom/V8SVGElementInstanceCustom.cpp
deleted file mode 100644
index 56c37bd..0000000
--- a/WebCore/bindings/v8/custom/V8SVGElementInstanceCustom.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2009 Google 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:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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 THE COPYRIGHT
- * OWNER 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>
-
-#if ENABLE(SVG)
-#include "V8SVGElementInstance.h"
-
-#include "EventListener.h"
-#include "SVGElementInstance.h"
-
-#include "V8Binding.h"
-#include "V8CustomEventListener.h"
-#include "V8SVGPODTypeWrapper.h"
-#include "V8Proxy.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8SVGElementInstance::addEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.SVGElementInstance.AddEventListener()");
- SVGElementInstance* instance = V8SVGElementInstance::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(instance, args[1], false, ListenerFindOrCreate);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- instance->addEventListener(type, listener, useCapture);
- createHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
-
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8SVGElementInstance::removeEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.SVGElementInstance.RemoveEventListener()");
- SVGElementInstance* instance = V8SVGElementInstance::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(instance, args[1], false, ListenerFindOnly);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- instance->removeEventListener(type, listener.get(), useCapture);
- removeHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
-
- return v8::Undefined();
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp b/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
index 2451b90..c3be9f2 100644
--- a/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
@@ -45,37 +45,6 @@
namespace WebCore {
-v8::Handle<v8::Value> V8WebSocket::addEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.WebSocket.addEventListener()");
- WebSocket* webSocket = V8WebSocket::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(webSocket, args[1], false, ListenerFindOrCreate);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- webSocket->addEventListener(type, listener, useCapture);
-
- createHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8WebSocket::removeEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.WebSocket.removeEventListener()");
- WebSocket* webSocket = V8WebSocket::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(webSocket, args[1], false, ListenerFindOnly);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- webSocket->removeEventListener(type, listener.get(), useCapture);
- removeHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
- return v8::Undefined();
-}
-
v8::Handle<v8::Value> V8WebSocket::constructorCallback(const v8::Arguments& args)
{
INC_STATS("DOM.WebSocket.Constructor");
diff --git a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
index 7677e27..0690b07 100644
--- a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
@@ -126,38 +126,6 @@ v8::Handle<v8::Value> V8WorkerContext::setIntervalCallback(const v8::Arguments&
return SetTimeoutOrInterval(args, false);
}
-v8::Handle<v8::Value> V8WorkerContext::addEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS(L"DOM.WorkerContext.addEventListener()");
- WorkerContext* workerContext = V8WorkerContext::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(workerContext, args[1], false, ListenerFindOrCreate);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- workerContext->addEventListener(type, listener, useCapture);
-
- createHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8WorkerContext::removeEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS(L"DOM.WorkerContext.removeEventListener()");
- WorkerContext* workerContext = V8WorkerContext::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(workerContext, args[1], false, ListenerFindOnly);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- workerContext->removeEventListener(type, listener.get(), useCapture);
-
- removeHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
- return v8::Undefined();
-}
-
v8::Handle<v8::Value> toV8(WorkerContext* impl)
{
if (!impl)
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index d10c418..a6a0c98 100644
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -51,39 +51,6 @@ v8::Handle<v8::Value> V8XMLHttpRequest::responseTextAccessorGetter(v8::Local<v8:
return xmlHttpRequest->responseText().v8StringOrNull();
}
-v8::Handle<v8::Value> V8XMLHttpRequest::addEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.XMLHttpRequest.addEventListener()");
- XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(xmlHttpRequest, args[1], false, ListenerFindOrCreate);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- xmlHttpRequest->addEventListener(type, listener, useCapture);
-
- createHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8XMLHttpRequest::removeEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.XMLHttpRequest.removeEventListener()");
- XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(args.Holder());
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(xmlHttpRequest, args[1], false, ListenerFindOnly);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- xmlHttpRequest->removeEventListener(type, listener.get(), useCapture);
-
- removeHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
-
- return v8::Undefined();
-}
-
v8::Handle<v8::Value> V8XMLHttpRequest::openCallback(const v8::Arguments& args)
{
INC_STATS("DOM.XMLHttpRequest.open()");
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp
index c6c31bf..c4fb35a 100644
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp
@@ -42,43 +42,6 @@
namespace WebCore {
-v8::Handle<v8::Value> V8XMLHttpRequestUpload::addEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.XMLHttpRequestUpload.addEventListener()");
- XMLHttpRequestUpload* xmlHttpRequestUpload = V8XMLHttpRequestUpload::toNative(args.Holder());
-
- XMLHttpRequest* xmlHttpRequest = xmlHttpRequestUpload->associatedXMLHttpRequest();
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(xmlHttpRequest, args[1], false, ListenerFindOrCreate);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- xmlHttpRequestUpload->addEventListener(type, listener, useCapture);
-
- createHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8XMLHttpRequestUpload::removeEventListenerCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.XMLHttpRequestUpload.removeEventListener()");
- XMLHttpRequestUpload* xmlHttpRequestUpload = V8XMLHttpRequestUpload::toNative(args.Holder());
-
- XMLHttpRequest* xmlHttpRequest = xmlHttpRequestUpload->associatedXMLHttpRequest();
-
- RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(xmlHttpRequest, args[1], false, ListenerFindOnly);
- if (listener) {
- String type = toWebCoreString(args[0]);
- bool useCapture = args[2]->BooleanValue();
- xmlHttpRequestUpload->removeEventListener(type, listener.get(), useCapture);
-
- removeHiddenDependency(args.Holder(), args[1], cacheIndex);
- }
-
- return v8::Undefined();
-}
-
v8::Handle<v8::Value> V8XMLHttpRequestUpload::dispatchEventCallback(const v8::Arguments& args)
{
INC_STATS("DOM.XMLHttpRequestUpload.dispatchEvent()");
diff --git a/WebCore/dom/MessagePort.idl b/WebCore/dom/MessagePort.idl
index 62cf63a..9312430 100644
--- a/WebCore/dom/MessagePort.idl
+++ b/WebCore/dom/MessagePort.idl
@@ -43,12 +43,12 @@ module events {
attribute EventListener onmessage;
// EventTarget interface
- [Custom] void addEventListener(in DOMString type,
- in EventListener listener,
- in boolean useCapture);
- [Custom] void removeEventListener(in DOMString type,
+ [JSCCustom] void addEventListener(in DOMString type,
in EventListener listener,
in boolean useCapture);
+ [JSCCustom] void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in boolean useCapture);
boolean dispatchEvent(in Event evt)
raises(EventException);
#endif
diff --git a/WebCore/dom/Node.idl b/WebCore/dom/Node.idl
index c6cd4b9..ca7874a 100644
--- a/WebCore/dom/Node.idl
+++ b/WebCore/dom/Node.idl
@@ -132,12 +132,12 @@ module core {
#endif /* defined(LANGUAGE_OBJECTIVE_C) */
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
- [Custom] void addEventListener(in DOMString type,
- in EventListener listener,
- in boolean useCapture);
- [Custom] void removeEventListener(in DOMString type,
+ [JSCCustom] void addEventListener(in DOMString type,
in EventListener listener,
in boolean useCapture);
+ [JSCCustom] void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in boolean useCapture);
boolean dispatchEvent(in Event event)
raises(EventException);
#endif
diff --git a/WebCore/loader/appcache/DOMApplicationCache.idl b/WebCore/loader/appcache/DOMApplicationCache.idl
index 9c3a359..9794baf 100644
--- a/WebCore/loader/appcache/DOMApplicationCache.idl
+++ b/WebCore/loader/appcache/DOMApplicationCache.idl
@@ -55,12 +55,12 @@ module offline {
attribute EventListener onobsolete;
// EventTarget interface
- [Custom] void addEventListener(in DOMString type,
- in EventListener listener,
- in boolean useCapture);
- [Custom] void removeEventListener(in DOMString type,
+ [JSCCustom] void addEventListener(in DOMString type,
in EventListener listener,
in boolean useCapture);
+ [JSCCustom] void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in boolean useCapture);
boolean dispatchEvent(in Event evt)
raises(EventException);
};
diff --git a/WebCore/notifications/Notification.idl b/WebCore/notifications/Notification.idl
index b17546a..b99da96 100644
--- a/WebCore/notifications/Notification.idl
+++ b/WebCore/notifications/Notification.idl
@@ -43,12 +43,12 @@ module threads {
attribute EventListener onclose;
// EventTarget interface
- [Custom] void addEventListener(in DOMString type,
- in EventListener listener,
- in boolean useCapture);
- [Custom] void removeEventListener(in DOMString type,
+ [JSCCustom] void addEventListener(in DOMString type,
in EventListener listener,
in boolean useCapture);
+ [JSCCustom] void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in boolean useCapture);
boolean dispatchEvent(in Event evt)
raises(EventException);
};
diff --git a/WebCore/page/EventSource.idl b/WebCore/page/EventSource.idl
index ec42556..57bd807 100644
--- a/WebCore/page/EventSource.idl
+++ b/WebCore/page/EventSource.idl
@@ -53,12 +53,12 @@ module window {
void close();
// EventTarget interface
- [Custom] void addEventListener(in DOMString type,
- in EventListener listener,
- in boolean useCapture);
- [Custom] void removeEventListener(in DOMString type,
+ [JSCCustom] void addEventListener(in DOMString type,
in EventListener listener,
in boolean useCapture);
+ [JSCCustom] void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in boolean useCapture);
boolean dispatchEvent(in Event evt)
raises(EventException);
diff --git a/WebCore/svg/SVGElementInstance.idl b/WebCore/svg/SVGElementInstance.idl
index cd4213c..d23fea2 100644
--- a/WebCore/svg/SVGElementInstance.idl
+++ b/WebCore/svg/SVGElementInstance.idl
@@ -90,12 +90,12 @@ module svg {
attribute [DontEnum] EventListener onsubmit;
attribute [DontEnum] EventListener onunload;
- [Custom] void addEventListener(in DOMString type,
- in EventListener listener,
- in boolean useCapture);
- [Custom] void removeEventListener(in DOMString type,
+ [JSCCustom] void addEventListener(in DOMString type,
in EventListener listener,
in boolean useCapture);
+ [JSCCustom] void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in boolean useCapture);
boolean dispatchEvent(in Event event)
raises(EventException);
#endif /* defined(LANGUAGE_OBJECTIVE_C) */
diff --git a/WebCore/websockets/WebSocket.idl b/WebCore/websockets/WebSocket.idl
index c9552d9..ab163a9 100644
--- a/WebCore/websockets/WebSocket.idl
+++ b/WebCore/websockets/WebSocket.idl
@@ -56,12 +56,12 @@ module websockets {
void close();
// EventTarget interface
- [Custom] void addEventListener(in DOMString type,
- in EventListener listener,
- in boolean useCapture);
- [Custom] void removeEventListener(in DOMString type,
+ [JSCCustom] void addEventListener(in DOMString type,
in EventListener listener,
in boolean useCapture);
+ [JSCCustom] void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in boolean useCapture);
boolean dispatchEvent(in Event evt)
raises(EventException);
};
diff --git a/WebCore/workers/AbstractWorker.idl b/WebCore/workers/AbstractWorker.idl
index e5a51d6..4361dfc 100644
--- a/WebCore/workers/AbstractWorker.idl
+++ b/WebCore/workers/AbstractWorker.idl
@@ -38,12 +38,12 @@ module threads {
attribute EventListener onerror;
- [Custom] void addEventListener(in DOMString type,
- in EventListener listener,
- in boolean useCapture);
- [Custom] void removeEventListener(in DOMString type,
+ [JSCCustom] void addEventListener(in DOMString type,
in EventListener listener,
in boolean useCapture);
+ [JSCCustom] void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in boolean useCapture);
boolean dispatchEvent(in Event evt)
raises(EventException);
};
diff --git a/WebCore/workers/WorkerContext.idl b/WebCore/workers/WorkerContext.idl
index bce4f53..abb8ea8 100644
--- a/WebCore/workers/WorkerContext.idl
+++ b/WebCore/workers/WorkerContext.idl
@@ -62,12 +62,12 @@ module threads {
// EventTarget interface
- [Custom] void addEventListener(in DOMString type,
- in EventListener listener,
- in boolean useCapture);
- [Custom] void removeEventListener(in DOMString type,
+ [JSCCustom] void addEventListener(in DOMString type,
in EventListener listener,
in boolean useCapture);
+ [JSCCustom] void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in boolean useCapture);
boolean dispatchEvent(in Event evt)
raises(EventException);
diff --git a/WebCore/xml/XMLHttpRequest.idl b/WebCore/xml/XMLHttpRequest.idl
index 70cd58a..5a86fe5 100644
--- a/WebCore/xml/XMLHttpRequest.idl
+++ b/WebCore/xml/XMLHttpRequest.idl
@@ -91,12 +91,12 @@ module xml {
[Custom] void overrideMimeType(in DOMString override);
// EventTarget interface
- [Custom] void addEventListener(in DOMString type,
- in EventListener listener,
- in boolean useCapture);
- [Custom] void removeEventListener(in DOMString type,
+ [JSCCustom] void addEventListener(in DOMString type,
in EventListener listener,
in boolean useCapture);
+ [JSCCustom] void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in boolean useCapture);
boolean dispatchEvent(in Event evt)
raises(EventException);
};
diff --git a/WebCore/xml/XMLHttpRequestUpload.idl b/WebCore/xml/XMLHttpRequestUpload.idl
index ce392f3..a712a37 100644
--- a/WebCore/xml/XMLHttpRequestUpload.idl
+++ b/WebCore/xml/XMLHttpRequestUpload.idl
@@ -42,12 +42,12 @@ module xml {
attribute EventListener onprogress;
// EventTarget interface
- [Custom] void addEventListener(in DOMString type,
- in EventListener listener,
- in boolean useCapture);
- [Custom] void removeEventListener(in DOMString type,
+ [JSCCustom] void addEventListener(in DOMString type,
in EventListener listener,
in boolean useCapture);
+ [JSCCustom] void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in boolean useCapture);
boolean dispatchEvent(in Event evt)
raises(EventException);
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list