<https://webkit.org/b/119852> Frame::scriptController() should return a reference
authorpsolanki@apple.com <psolanki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2013 17:55:32 +0000 (17:55 +0000)
committerpsolanki@apple.com <psolanki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2013 17:55:32 +0000 (17:55 +0000)
commit089eddd59f6468f14892406cc6732ec0afffd1c9
tree0d8ccd119aa2c00a5daa9c778ef3c988efa58186
parentb03efd0cba954f14c528b0527085f2304fe54bee
<https://webkit.org/b/119852> Frame::scriptController() should return a reference

Reviewed by Andreas Kling.

m_script is never NULL so we can just return a reference. Also remove some pointless null
checks as a result of doing this.

Source/WebCore:

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::toJS):
(WebCore::toJSDOMWindow):
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::toJS):
(WebCore::toJSDOMWindowShell):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction):
* bindings/js/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::execute):
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
(WebCore::ScriptCachedFrameData::restore):
* bindings/js/ScriptEventListener.cpp:
(WebCore::createAttributeEventListener):
(WebCore::eventListenerHandlerScriptState):
* bindings/js/ScriptState.cpp:
(WebCore::mainWorldScriptState):
(WebCore::scriptStateFromNode):
(WebCore::scriptStateFromPage):
* bindings/objc/DOM.mm:
(-[DOMNode JSC::Bindings::]):
* bindings/objc/DOMInternal.mm:
(-[WebScriptObject _initializeScriptDOMNodeImp]):
* dom/Document.cpp:
(WebCore::Document::disableEval):
(WebCore::Document::ensurePlugInsInjectedScript):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::executeScript):
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createRenderer):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::rendererIsNeeded):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::controls):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::getInstance):
(WebCore::HTMLPlugInElement::getNPObject):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
* html/parser/HTMLParserOptions.cpp:
(WebCore::HTMLParserOptions::HTMLParserOptions):
* inspector/InspectorAgent.cpp:
(WebCore::InspectorAgent::didClearWindowObjectInWorld):
* inspector/InspectorClient.cpp:
(WebCore::InspectorClient::doDispatchMessageOnFrontendPage):
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::evaluateAsBoolean):
(WebCore::InspectorFrontendClientLocal::evaluateOnLoad):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::evaluateInOverlay):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getScriptExecutionStatus):
(WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
* inspector/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::reportExecutionContextCreation):
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::submitForm):
(WebCore::FrameLoader::cancelAndClear):
(WebCore::FrameLoader::clear):
(WebCore::FrameLoader::prepareForCachedPageRestore):
(WebCore::FrameLoader::dispatchDidClearWindowObjectsInAllWorlds):
(WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::requestFrame):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest):
* page/EventSource.cpp:
(WebCore::EventSource::create):
* page/Frame.cpp:
(WebCore::Frame::willDetachPage):
* page/Frame.h:
(WebCore::Frame::script):
* page/Navigator.cpp:
(WebCore::shouldHideFourDot):
* page/Page.cpp:
(WebCore::Page::setDebugger):
* platform/graphics/wince/MediaPlayerProxy.cpp:
(WebCore::WebMediaPlayerProxy::pluginInstance):
(WebCore::WebMediaPlayerProxy::invokeMethod):
* plugins/PluginView.cpp:
(WebCore::PluginView::~PluginView):
(WebCore::PluginView::performRequest):
(WebCore::PluginView::load):
(WebCore::PluginView::bindingInstance):
(WebCore::PluginView::getValue):
* plugins/efl/PluginViewEfl.cpp:
(WebCore::PluginView::platformGetValue):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::load):
(BlackBerry::WebKit::WebPagePrivate::executeJavaScript):
(BlackBerry::WebKit::WebPagePrivate::executeJavaScriptInIsolatedWorld):
(BlackBerry::WebKit::WebPage::executeJavaScriptFunction):
(BlackBerry::WebKit::WebPage::globalContext):
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDidClearWindowObjectInWorld):

Source/WebKit/efl:

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld):
(DumpRenderTreeSupportEfl::globalContextRefForFrame):
* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::dispatchDidClearWindowObjectInWorld):
* ewk/ewk_frame.cpp:
(ewk_frame_script_execute):
* ewk/ewk_view.cpp:
(ewk_view_js_object_add):

Source/WebKit/gtk:

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::dispatchDidClearWindowObjectInWorld):
* webkit/webkitwebframe.cpp:
(webkit_web_frame_get_global_context):
* webkit/webkitwebview.cpp:
(webkit_web_view_execute_script):

Source/WebKit/mac:

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::cleanup):
(WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
(WebKit::NetscapePluginInstanceProxy::getPluginElementNPObject):
(WebKit::NetscapePluginInstanceProxy::evaluate):
(WebKit::NetscapePluginInstanceProxy::invoke):
(WebKit::NetscapePluginInstanceProxy::invokeDefault):
(WebKit::NetscapePluginInstanceProxy::construct):
(WebKit::NetscapePluginInstanceProxy::getProperty):
(WebKit::NetscapePluginInstanceProxy::setProperty):
(WebKit::NetscapePluginInstanceProxy::removeProperty):
(WebKit::NetscapePluginInstanceProxy::hasProperty):
(WebKit::NetscapePluginInstanceProxy::hasMethod):
(WebKit::NetscapePluginInstanceProxy::enumerate):
(WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView getVariable:value:]):
(-[WebNetscapePluginView _destroyPlugin]):
* Plugins/WebPluginController.mm:
* WebCoreSupport/WebFrameLoaderClient.mm:
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::save):
(WebInspectorFrontendClient::append):
* WebView/WebFrame.mm:
(-[WebFrame _attachScriptDebugger]):
(-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
(-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):
(-[WebFrame _globalContextForScriptWorld:]):
(-[WebFrame jsWrapperForNode:inScriptWorld:]):
(-[WebFrame windowObject]):
(-[WebFrame globalContext]):
(-[WebFrame javaScriptContext]):
* WebView/WebScriptDebugger.mm:
(WebScriptDebugger::initGlobalCallFrame):
(WebScriptDebugger::callEvent):
* WebView/WebView.mm:
(-[WebView windowScriptObject]):
(-[WebView aeDescByEvaluatingJavaScriptFromString:]):

Source/WebKit/qt:

* Api/qwebelement.cpp:
(setupScriptContext):
(QWebElement::evaluateJavaScript):
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld):
* WebCoreSupport/QWebFrameAdapter.cpp:
(QWebFrameAdapter::evaluateJavaScript):
(QWebFrameAdapter::addToJavaScriptWindowObject):

Source/WebKit/win:

* WebFrame.cpp:
(WebFrame::globalContext):
(WebFrame::globalContextForScriptWorld):
(WebFrame::dispatchDidClearWindowObjectInWorld):
(WebFrame::stringByEvaluatingJavaScriptInScriptWorld):
* WebView.cpp:
(WebView::stringByEvaluatingJavaScriptFromString):

Source/WebKit2:

* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::globalObject):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performJavaScriptURLRequest):
(WebKit::PluginView::windowScriptNPObject):
(WebKit::PluginView::pluginElementNPObject):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::jsContext):
(WebKit::WebFrame::jsContextForWorld):
(WebKit::WebFrame::jsWrapperForWorld):
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::didSave):
(WebKit::WebInspector::didAppend):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runJavaScriptInMainFrame):

Tools:

* DumpRenderTree/blackberry/DumpRenderTree.cpp:
(BlackBerry::WebKit::DumpRenderTree::resetToConsistentStateBeforeTesting):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
78 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.cpp
Source/WebCore/bindings/js/JSEventListener.cpp
Source/WebCore/bindings/js/JSLazyEventListener.cpp
Source/WebCore/bindings/js/PageScriptDebugServer.cpp
Source/WebCore/bindings/js/ScheduledAction.cpp
Source/WebCore/bindings/js/ScriptCachedFrameData.cpp
Source/WebCore/bindings/js/ScriptEventListener.cpp
Source/WebCore/bindings/js/ScriptState.cpp
Source/WebCore/bindings/objc/DOM.mm
Source/WebCore/bindings/objc/DOMInternal.mm
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/ScriptElement.cpp
Source/WebCore/history/CachedFrame.cpp
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLPlugInElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/parser/HTMLParserOptions.cpp
Source/WebCore/inspector/InspectorAgent.cpp
Source/WebCore/inspector/InspectorClient.cpp
Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
Source/WebCore/inspector/InspectorOverlay.cpp
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/PageRuntimeAgent.cpp
Source/WebCore/loader/DocumentWriter.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/SubframeLoader.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/page/EventSource.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebCore/page/Navigator.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/platform/graphics/wince/MediaPlayerProxy.cpp
Source/WebCore/plugins/PluginView.cpp
Source/WebCore/plugins/efl/PluginViewEfl.cpp
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebCore/xml/XMLTreeViewer.cpp
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
Source/WebKit/efl/ewk/ewk_frame.cpp
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
Source/WebKit/gtk/webkit/webkitwebframe.cpp
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
Source/WebKit/mac/Plugins/WebNetscapePluginView.mm
Source/WebKit/mac/Plugins/WebPluginController.mm
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebScriptDebugger.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/qt/Api/qwebelement.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebFrame.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebInspector.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp