Web Inspector: Page should use std::unique_ptr for InspectorController
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Jan 2014 19:15:33 +0000 (19:15 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Jan 2014 19:15:33 +0000 (19:15 +0000)
commite996f307dbd256dbc2e2688860b2e9b6ff8b1804
tree885197ef27b6cbded51d23f9c8f01788ad940546
parent5de0001e1a65a4a0c20e08503e86d132ea70a33c
Web Inspector: Page should use std::unique_ptr for InspectorController
https://bugs.webkit.org/show_bug.cgi?id=127068

Reviewed by Joseph Pecoraro.

Source/WebCore:

Make Page and WorkerGlobalScope keep a std::unique_ptr to InspectorController
and WorkerInspectorController. Store page references and return controller
references where possible.

Convert call sites to use an InspectorController reference.
Convert instantiations of InspectorFrontendClient to use std::unique_ptr.
Convert InspectorOverlay to keep Page references.

* WebCore.exp.in:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::supportsProfiling):
(WebCore::JSDOMWindowBase::supportsRichSourceInfo):
* dom/Node.cpp:
(WebCore::Node::inspect):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::inspectedPageDestroyed):
(WebCore::InspectorController::setInspectorFrontendClient):
(WebCore::InspectorController::hasInspectorFrontendClient):
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::inspectedPage):
(WebCore::InspectorController::developerExtrasEnabled):
* inspector/InspectorController.h:
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::canAttachWindow):
(WebCore::InspectorFrontendClientLocal::changeAttachedWindowHeight):
(WebCore::InspectorFrontendClientLocal::changeAttachedWindowWidth):
(WebCore::InspectorFrontendClientLocal::openInNewTab):
(WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::InspectorOverlay):
(WebCore::InspectorOverlay::getHighlight):
(WebCore::InspectorOverlay::highlightQuad):
(WebCore::InspectorOverlay::update):
(WebCore::InspectorOverlay::buildObjectForHighlightedNode):
(WebCore::InspectorOverlay::drawQuadHighlight):
(WebCore::InspectorOverlay::overlayPage):
(WebCore::InspectorOverlay::reset):
* inspector/InspectorOverlay.h:
* inspector/InstrumentingAgents.cpp:
(WebCore::instrumentationForPage): remove null checks.
(WebCore::instrumentationForWorkerGlobalScope): remove null checks.
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
(WebCore::WorkerInspectorController::connectFrontend):
(WebCore::WorkerInspectorController::disconnectFrontend):
* inspector/WorkerInspectorController.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::showContextMenu):
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::populate):
(WebCore::ContextMenuController::addInspectElementItem):
* page/FrameView.cpp:
(WebCore::FrameView::sendResizeEventIfNeeded):
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::inspectorController):
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::hasLocalDebugger):
(WebCore::PageDebuggable::parentProcessIdentifier):
(WebCore::PageDebuggable::connect):
(WebCore::PageDebuggable::disconnect):
(WebCore::PageDebuggable::dispatchMessageFromRemoteFrontend):
(WebCore::PageDebuggable::setIndicating):
* platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
(WebCore::CompositingCoordinator::syncDisplayState):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::inspectorHighlightRects):
(WebCore::Internals::inspectorHighlightObject):
(WebCore::Internals::emitInspectorDidBeginFrame):
(WebCore::Internals::emitInspectorDidCancelFrame):
(WebCore::Internals::openDummyInspectorFrontend):
(WebCore::Internals::closeDummyInspectorFrontend):
(WebCore::Internals::setInspectorResourcesDataSizeLimits):
(WebCore::Internals::setJavaScriptProfilingEnabled):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScope.h: remove clearInspector().
(WebCore::WorkerGlobalScope::workerInspectorController):
* workers/WorkerMessagingProxy.cpp:
(WebCore::connectToWorkerGlobalScopeInspectorTask):
(WebCore::disconnectFromWorkerGlobalScopeInspectorTask):
(WebCore::dispatchOnInspectorBackendTask):
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadShutdownFinishTask::performTask):

Source/WebKit/efl:

Convert call sites to use a InspectorController reference.
Convert instantiations of InspectorFrontendClient to use std::unique_ptr.

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::evaluateInWebInspector):
* WebCoreSupport/InspectorClientEfl.cpp:
(WebCore::InspectorClientEfl::openInspectorFrontend):
* ewk/ewk_view.cpp:
(ewk_view_inspector_show):
(ewk_view_inspector_close):

Source/WebKit/gtk:

Convert call sites to use a InspectorController reference.
Convert instantiations of InspectorFrontendClient to use std::unique_ptr.

* WebCoreSupport/ChromeClientGtk.cpp:
(WebKit::paintWebView):
* WebCoreSupport/InspectorClientGtk.cpp:
(WebKit::InspectorClient::openInspectorFrontend):
* webkit/webkitwebinspector.cpp:
(webkit_web_inspector_set_property):
(webkit_web_inspector_get_property):
(webkit_web_inspector_show):
(webkit_web_inspector_inspect_node):
(webkit_web_inspector_inspect_coordinates):
(webkit_web_inspector_close):
(webkit_web_inspector_execute_script):

Source/WebKit/mac:

Convert call sites to use a InspectorController reference.
Convert instantiations of InspectorFrontendClient to use std::unique_ptr.

* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorClient::openInspectorFrontend):
(-[WebInspectorWindowController destroyInspectorView:]):
* WebInspector/WebInspector.mm:
(-[WebInspector showWindow]):
(-[WebInspector isJavaScriptProfilingEnabled]):
(-[WebInspector setJavaScriptProfilingEnabled:]):
(-[WebInspector close:]):
(-[WebInspector evaluateInFrontend:callId:script:]):
* WebInspector/WebNodeHighlighter.mm:
(-[WebNodeHighlighter highlight]):

Source/WebKit/win:

Convert call sites to use a InspectorController reference.

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorClient::openInspectorFrontend):
(WebInspectorFrontendClient::destroyInspectorView):
(WebInspectorFrontendClient::onClose):
* WebInspector.cpp:
(WebInspector::show):
(WebInspector::close):
(WebInspector::isJavaScriptProfilingEnabled):
(WebInspector::setJavaScriptProfilingEnabled):
(WebInspector::evaluateInFrontend):
* WebNodeHighlight.cpp:
(WebNodeHighlight::update):

Source/WebKit2:

Convert call sites to use a InspectorController reference.

* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::drawRect):
* WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
(WebKit::WebInspectorFrontendClient::WebInspectorFrontendClient):
(WebKit::WebInspectorFrontendClient::closeWindow):
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::createInspectorPage):
(WebKit::WebInspector::show):
(WebKit::WebInspector::close):
(WebKit::WebInspector::evaluateScriptForTest):
(WebKit::WebInspector::showConsole):
(WebKit::WebInspector::showResources):
(WebKit::WebInspector::showMainResourceForFrame):
(WebKit::WebInspector::startJavaScriptDebugging):
(WebKit::WebInspector::stopJavaScriptDebugging):
(WebKit::WebInspector::setJavaScriptProfilingEnabled):
(WebKit::WebInspector::startJavaScriptProfiling):
(WebKit::WebInspector::stopJavaScriptProfiling):
(WebKit::WebInspector::startPageProfiling):
(WebKit::WebInspector::stopPageProfiling):
(WebKit::WebInspector::dispatchMessageFromRemoteFrontend):
(WebKit::WebInspector::remoteFrontendConnected):
(WebKit::WebInspector::remoteFrontendDisconnected):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
44 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
Source/WebCore/inspector/InspectorOverlay.cpp
Source/WebCore/inspector/InspectorOverlay.h
Source/WebCore/inspector/InstrumentingAgents.cpp
Source/WebCore/inspector/WorkerInspectorController.cpp
Source/WebCore/inspector/WorkerInspectorController.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/PageDebuggable.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/workers/WorkerGlobalScope.cpp
Source/WebCore/workers/WorkerGlobalScope.h
Source/WebCore/workers/WorkerMessagingProxy.cpp
Source/WebCore/workers/WorkerThread.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
Source/WebKit/gtk/webkit/webkitwebinspector.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
Source/WebKit/mac/WebInspector/WebInspector.mm
Source/WebKit/mac/WebInspector/WebNodeHighlighter.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
Source/WebKit/win/WebInspector.cpp
Source/WebKit/win/WebNodeHighlight.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp
Source/WebKit2/WebProcess/WebPage/WebInspector.cpp