Skip to content
  • psolanki@apple.com's avatar
    <https://webkit.org/b/119852> Frame::scriptController() should return a reference · c5b5dad7
    psolanki@apple.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@154192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    c5b5dad7