Make WebCore use jsCast rather than static_cast for casting JSC objects
https://bugs.webkit.org/show_bug.cgi?id=83320
Reviewed by Stephanie Lewis.
Mechanically replace static_cast with jsCast where ever we can.
* WebCore.exp.in:
* bindings/js/DOMWrapperWorld.cpp:
(WebCore::JSStringOwner::finalize):
* bindings/js/DOMWrapperWorld.h:
(WebCore::currentWorld):
* bindings/js/JSArrayBufferCustom.cpp:
(WebCore::JSArrayBufferConstructor::constructJSArrayBuffer):
* bindings/js/JSAudioContextCustom.cpp:
(WebCore::JSAudioContextConstructor::constructJSAudioContext):
* bindings/js/JSCSSRuleListCustom.cpp:
(WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::cssPropertyGetterPixelOrPosPrefixCallback):
(WebCore::cssPropertyGetterCallback):
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots):
(WebCore::JSCSSValueOwner::finalize):
* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
* bindings/js/JSDOMBinding.h:
(WebCore::deprecatedGlobalObjectForPrototype):
(WebCore::getDOMPrototype):
* bindings/js/JSDOMFormDataCustom.cpp:
(WebCore::toHTMLFormElement):
(WebCore::JSDOMFormDataConstructor::constructJSDOMFormData):
* bindings/js/JSDOMMimeTypeArrayCustom.cpp:
(WebCore::JSDOMMimeTypeArray::nameGetter):
* bindings/js/JSDOMPluginArrayCustom.cpp:
(WebCore::JSDOMPluginArray::nameGetter):
* bindings/js/JSDOMPluginCustom.cpp:
(WebCore::JSDOMPlugin::nameGetter):
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::nameGetter):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::toJSDOMWindow):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::childFrameGetter):
(WebCore::indexGetter):
(WebCore::namedItemGetter):
(WebCore::toDOMWindow):
* bindings/js/JSDOMWindowCustom.h:
(WebCore::asJSDOMWindow):
* bindings/js/JSDOMWindowShell.h:
(WebCore::JSDOMWindowShell::window):
* bindings/js/JSDOMWrapper.h:
(WebCore::JSDOMWrapper::globalObject):
* bindings/js/JSDataViewCustom.cpp:
(WebCore::JSDataViewConstructor::constructJSDataView):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSEventTarget.cpp:
(WebCore):
(WebCore::toEventTarget):
* bindings/js/JSFloat32ArrayCustom.cpp:
(WebCore::JSFloat32ArrayConstructor::constructJSFloat32Array):
* bindings/js/JSFloat64ArrayCustom.cpp:
(WebCore::JSFloat64ArrayConstructor::constructJSFloat64Array):
* bindings/js/JSGeolocationCustom.cpp:
(WebCore::JSGeolocation::getCurrentPosition):
(WebCore::JSGeolocation::watchPosition):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
(WebCore::JSHTMLAllCollection::nameGetter):
* bindings/js/JSHTMLCollectionCustom.cpp:
(WebCore::JSHTMLCollection::nameGetter):
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::nameGetter):
* bindings/js/JSHTMLFormElementCustom.cpp:
(WebCore::JSHTMLFormElement::nameGetter):
* bindings/js/JSHTMLFrameSetElementCustom.cpp:
(WebCore::JSHTMLFrameSetElement::nameGetter):
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::remove):
* bindings/js/JSImageConstructor.cpp:
(WebCore::constructImage):
* bindings/js/JSInjectedScriptManager.cpp:
(WebCore::InjectedScriptManager::createInjectedScript):
(WebCore::InjectedScriptManager::discardInjectedScript):
(WebCore::InjectedScriptManager::injectedScriptFor):
* bindings/js/JSInt16ArrayCustom.cpp:
(WebCore::JSInt16ArrayConstructor::constructJSInt16Array):
* bindings/js/JSInt32ArrayCustom.cpp:
(WebCore::JSInt32ArrayConstructor::constructJSInt32Array):
* bindings/js/JSInt8ArrayCustom.cpp:
(WebCore::JSInt8ArrayConstructor::constructJSInt8Array):
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction):
* bindings/js/JSNamedNodeMapCustom.cpp:
(WebCore::JSNamedNodeMap::nameGetter):
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
(WebCore::JSNodeOwner::finalize):
* bindings/js/JSNodeCustom.h:
(WebCore::toJS):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::toNodeFilter):
* bindings/js/JSNodeListCustom.cpp:
(WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
(WebCore::JSNodeList::nameGetter):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::runtimeObjectPropertyGetter):
(WebCore::callPlugin):
* bindings/js/JSPopStateEventCustom.cpp:
(WebCore::JSPopStateEvent::state):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/JSSharedWorkerCustom.cpp:
(WebCore::JSSharedWorkerConstructor::constructJSSharedWorker):
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::nameGetter):
* bindings/js/JSStyleSheetListCustom.cpp:
(WebCore::JSStyleSheetList::nameGetter):
* bindings/js/JSTextTrackCueCustom.cpp:
(WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrackOwner::isReachableFromOpaqueRoots):
* bindings/js/JSTextTrackListCustom.cpp:
(WebCore::JSTextTrackListOwner::isReachableFromOpaqueRoots):
* bindings/js/JSTrackCustom.cpp:
(WebCore::toTrack):
* bindings/js/JSUint16ArrayCustom.cpp:
(WebCore::JSUint16ArrayConstructor::constructJSUint16Array):
* bindings/js/JSUint32ArrayCustom.cpp:
(WebCore::JSUint32ArrayConstructor::constructJSUint32Array):
* bindings/js/JSUint8ArrayCustom.cpp:
(WebCore::JSUint8ArrayConstructor::constructJSUint8Array):
* bindings/js/JSUint8ClampedArrayCustom.cpp:
(WebCore::JSUint8ClampedArrayConstructor::constructJSUint8ClampedArray):
* bindings/js/JSWebKitMutationObserverCustom.cpp:
(WebCore::JSWebKitMutationObserverConstructor::constructJSWebKitMutationObserver):
* bindings/js/JSWebKitPointCustom.cpp:
(WebCore::JSWebKitPointConstructor::constructJSWebKitPoint):
* bindings/js/JSWebSocketCustom.cpp:
(WebCore::JSWebSocketConstructor::constructJSWebSocket):
* bindings/js/JSWorkerContextBase.cpp:
(WebCore::toJSDedicatedWorkerContext):
(WebCore::toJSSharedWorkerContext):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::JSWorkerConstructor::constructJSWorker):
* bindings/js/JSXSLTProcessorCustom.cpp:
(WebCore::JSXSLTProcessor::importStylesheet):
(WebCore::JSXSLTProcessor::transformToFragment):
(WebCore::JSXSLTProcessor::transformToDocument):
* bindings/js/ScriptCallStackFactory.cpp:
(WebCore::createScriptCallStackForInspector):
* bindings/js/ScriptControllerMac.mm:
(WebCore::updateStyleIfNeededForBindings):
* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::dispatchDidPause):
* bindings/js/ScriptObject.cpp:
(WebCore::ScriptGlobalObject::set):
* bindings/js/ScriptState.cpp:
(WebCore::domWindowFromScriptState):
(WebCore::scriptExecutionContextFromScriptState):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::fillTransferMap):
(WebCore::CloneSerializer::dumpArrayBufferView):
(WebCore::CloneDeserializer::getJSValue):
(WebCore::CloneDeserializer::readTerminal):
* bindings/objc/WebScriptObject.mm:
(-[WebScriptObject _isSafeScript]):
(+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
(GenerateGetOwnPropertyDescriptorBody):
(GenerateImplementation):
(GenerateCallWith):
(NativeToJSValue):
(GenerateConstructorDefinition):
* bridge/jni/jni_jsobject.h:
* bridge/jni/jni_jsobject.mm:
(JavaJSObject::convertJObjectToValue):
* bridge/jni/jsc/JavaInstanceJSC.cpp:
(JavaInstance::invokeMethod):
* bridge/objc/objc_utility.mm:
(JSC::Bindings::convertValueToObjcValue):
* bridge/runtime_method.cpp:
(JSC::callRuntimeMethod):
* bridge/runtime_object.cpp:
(JSC::Bindings::callRuntimeConstructor):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::injectInternalsObject):
(WebCoreTestSupport::resetInternalsObject):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/bindings/js/SerializedScriptValue.cpp b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
index b259290..316408b 100644
--- a/Source/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -370,7 +370,7 @@
{
if (!input)
return;
- JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject());
+ JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject());
for (size_t i = 0; i < input->size(); i++) {
JSC::JSValue value = toJS(m_exec, globalObject, input->at(i).get());
JSC::JSObject* obj = value.getObject();
@@ -539,7 +539,7 @@
code = ValidationError;
return true;
}
- JSValue bufferObj = toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject()), arrayBuffer.get());
+ JSValue bufferObj = toJS(m_exec, jsCast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject()), arrayBuffer.get());
return dumpIfTerminal(bufferObj, code);
}
@@ -1350,7 +1350,7 @@
template<class T>
JSValue getJSValue(T* nativeObj)
{
- return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), nativeObj);
+ return toJS(m_exec, jsCast<JSDOMGlobalObject*>(m_globalObject), nativeObj);
}
JSValue readTerminal()
@@ -1393,7 +1393,7 @@
return JSValue();
if (!m_isDOMGlobalObject)
return jsNull();
- return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), file.get());
+ return toJS(m_exec, jsCast<JSDOMGlobalObject*>(m_globalObject), file.get());
}
case FileListTag: {
unsigned length = 0;