-
joepeck@webkit.org authored
https://bugs.webkit.org/show_bug.cgi?id=124246 Reviewed by NOBODY (OOPS!). No new tests, this is just refactoring without changing functionality. Set of changes made: - Remove "class InspectorFrontend" that currently does nothing but hold sub-frontend dispatcher classes. Catches some stale code. - Generate individual "class InspectorFooFrontendDispatcher" classes for domains that have events. Catches some unnecessary classes. - Simplify the Base Agent interface from optional set/clearFrontend/register to required didCreateFrontendAndBackend/willDestroyFrontendAndBackend. New agents must implement this and this will be their cue to setup frontend and backend dispatchers. - Base Agent no longer needs to be templated or have an Interface class. - While we are changing subclass BaseAgent superclass calls, use ASCIILiteral - In agents with events, convert "InspectorFrontend::Foo* m_frontend" to "unique_ptr<InspectorFooFrontendDispatcher> m_frontendDispatcher" and update uses as appropriate within the classes. - In agents with events, create dispatchers in didCreateFrontendAndBackend and clear them in willDestroyFrontendAndBackend. * inspector/CodeGeneratorInspector.py: (Generator): (Generator.go): (Generator.process_event): * inspector/CodeGeneratorInspectorStrings.py: (InspectorFrontendChannel): * inspector/ConsoleMessage.cpp: (WebCore::ConsoleMessage::addToFrontend): (WebCore::ConsoleMessage::updateRepeatCountInConsole): * inspector/ConsoleMessage.h: * inspector/InjectedScriptHost.h: * inspector/InspectorAgent.cpp: (WebCore::InspectorAgent::InspectorAgent): (WebCore::InspectorAgent::didCreateFrontendAndBackend): (WebCore::InspectorAgent::willDestroyFrontendAndBackend): (WebCore::InspectorAgent::enable): (WebCore::InspectorAgent::evaluateForTestInFrontend): (WebCore::InspectorAgent::inspect): * inspector/InspectorAgent.h: (WebCore::InspectorAgent::hasFrontend): * inspector/InspectorAgentRegistry.cpp: (WebCore::InspectorAgentRegistry::append): (WebCore::InspectorAgentRegistry::didCreateFrontendAndBackend): (WebCore::InspectorAgentRegistry::willDestroyFrontendAndBackend): * inspector/InspectorAgentRegistry.h: * inspector/InspectorApplicationCacheAgent.cpp: (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent): (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend): (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend): (WebCore::InspectorApplicationCacheAgent::updateApplicationCacheStatus): (WebCore::InspectorApplicationCacheAgent::networkStateChanged): * inspector/InspectorApplicationCacheAgent.h: * inspector/InspectorBaseAgent.h: (WebCore::InspectorBaseAgent::discardAgent): (WebCore::InspectorBaseAgent::InspectorBaseAgent): * inspector/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::InspectorCSSAgent): (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend): (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend): (WebCore::InspectorCSSAgent::mediaQueryResultChanged): (WebCore::InspectorCSSAgent::didCreateNamedFlow): (WebCore::InspectorCSSAgent::willRemoveNamedFlow): (WebCore::InspectorCSSAgent::regionLayoutUpdated): (WebCore::InspectorCSSAgent::regionOversetChanged): (WebCore::InspectorCSSAgent::didRegisterNamedFlowContentElement): (WebCore::InspectorCSSAgent::didUnregisterNamedFlowContentElement): (WebCore::InspectorCSSAgent::stopSelectorProfilerImpl): (WebCore::InspectorCSSAgent::styleSheetChanged): * inspector/InspectorCSSAgent.h: * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::InspectorCanvasAgent): (WebCore::InspectorCanvasAgent::didCreateFrontendAndBackend): (WebCore::InspectorCanvasAgent::willDestroyFrontendAndBackend): (WebCore::InspectorCanvasAgent::notifyRenderingContextWasWrapped): (WebCore::InspectorCanvasAgent::findFramesWithUninstrumentedCanvases): (WebCore::InspectorCanvasAgent::frameNavigated): * inspector/InspectorCanvasAgent.h: * inspector/InspectorConsoleAgent.cpp: (WebCore::InspectorConsoleAgent::InspectorConsoleAgent): (WebCore::InspectorConsoleAgent::enable): (WebCore::InspectorConsoleAgent::clearMessages): (WebCore::InspectorConsoleAgent::didCreateFrontendAndBackend): (WebCore::InspectorConsoleAgent::willDestroyFrontendAndBackend): (WebCore::InspectorConsoleAgent::addMessageToConsole): (WebCore::InspectorConsoleAgent::didFinishXHRLoading): (WebCore::InspectorConsoleAgent::addConsoleMessage): * inspector/InspectorConsoleAgent.h: * inspector/InspectorController.cpp: (WebCore::InspectorController::InspectorController): (WebCore::InspectorController::connectFrontend): (WebCore::InspectorController::disconnectFrontend): (WebCore::InspectorController::show): (WebCore::InspectorController::close): * inspector/InspectorController.h: (WebCore::InspectorController::hasFrontend): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::InspectorDOMAgent): (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend): (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend): (WebCore::InspectorDOMAgent::setDocument): (WebCore::InspectorDOMAgent::pushChildNodesToFrontend): (WebCore::InspectorDOMAgent::pushNodePathToFrontend): (WebCore::InspectorDOMAgent::focusNode): (WebCore::InspectorDOMAgent::mainFrameDOMContentLoaded): (WebCore::InspectorDOMAgent::didCommitLoad): (WebCore::InspectorDOMAgent::didInsertDOMNode): (WebCore::InspectorDOMAgent::didRemoveDOMNode): (WebCore::InspectorDOMAgent::didModifyDOMAttr): (WebCore::InspectorDOMAgent::didRemoveDOMAttr): (WebCore::InspectorDOMAgent::styleAttributeInvalidated): (WebCore::InspectorDOMAgent::characterDataModified): (WebCore::InspectorDOMAgent::didPushShadowRoot): (WebCore::InspectorDOMAgent::willPopShadowRoot): * inspector/InspectorDOMAgent.h: * inspector/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent): (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend): (WebCore::InspectorDOMDebuggerAgent::willDestroyFrontendAndBackend): (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr): (WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode): (WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode): (WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr): (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest): * inspector/InspectorDOMDebuggerAgent.h: * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent): (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend): (WebCore::InspectorDOMStorageAgent::willDestroyFrontendAndBackend): (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent): * inspector/InspectorDOMStorageAgent.h: * inspector/InspectorDatabaseAgent.cpp: (WebCore::InspectorDatabaseAgent::didOpenDatabase): (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent): (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend): (WebCore::InspectorDatabaseAgent::willDestroyFrontendAndBackend): (WebCore::InspectorDatabaseAgent::enable): * inspector/InspectorDatabaseAgent.h: * inspector/InspectorDatabaseResource.cpp: (WebCore::InspectorDatabaseResource::bind): * inspector/InspectorDatabaseResource.h: * inspector/InspectorDebuggerAgent.cpp: (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent): (WebCore::InspectorDebuggerAgent::enable): (WebCore::InspectorDebuggerAgent::didCreateFrontendAndBackend): (WebCore::InspectorDebuggerAgent::willDestroyFrontendAndBackend): (WebCore::InspectorDebuggerAgent::addMessageToConsole): (WebCore::InspectorDebuggerAgent::schedulePauseOnNextStatement): (WebCore::InspectorDebuggerAgent::scriptExecutionBlockedByCSP): (WebCore::InspectorDebuggerAgent::didParseSource): (WebCore::InspectorDebuggerAgent::failedToParseSource): (WebCore::InspectorDebuggerAgent::didPause): (WebCore::InspectorDebuggerAgent::didContinue): (WebCore::InspectorDebuggerAgent::breakProgram): (WebCore::InspectorDebuggerAgent::clearBreakDetails): (WebCore::InspectorDebuggerAgent::reset): * inspector/InspectorDebuggerAgent.h: * inspector/InspectorHeapProfilerAgent.cpp: (WebCore::InspectorHeapProfilerAgent::InspectorHeapProfilerAgent): (WebCore::InspectorHeapProfilerAgent::resetFrontendProfiles): (WebCore::InspectorHeapProfilerAgent::didCreateFrontendAndBackend): (WebCore::InspectorHeapProfilerAgent::willDestroyFrontendAndBackend): (WebCore::InspectorHeapProfilerAgent::getHeapSnapshot): (WebCore::InspectorHeapProfilerAgent::takeHeapSnapshot): * inspector/InspectorHeapProfilerAgent.h: * inspector/InspectorIndexedDBAgent.cpp: (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent): (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend): (WebCore::InspectorIndexedDBAgent::willDestroyFrontendAndBackend): * inspector/InspectorIndexedDBAgent.h: * inspector/InspectorInputAgent.cpp: (WebCore::InspectorInputAgent::InspectorInputAgent): (WebCore::InspectorInputAgent::didCreateFrontendAndBackend): (WebCore::InspectorInputAgent::willDestroyFrontendAndBackend): * inspector/InspectorInputAgent.h: * inspector/InspectorLayerTreeAgent.cpp: (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent): (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend): (WebCore::InspectorLayerTreeAgent::willDestroyFrontendAndBackend): (WebCore::InspectorLayerTreeAgent::layerTreeDidChange): * inspector/InspectorLayerTreeAgent.h: * inspector/InspectorMemoryAgent.cpp: (WebCore::InspectorMemoryAgent::didCreateFrontendAndBackend): (WebCore::InspectorMemoryAgent::willDestroyFrontendAndBackend): (WebCore::InspectorMemoryAgent::InspectorMemoryAgent): * inspector/InspectorMemoryAgent.h: * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::InspectorPageAgent): (WebCore::InspectorPageAgent::didCreateFrontendAndBackend): (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend): (WebCore::InspectorPageAgent::didClearWindowObjectInWorld): (WebCore::InspectorPageAgent::domContentEventFired): (WebCore::InspectorPageAgent::loadEventFired): (WebCore::InspectorPageAgent::frameNavigated): (WebCore::InspectorPageAgent::frameDetached): (WebCore::InspectorPageAgent::frameStartedLoading): (WebCore::InspectorPageAgent::frameStoppedLoading): (WebCore::InspectorPageAgent::frameScheduledNavigation): (WebCore::InspectorPageAgent::frameClearedScheduledNavigation): (WebCore::InspectorPageAgent::willRunJavaScriptDialog): (WebCore::InspectorPageAgent::didRunJavaScriptDialog): (WebCore::InspectorPageAgent::scriptsEnabled): * inspector/InspectorPageAgent.h: * inspector/InspectorProfilerAgent.cpp: (WebCore::InspectorProfilerAgent::InspectorProfilerAgent): (WebCore::InspectorProfilerAgent::addProfile): (WebCore::InspectorProfilerAgent::addProfileFinishedMessageToConsole): (WebCore::InspectorProfilerAgent::addStartProfilingMessageToConsole): (WebCore::InspectorProfilerAgent::getHeapSnapshot): (WebCore::InspectorProfilerAgent::resetFrontendProfiles): (WebCore::InspectorProfilerAgent::didCreateFrontendAndBackend): (WebCore::InspectorProfilerAgent::willDestroyFrontendAndBackend): (WebCore::InspectorProfilerAgent::takeHeapSnapshot): (WebCore::InspectorProfilerAgent::toggleRecordButton): * inspector/InspectorProfilerAgent.h: * inspector/InspectorResourceAgent.cpp: (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend): (WebCore::InspectorResourceAgent::willDestroyFrontendAndBackend): (WebCore::InspectorResourceAgent::willSendRequest): (WebCore::InspectorResourceAgent::markResourceAsCached): (WebCore::InspectorResourceAgent::didReceiveResponse): (WebCore::InspectorResourceAgent::didReceiveData): (WebCore::InspectorResourceAgent::didFinishLoading): (WebCore::InspectorResourceAgent::didFailLoading): (WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache): (WebCore::InspectorResourceAgent::didCreateWebSocket): (WebCore::InspectorResourceAgent::willSendWebSocketHandshakeRequest): (WebCore::InspectorResourceAgent::didReceiveWebSocketHandshakeResponse): (WebCore::InspectorResourceAgent::didCloseWebSocket): (WebCore::InspectorResourceAgent::didReceiveWebSocketFrame): (WebCore::InspectorResourceAgent::didSendWebSocketFrame): (WebCore::InspectorResourceAgent::didReceiveWebSocketFrameError): (WebCore::InspectorResourceAgent::enable): (WebCore::InspectorResourceAgent::InspectorResourceAgent): * inspector/InspectorResourceAgent.h: * inspector/InspectorRuntimeAgent.cpp: (WebCore::InspectorRuntimeAgent::InspectorRuntimeAgent): * inspector/InspectorRuntimeAgent.h: * inspector/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::~InspectorTimelineAgent): (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend): (WebCore::InspectorTimelineAgent::start): (WebCore::InspectorTimelineAgent::InspectorTimelineAgent): (WebCore::InspectorTimelineAgent::sendEvent): * inspector/InspectorTimelineAgent.h: * inspector/InspectorWorkerAgent.cpp: (WebCore::InspectorWorkerAgent::WorkerFrontendChannel::WorkerFrontendChannel): (WebCore::InspectorWorkerAgent::WorkerFrontendChannel::dispatchMessageFromWorker): (WebCore::InspectorWorkerAgent::InspectorWorkerAgent): (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend): (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend): (WebCore::InspectorWorkerAgent::enable): (WebCore::InspectorWorkerAgent::disable): (WebCore::InspectorWorkerAgent::didStartWorkerGlobalScope): (WebCore::InspectorWorkerAgent::workerGlobalScopeTerminated): (WebCore::InspectorWorkerAgent::createWorkerFrontendChannel): * inspector/InspectorWorkerAgent.h: * inspector/PageRuntimeAgent.cpp: (WebCore::PageRuntimeAgent::PageRuntimeAgent): (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend): (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend): (WebCore::PageRuntimeAgent::didCreateMainWorldContext): (WebCore::PageRuntimeAgent::didCreateIsolatedContext): (WebCore::PageRuntimeAgent::notifyContextCreated): * inspector/PageRuntimeAgent.h: * inspector/TimelineRecordFactory.h: * inspector/WorkerInspectorController.cpp: (WebCore::WorkerInspectorController::connectFrontend): (WebCore::WorkerInspectorController::disconnectFrontend): * inspector/WorkerInspectorController.h: (WebCore::WorkerInspectorController::hasFrontend): * inspector/WorkerRuntimeAgent.cpp: (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend): (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend): * inspector/WorkerRuntimeAgent.h: * inspector/protocol/Input.json: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20fd448a