Reduce use of Deprecated::ScriptXXX classes
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Apr 2016 02:25:56 +0000 (02:25 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Apr 2016 02:25:56 +0000 (02:25 +0000)
commitd0adc7b20eff825e770ee6fcd3f8df35a3e3bca1
tree23002573409335c1e0af66696de7a99114482715
parent4c0062a61896b13b340dc4812cd8cdea2060c573
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.

* dom/CustomEvent.cpp:
(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:

* WebView/WebFrame.mm:
(-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): Use references instead
of pointers.
(-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]): Updated
since return value is a JSValue.
* WebView/WebView.mm:
(-[WebView aeDescByEvaluatingJavaScriptFromString:]): Ditto.

Source/WebKit/win:

* Plugins/PluginView.cpp:
(WebCore::PluginView::performRequest): Use JSValue.
* WebFrame.cpp:
(WebFrame::stringByEvaluatingJavaScriptInScriptWorld): Ditto.
* WebView.cpp:
(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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199619 268f45cc-cd09-0410-ab3c-d52691b4dbfc
52 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bindings/ScriptFunctionCall.cpp
Source/JavaScriptCore/bindings/ScriptFunctionCall.h
Source/JavaScriptCore/bindings/ScriptValue.cpp
Source/JavaScriptCore/bindings/ScriptValue.h
Source/JavaScriptCore/inspector/InjectedScript.cpp
Source/JavaScriptCore/inspector/InjectedScript.h
Source/JavaScriptCore/inspector/InjectedScriptBase.cpp
Source/JavaScriptCore/inspector/InjectedScriptBase.h
Source/JavaScriptCore/inspector/InjectedScriptModule.cpp
Source/JavaScriptCore/inspector/ScriptDebugListener.h
Source/JavaScriptCore/inspector/ScriptDebugServer.cpp
Source/JavaScriptCore/inspector/ScriptDebugServer.h
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h
Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp
Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp
Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/SDPProcessor.cpp
Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp
Source/WebCore/bindings/js/JSCustomEventCustom.cpp
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/bindings/js/ScriptController.h
Source/WebCore/bindings/js/ScriptGlobalObject.cpp
Source/WebCore/bindings/js/ScriptGlobalObject.h
Source/WebCore/dom/CustomEvent.cpp
Source/WebCore/dom/CustomEvent.h
Source/WebCore/dom/CustomEvent.idl
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/inspector/CommandLineAPIHost.cpp
Source/WebCore/inspector/CommandLineAPIHost.h
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorDOMAgent.h
Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
Source/WebCore/inspector/InspectorFrontendHost.cpp
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/inspector/InspectorTimelineAgent.h
Source/WebCore/inspector/PageConsoleAgent.cpp
Source/WebCore/inspector/PageDebuggerAgent.cpp
Source/WebCore/inspector/PageDebuggerAgent.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/Plugins/PluginView.cpp
Source/WebKit/win/WebFrame.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/WebPage/WebInspectorUI.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp