• abarth@webkit.org's avatar
    EventTarget.h shouldn't need to know about every feature and ifdef · 8233b467
    abarth@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=70659
    
    Reviewed by Darin Adler.
    
    Source/WebCore: 
    
    This patch follows the approach of Event.h and introduces an
    interfaceName virtual function that returns the name of the DOM
    interface for the concrete type of the object.  This function lets us
    remove a large number of fake dynamic casts.
    
    * CMakeLists.txt:
    * CodeGenerators.pri:
    * DerivedSources.make:
    * GNUmakefile.am:
    * WebCore.gyp/WebCore.gyp:
    * WebCore.gyp/scripts/action_makenames.py:
        - Teach action_makenames how to handle the new "in" file.
    * WebCore.gypi:
    * WebCore.vcproj/WebCore.vcproj:
    * WebCore.xcodeproj/project.pbxproj:
    * bindings/js/JSEventTarget.cpp:
    (WebCore::toJS):
        - Use the new autogenerated macro to remove a large amount of
          feature-specific code.
    * bindings/js/WorkerScriptController.cpp:
    (WebCore::WorkerScriptController::initScript):
    * bindings/objc/DOM.mm:
    (kit):
        - The SVGElementInstance branch was never taken previously because
          SVGElementInstance::toNode returns a non-NULL value. This code
          was introduced in http://trac.webkit.org/changeset/42618 and
          doesn't appear to have ever worked as the author intended.
    * bindings/v8/V8DOMWrapper.cpp:
    (WebCore::V8DOMWrapper::convertEventTargetToV8Object):
        - Use the new autogenerated macro to remove a large amount of
          feature-specific code.
    * dom/EventNames.cpp:
    (WebCore::EventNames::EventNames):
    * dom/EventNames.h:
    * dom/EventTarget.cpp:
    * dom/EventTarget.h:
    * dom/EventTargetFactory.in: Added.
        - Add a new "in" file that lists all the EventTargets.
    * dom/LocalMediaStream.cpp:
    (WebCore::LocalMediaStream::interfaceName):
    * dom/LocalMediaStream.h:
    * dom/MediaStream.cpp:
    (WebCore::MediaStream::interfaceName):
    * dom/MediaStream.h:
    * dom/MessagePort.cpp:
    (WebCore::MessagePort::interfaceName):
    * dom/MessagePort.h:
    * dom/Node.cpp:
    (WebCore::Node::toNode):
    (WebCore::Node::interfaceName):
    * dom/Node.h:
    * dom/make_event_factory.pl:
        - Generalize make_event_factory.pl to be able to generate
          interfaces for different namespaces.
    * fileapi/FileReader.cpp:
    (WebCore::FileReader::interfaceName):
    * fileapi/FileReader.h:
    * fileapi/FileWriter.cpp:
    (WebCore::FileWriter::interfaceName):
    * fileapi/FileWriter.h:
    * loader/appcache/DOMApplicationCache.cpp:
    (WebCore::DOMApplicationCache::interfaceName):
    * loader/appcache/DOMApplicationCache.h:
    * notifications/Notification.cpp:
    (WebCore::Notification::interfaceName):
    * notifications/Notification.h:
    (WebCore::Notification::scriptExecutionContext):
    * p2p/PeerConnection.cpp:
    (WebCore::PeerConnection::interfaceName):
    * p2p/PeerConnection.h:
    * page/DOMWindow.cpp:
    (WebCore::DOMWindow::interfaceName):
    (WebCore::DOMWindow::toDOMWindow):
    * page/DOMWindow.h:
    * page/EventSource.cpp:
    (WebCore::EventSource::interfaceName):
    * page/EventSource.h:
    * storage/IDBDatabase.cpp:
    (WebCore::IDBDatabase::interfaceName):
    * storage/IDBDatabase.h:
    * storage/IDBRequest.cpp:
    (WebCore::IDBRequest::interfaceName):
    * storage/IDBRequest.h:
    * storage/IDBTransaction.cpp:
    (WebCore::IDBTransaction::interfaceName):
    * storage/IDBTransaction.h:
    * storage/IDBVersionChangeRequest.cpp:
    (WebCore::IDBVersionChangeRequest::interfaceName):
    * storage/IDBVersionChangeRequest.h:
    * svg/SVGElementInstance.cpp:
    (WebCore::SVGElementInstance::interfaceName):
    * svg/SVGElementInstance.h:
    (WebCore::SVGElementInstance::toNode):
    * webaudio/AudioContext.cpp:
    (WebCore::AudioContext::interfaceName):
    (WebCore::AudioContext::scriptExecutionContext):
    * webaudio/AudioContext.h:
    * webaudio/JavaScriptAudioNode.cpp:
    (WebCore::JavaScriptAudioNode::interfaceName):
    * webaudio/JavaScriptAudioNode.h:
    * websockets/WebSocket.cpp:
    (WebCore::WebSocket::interfaceName):
    * websockets/WebSocket.h:
    * workers/DedicatedWorkerContext.cpp:
    (WebCore::DedicatedWorkerContext::interfaceName):
    * workers/DedicatedWorkerContext.h:
    * workers/DefaultSharedWorkerRepository.cpp:
    (WebCore::SharedWorkerConnectTask::performTask):
    * workers/SharedWorker.cpp:
    (WebCore::SharedWorker::interfaceName):
    * workers/SharedWorker.h:
    * workers/SharedWorkerContext.cpp:
    (WebCore::SharedWorkerContext::interfaceName):
    * workers/SharedWorkerContext.h:
    * workers/Worker.cpp:
    (WebCore::Worker::interfaceName):
    * workers/Worker.h:
    * xml/XMLHttpRequest.cpp:
    (WebCore::XMLHttpRequest::interfaceName):
    * xml/XMLHttpRequest.h:
    * xml/XMLHttpRequestUpload.cpp:
    (WebCore::XMLHttpRequestUpload::interfaceName):
    * xml/XMLHttpRequestUpload.h:
    
    Source/WebKit/chromium: 
    
    This cast isn't needed because dispatchEvent is a virtual function.
    
    * src/WebSharedWorkerImpl.cpp:
    (WebKit::WebSharedWorkerImpl::connectTask):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    8233b467
EventSource.h 4.31 KB