• commit-queue@webkit.org's avatar
    Refactor automatically generated JS DOM bindings to replace operator new with static create methods · 64d3f857
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=64732
    
    Patch by Mark Hahnenberg <mhahnenberg@apple.com> on 2011-07-26
    Reviewed by Oliver Hunt.
    
    Source/JavaScriptCore:
    
    Replacing the public constructors in the automatically generated JS DOM bindings with static
    create methods.  JSByteArray is used by several of these bindings in WebCore.
    
    * JavaScriptCore.exp:
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
    * runtime/JSByteArray.cpp:
    (JSC::JSByteArray::create):
    * runtime/JSByteArray.h:
    
    Source/WebCore:
    
    No new tests.
    
    Replacing the public constructors in the automatically generated JS DOM bindings in CodeGeneratorJS.pm
    with static create methods.  This is part of a larger refactoring effort to use static create methods
    in the headers of the generated files (so as to be inline-able) in favor of public constructors throughout JSC.
    
    * bindings/js/JSAudioConstructor.h:
    (WebCore::JSAudioConstructor::create):
    * bindings/js/JSDOMBinding.h:
    (WebCore::createWrapper):
    * bindings/js/JSDOMGlobalObject.h:
    (WebCore::getDOMConstructor):
    * bindings/js/JSDOMWindowCustom.cpp:
    (WebCore::JSDOMWindow::history):
    (WebCore::JSDOMWindow::location):
    * bindings/js/JSDOMWindowShell.cpp:
    (WebCore::JSDOMWindowShell::setWindow):
    * bindings/js/JSDocumentCustom.cpp:
    (WebCore::JSDocument::location):
    * bindings/js/JSImageConstructor.h:
    (WebCore::JSImageConstructor::create):
    * bindings/js/JSImageDataCustom.cpp:
    (WebCore::toJS):
    * bindings/js/JSOptionConstructor.h:
    (WebCore::JSOptionConstructor::create):
    * bindings/js/WorkerScriptController.cpp:
    (WebCore::WorkerScriptController::initScript):
    * bindings/scripts/CodeGeneratorJS.pm:
    (AddIncludesForTypeInImpl):
    (AddIncludesForTypeInHeader):
    (AddIncludesForType):
    (GenerateHeader):
    (GenerateImplementation):
    (GenerateCallbackImplementation):
    (GenerateConstructorDeclaration):
    * bindings/scripts/test/JS/JSTestInterface.cpp:
    (WebCore::JSTestInterfaceConstructor::create):
    (WebCore::JSTestInterface::createPrototype):
    * bindings/scripts/test/JS/JSTestInterface.h:
    (WebCore::JSTestInterface::create):
    (WebCore::JSTestInterfacePrototype::create):
    * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
    (WebCore::JSTestMediaQueryListListenerConstructor::create):
    (WebCore::JSTestMediaQueryListListener::createPrototype):
    * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
    (WebCore::JSTestMediaQueryListListener::create):
    (WebCore::JSTestMediaQueryListListenerPrototype::create):
    * bindings/scripts/test/JS/JSTestObj.cpp:
    (WebCore::JSTestObjConstructor::create):
    (WebCore::JSTestObj::createPrototype):
    * bindings/scripts/test/JS/JSTestObj.h:
    (WebCore::JSTestObj::create):
    (WebCore::JSTestObjPrototype::create):
    * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
    (WebCore::JSTestSerializedScriptValueInterfaceConstructor::create):
    (WebCore::JSTestSerializedScriptValueInterface::createPrototype):
    * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
    (WebCore::JSTestSerializedScriptValueInterface::create):
    (WebCore::JSTestSerializedScriptValueInterfacePrototype::create):
    * bridge/jni/jsc/JavaArrayJSC.cpp:
    (JavaArray::convertJObjectToArray):
    * bridge/jsc/BridgeJSC.cpp:
    (JSC::Bindings::Instance::newRuntimeObject):
    * bridge/objc/objc_utility.mm:
    (JSC::Bindings::convertObjcValueToValue):
    * bridge/qt/qt_runtime.cpp:
    (JSC::Bindings::convertQVariantToValue):
    * bridge/runtime_array.h:
    (JSC::RuntimeArray::create):
    * bridge/runtime_object.h:
    (JSC::Bindings::RuntimeObject::create):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    64d3f857
qt_runtime.cpp 71.5 KB