Reduce use of Deprecated::ScriptXXX classes
https://bugs.webkit.org/show_bug.cgi?id=156632
Reviewed by Alex Christensen.
Source/JavaScriptCore:
- bindings/ScriptFunctionCall.cpp:
(Deprecated::ScriptCallArgumentHandler::appendArgument): Deleted version that takes a Deprecated::ScriptValue.
(Deprecated::ScriptFunctionCall::call): Changed to return a JSValue.
- bindings/ScriptFunctionCall.h: Updated for the above.
- bindings/ScriptValue.cpp:
(Inspector::jsToInspectorValue): Moved from Deprecated namespace to Inspector namespace. Later, we should
move this to another source file in the inspector directory.
(Inspector::toInspectorValue): Added.
(Deprecated::ScriptValue::toInspectorValue): Updated for change to underlying function.
- bindings/ScriptValue.h: Update for the above.
- inspector/InjectedScript.cpp:
(Inspector::InjectedScript::evaluateOnCallFrame): Changed arguments and return values from
Deprecated::ScriptValue to JSC::JSValue.
(Inspector::InjectedScript::functionDetails): Ditto.
(Inspector::InjectedScript::wrapCallFrames): Ditto.
(Inspector::InjectedScript::wrapObject): Ditto.
(Inspector::InjectedScript::wrapTable): Ditto.
(Inspector::InjectedScript::previewValue): Ditto.
(Inspector::InjectedScript::setExceptionValue): Ditto.
(Inspector::InjectedScript::findObjectById): Ditto.
(Inspector::InjectedScript::inspectObject): Ditto.
- inspector/InjectedScript.h: Ditto.
- inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::callFunctionWithEvalEnabled): Ditto.
(Inspector::InjectedScriptBase::makeCall): Ditto.
- inspector/InjectedScriptBase.h: Ditto.
- inspector/InjectedScriptModule.cpp:
(Inspector::InjectedScriptModule::ensureInjected): Ditto.
- inspector/ScriptDebugListener.h: Ditto.
- inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::evaluateBreakpointAction): Ditto.
(Inspector::ScriptDebugServer::dispatchDidPause): Ditto.
(Inspector::ScriptDebugServer::dispatchBreakpointActionProbe): Ditto.
(Inspector::ScriptDebugServer::exceptionOrCaughtValue): Ditto.
- inspector/ScriptDebugServer.h: Ditto.
- inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::buildExceptionPauseReason): Ditto.
(Inspector::InspectorDebuggerAgent::didPause): Ditto.
(Inspector::InspectorDebuggerAgent::breakpointActionProbe): Ditto.
(Inspector::InspectorDebuggerAgent::didContinue): Ditto.
(Inspector::InspectorDebuggerAgent::clearDebuggerBreakpointState): Ditto.
- inspector/agents/InspectorDebuggerAgent.h: Ditto.
- inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::getPreview): Ditto.
(Inspector::InspectorHeapAgent::getRemoteObject): Ditto.
Source/WebCore:
- Modules/mediastream/SDPProcessor.cpp: Removed unneeded include.
- bindings/js/JSCommandLineAPIHostCustom.cpp:
(WebCore::JSCommandLineAPIHost::inspectedObject): Use JSValue.
- bindings/js/JSCustomEventCustom.cpp:
(WebCore::JSCustomEvent::detail): Ditto.
- bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld): Ditto.
(WebCore::ScriptController::evaluate): Ditto.
(WebCore::ScriptController::executeScriptInWorld): Ditto.
(WebCore::ScriptController::executeScript): Ditto.
(WebCore::ScriptController::executeIfJavaScriptURL): Ditto.
- bindings/js/ScriptController.h: Ditto.
- bindings/js/ScriptGlobalObject.cpp: Removed unused overload of set,
and unused remove and folded handleException function into its one call site.
(WebCore::ScriptGlobalObject::set): Take references instead of pointers.
(WebCore::ScriptGlobalObject::get): Use JSObject instead of Deprecated::ScriptObject.
- bindings/js/ScriptGlobalObject.h: Updated for the above.
(WebCore::CustomEvent::initCustomEvent): Take JSValue and ExecState instead of
Deprecated::ScriptValue.
(WebCore::CustomEvent::trySerializeDetail): Take a reference instead of a pointer.
Also removed an unneeded null check.
- dom/CustomEvent.h: Use JSValue.
- dom/CustomEvent.idl: Updated for the above.
- html/HTMLMediaElement.cpp: Remove unneeded include.
- inspector/CommandLineAPIHost.cpp:
(WebCore::CommandLineAPIHost::InspectableObject::get): Take reference instead of
pointer and return JSValue.
- inspector/CommandLineAPIHost.h: Updated for the above.
- inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setDocument): Use "document" instead of "doc".
(WebCore::InspectorDOMAgent::setAttributesAsText): Omit redundant class name.
(WebCore::InspectorDOMAgent::focusNode): Ditto. Pass reference instead of pointer.
(WebCore::InspectorDOMAgent::undo): Ditto.
(WebCore::InspectorDOMAgent::redo): Ditto.
(WebCore::InspectorDOMAgent::nodeForObjectId): Stop using Deprecated::ScriptValue.
(WebCore::InspectorDOMAgent::resolveNode): Ditto.
(WebCore::InspectorDOMAgent::scriptValueAsNode): Removed unneeded isObject check,
which is already done by JSNode::toWrapped. Use JSValue.
(WebCore::InspectorDOMAgent::nodeAsScriptValue): Use JSValue.
- inspector/InspectorDOMAgent.h: Updated for the above.
- inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::windowObjectCleared): Use references instead of
pointers and removed unneeded local.
(WebCore::InspectorFrontendClientLocal::evaluateAsBoolean): More of the same.
- inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::showContextMenu): Ditto.
- inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::breakpointActionProbe): Updated to take
reference instead of pointer and JSValue instead of ScriptValue.
- inspector/InspectorTimelineAgent.h: Ditto.
- inspector/PageConsoleAgent.cpp: Ditto.
- inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::breakpointActionLog): Ditto.
- inspector/PageDebuggerAgent.h: Ditto.
Source/WebKit/mac:
(-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): Use references instead
of pointers.
(-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]): Updated
since return value is a JSValue.
(-[WebView aeDescByEvaluatingJavaScriptFromString:]): Ditto.
Source/WebKit/win:
(WebCore::PluginView::performRequest): Use JSValue.
(WebFrame::stringByEvaluatingJavaScriptInScriptWorld): Ditto.
(WebView::stringByEvaluatingJavaScriptFromString): Ditto.
Source/WebKit2:
- WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performJavaScriptURLRequest): Use JSValue.
- WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::windowObjectCleared): Use references.
- WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runJavaScriptInMainFrame): Use JSValue.