WebDevToolsAgentImpl::WebDevToolsAgentImpl( WebLocalFrameImpl* webLocalFrameImpl, WebDevToolsAgentClient* client, InspectorOverlay* overlay) : m_client(client) , m_webLocalFrameImpl(webLocalFrameImpl) , m_attached(false) #if ENABLE(ASSERT) , m_hasBeenDisposed(false) #endif , m_instrumentingAgents(m_webLocalFrameImpl->frame()->instrumentingAgents()) , m_injectedScriptManager(InjectedScriptManager::createForPage()) , m_resourceContentLoader(InspectorResourceContentLoader::create(m_webLocalFrameImpl->frame())) , m_state(adoptPtrWillBeNoop(new InspectorCompositeState(this))) , m_overlay(overlay) , m_cssAgent(nullptr) , m_resourceAgent(nullptr) , m_layerTreeAgent(nullptr) , m_agents(m_instrumentingAgents.get(), m_state.get()) , m_deferredAgentsInitialized(false) { ASSERT(isMainThread()); ASSERT(m_webLocalFrameImpl->frame()); long processId = Platform::current()->getUniqueIdForProcess(); ASSERT(processId > 0); IdentifiersFactory::setProcessId(processId); InjectedScriptManager* injectedScriptManager = m_injectedScriptManager.get(); OwnPtrWillBeRawPtr<InspectorInspectorAgent> inspectorAgentPtr(InspectorInspectorAgent::create(injectedScriptManager)); m_inspectorAgent = inspectorAgentPtr.get(); m_agents.append(inspectorAgentPtr.release()); OwnPtrWillBeRawPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::create(m_webLocalFrameImpl->frame(), m_overlay, m_resourceContentLoader.get())); m_pageAgent = pageAgentPtr.get(); m_agents.append(pageAgentPtr.release()); OwnPtrWillBeRawPtr<InspectorDOMAgent> domAgentPtr(InspectorDOMAgent::create(m_pageAgent, injectedScriptManager, m_overlay)); m_domAgent = domAgentPtr.get(); m_agents.append(domAgentPtr.release()); OwnPtrWillBeRawPtr<InspectorLayerTreeAgent> layerTreeAgentPtr(InspectorLayerTreeAgent::create(m_pageAgent)); m_layerTreeAgent = layerTreeAgentPtr.get(); m_agents.append(layerTreeAgentPtr.release()); m_agents.append(InspectorTimelineAgent::create()); ClientMessageLoopAdapter::ensureMainThreadDebuggerCreated(m_client); MainThreadDebugger* mainThreadDebugger = MainThreadDebugger::instance(); OwnPtrWillBeRawPtr<PageRuntimeAgent> pageRuntimeAgentPtr(PageRuntimeAgent::create(injectedScriptManager, this, mainThreadDebugger->debugger(), m_pageAgent)); m_pageRuntimeAgent = pageRuntimeAgentPtr.get(); m_agents.append(pageRuntimeAgentPtr.release()); OwnPtrWillBeRawPtr<PageConsoleAgent> pageConsoleAgentPtr = PageConsoleAgent::create(injectedScriptManager, m_domAgent, m_pageAgent); m_pageConsoleAgent = pageConsoleAgentPtr.get(); OwnPtrWillBeRawPtr<InspectorWorkerAgent> workerAgentPtr = InspectorWorkerAgent::create(pageConsoleAgentPtr.get()); OwnPtrWillBeRawPtr<InspectorTracingAgent> tracingAgentPtr = InspectorTracingAgent::create(this, workerAgentPtr.get(), m_pageAgent); m_tracingAgent = tracingAgentPtr.get(); m_agents.append(tracingAgentPtr.release()); m_agents.append(workerAgentPtr.release()); m_agents.append(pageConsoleAgentPtr.release()); m_agents.append(ScreenOrientationInspectorAgent::create(*m_webLocalFrameImpl->frame())); }
InspectorController::InspectorController(Page* page, InspectorClient* inspectorClient) : m_instrumentingAgents(InstrumentingAgents::create()) , m_injectedScriptManager(InjectedScriptManager::createForPage()) , m_state(adoptPtr(new InspectorCompositeState(inspectorClient))) , m_overlay(InspectorOverlay::create(page, inspectorClient)) , m_page(page) , m_inspectorClient(inspectorClient) , m_isUnderTest(false) { OwnPtr<InspectorAgent> inspectorAgentPtr(InspectorAgent::create(page, m_injectedScriptManager.get(), m_instrumentingAgents.get(), m_state.get())); m_inspectorAgent = inspectorAgentPtr.get(); m_agents.append(inspectorAgentPtr.release()); OwnPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::create(m_instrumentingAgents.get(), page, m_inspectorAgent, m_state.get(), m_injectedScriptManager.get(), inspectorClient, m_overlay.get())); InspectorPageAgent* pageAgent = pageAgentPtr.get(); m_pageAgent = pageAgentPtr.get(); m_agents.append(pageAgentPtr.release()); OwnPtr<InspectorDOMAgent> domAgentPtr(InspectorDOMAgent::create(m_instrumentingAgents.get(), pageAgent, m_state.get(), m_injectedScriptManager.get(), m_overlay.get(), inspectorClient)); m_domAgent = domAgentPtr.get(); m_agents.append(domAgentPtr.release()); m_agents.append(InspectorCSSAgent::create(m_instrumentingAgents.get(), m_state.get(), m_domAgent)); #if ENABLE(SQL_DATABASE) OwnPtr<InspectorDatabaseAgent> databaseAgentPtr(InspectorDatabaseAgent::create(m_instrumentingAgents.get(), m_state.get())); InspectorDatabaseAgent* databaseAgent = databaseAgentPtr.get(); m_agents.append(databaseAgentPtr.release()); #endif #if ENABLE(INDEXED_DATABASE) m_agents.append(InspectorIndexedDBAgent::create(m_instrumentingAgents.get(), m_state.get(), m_injectedScriptManager.get(), pageAgent)); #endif #if ENABLE(FILE_SYSTEM) m_agents.append(InspectorFileSystemAgent::create(m_instrumentingAgents.get(), pageAgent, m_state.get())); #endif OwnPtr<InspectorDOMStorageAgent> domStorageAgentPtr(InspectorDOMStorageAgent::create(m_instrumentingAgents.get(), m_pageAgent, m_state.get())); InspectorDOMStorageAgent* domStorageAgent = domStorageAgentPtr.get(); m_agents.append(domStorageAgentPtr.release()); OwnPtr<InspectorMemoryAgent> memoryAgentPtr(InspectorMemoryAgent::create(m_instrumentingAgents.get(), m_state.get())); m_memoryAgent = memoryAgentPtr.get(); m_agents.append(memoryAgentPtr.release()); m_agents.append(InspectorTimelineAgent::create(m_instrumentingAgents.get(), pageAgent, m_memoryAgent, m_state.get(), InspectorTimelineAgent::PageInspector, inspectorClient)); m_agents.append(InspectorApplicationCacheAgent::create(m_instrumentingAgents.get(), m_state.get(), pageAgent)); OwnPtr<InspectorResourceAgent> resourceAgentPtr(InspectorResourceAgent::create(m_instrumentingAgents.get(), pageAgent, inspectorClient, m_state.get())); m_resourceAgent = resourceAgentPtr.get(); m_agents.append(resourceAgentPtr.release()); OwnPtr<InspectorRuntimeAgent> runtimeAgentPtr(PageRuntimeAgent::create(m_instrumentingAgents.get(), m_state.get(), m_injectedScriptManager.get(), page, pageAgent)); InspectorRuntimeAgent* runtimeAgent = runtimeAgentPtr.get(); m_agents.append(runtimeAgentPtr.release()); OwnPtr<InspectorConsoleAgent> consoleAgentPtr(PageConsoleAgent::create(m_instrumentingAgents.get(), m_inspectorAgent, m_state.get(), m_injectedScriptManager.get(), m_domAgent)); InspectorConsoleAgent* consoleAgent = consoleAgentPtr.get(); m_agents.append(consoleAgentPtr.release()); #if ENABLE(JAVASCRIPT_DEBUGGER) OwnPtr<InspectorDebuggerAgent> debuggerAgentPtr(PageDebuggerAgent::create(m_instrumentingAgents.get(), m_state.get(), pageAgent, m_injectedScriptManager.get(), m_overlay.get())); m_debuggerAgent = debuggerAgentPtr.get(); m_agents.append(debuggerAgentPtr.release()); OwnPtr<InspectorDOMDebuggerAgent> domDebuggerAgentPtr(InspectorDOMDebuggerAgent::create(m_instrumentingAgents.get(), m_state.get(), m_domAgent, m_debuggerAgent, m_inspectorAgent)); m_domDebuggerAgent = domDebuggerAgentPtr.get(); m_agents.append(domDebuggerAgentPtr.release()); OwnPtr<InspectorProfilerAgent> profilerAgentPtr(InspectorProfilerAgent::create(m_instrumentingAgents.get(), consoleAgent, page, m_state.get(), m_injectedScriptManager.get())); m_profilerAgent = profilerAgentPtr.get(); m_agents.append(profilerAgentPtr.release()); m_agents.append(InspectorHeapProfilerAgent::create(m_instrumentingAgents.get(), m_state.get(), m_injectedScriptManager.get())); #endif #if ENABLE(WORKERS) m_agents.append(InspectorWorkerAgent::create(m_instrumentingAgents.get(), m_state.get())); #endif m_agents.append(InspectorCanvasAgent::create(m_instrumentingAgents.get(), m_state.get(), pageAgent, m_injectedScriptManager.get())); m_agents.append(InspectorInputAgent::create(m_instrumentingAgents.get(), m_state.get(), page)); #if USE(ACCELERATED_COMPOSITING) m_agents.append(InspectorLayerTreeAgent::create(m_instrumentingAgents.get(), m_state.get())); #endif ASSERT_ARG(inspectorClient, inspectorClient); m_injectedScriptManager->injectedScriptHost()->init(m_inspectorAgent , consoleAgent #if ENABLE(SQL_DATABASE) , databaseAgent #endif , domStorageAgent , m_domAgent , m_debuggerAgent ); #if ENABLE(JAVASCRIPT_DEBUGGER) runtimeAgent->setScriptDebugServer(&m_debuggerAgent->scriptDebugServer()); #endif }
InspectorController::InspectorController(Page* page, InspectorClient* inspectorClient) : m_instrumentingAgents(InstrumentingAgents::create()) , m_injectedScriptManager(InjectedScriptManager::createForPage()) , m_state(adoptPtr(new InspectorCompositeState(inspectorClient))) , m_overlay(InspectorOverlay::create(page, inspectorClient)) , m_page(page) , m_inspectorClient(inspectorClient) , m_isUnderTest(false) { OwnPtr<InspectorAgent> inspectorAgentPtr(InspectorAgent::create(page, m_injectedScriptManager.get(), m_instrumentingAgents.get(), m_state.get())); m_inspectorAgent = inspectorAgentPtr.get(); m_agents.append(inspectorAgentPtr.release()); OwnPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::create(m_instrumentingAgents.get(), page, m_inspectorAgent, m_state.get(), m_injectedScriptManager.get(), inspectorClient, m_overlay.get())); InspectorPageAgent* pageAgent = pageAgentPtr.get(); m_pageAgent = pageAgentPtr.get(); m_agents.append(pageAgentPtr.release()); OwnPtr<InspectorDOMAgent> domAgentPtr(InspectorDOMAgent::create(m_instrumentingAgents.get(), pageAgent, m_state.get(), m_injectedScriptManager.get(), m_overlay.get(), inspectorClient)); m_domAgent = domAgentPtr.get(); m_agents.append(domAgentPtr.release()); m_agents.append(InspectorCSSAgent::create(m_instrumentingAgents.get(), m_state.get(), m_domAgent, m_pageAgent)); OwnPtr<InspectorDatabaseAgent> databaseAgentPtr(InspectorDatabaseAgent::create(m_instrumentingAgents.get(), m_state.get())); InspectorDatabaseAgent* databaseAgent = databaseAgentPtr.get(); m_agents.append(databaseAgentPtr.release()); m_agents.append(InspectorIndexedDBAgent::create(m_instrumentingAgents.get(), m_state.get(), m_injectedScriptManager.get(), pageAgent)); m_agents.append(InspectorFileSystemAgent::create(m_instrumentingAgents.get(), pageAgent, m_state.get())); OwnPtr<InspectorDOMStorageAgent> domStorageAgentPtr(InspectorDOMStorageAgent::create(m_instrumentingAgents.get(), m_pageAgent, m_state.get())); InspectorDOMStorageAgent* domStorageAgent = domStorageAgentPtr.get(); m_agents.append(domStorageAgentPtr.release()); OwnPtr<InspectorMemoryAgent> memoryAgentPtr(InspectorMemoryAgent::create(m_instrumentingAgents.get(), inspectorClient, m_state.get(), m_page)); m_memoryAgent = memoryAgentPtr.get(); m_agents.append(memoryAgentPtr.release()); m_agents.append(InspectorTimelineAgent::create(m_instrumentingAgents.get(), pageAgent, m_memoryAgent, m_domAgent, m_state.get(), InspectorTimelineAgent::PageInspector, inspectorClient)); m_agents.append(InspectorApplicationCacheAgent::create(m_instrumentingAgents.get(), m_state.get(), pageAgent)); OwnPtr<InspectorResourceAgent> resourceAgentPtr(InspectorResourceAgent::create(m_instrumentingAgents.get(), pageAgent, inspectorClient, m_state.get())); m_resourceAgent = resourceAgentPtr.get(); m_agents.append(resourceAgentPtr.release()); OwnPtr<InspectorRuntimeAgent> runtimeAgentPtr(PageRuntimeAgent::create(m_instrumentingAgents.get(), m_state.get(), m_injectedScriptManager.get(), page, pageAgent)); InspectorRuntimeAgent* runtimeAgent = runtimeAgentPtr.get(); m_agents.append(runtimeAgentPtr.release()); OwnPtr<InspectorConsoleAgent> consoleAgentPtr(PageConsoleAgent::create(m_instrumentingAgents.get(), m_inspectorAgent, m_state.get(), m_injectedScriptManager.get(), m_domAgent)); InspectorConsoleAgent* consoleAgent = consoleAgentPtr.get(); m_agents.append(consoleAgentPtr.release()); OwnPtr<InspectorDebuggerAgent> debuggerAgentPtr(PageDebuggerAgent::create(m_instrumentingAgents.get(), m_state.get(), pageAgent, m_injectedScriptManager.get(), m_overlay.get())); m_debuggerAgent = debuggerAgentPtr.get(); m_agents.append(debuggerAgentPtr.release()); OwnPtr<InspectorDOMDebuggerAgent> domDebuggerAgentPtr(InspectorDOMDebuggerAgent::create(m_instrumentingAgents.get(), m_state.get(), m_domAgent, m_debuggerAgent, m_inspectorAgent)); m_domDebuggerAgent = domDebuggerAgentPtr.get(); m_agents.append(domDebuggerAgentPtr.release()); OwnPtr<InspectorProfilerAgent> profilerAgentPtr(InspectorProfilerAgent::create(m_instrumentingAgents.get(), consoleAgent, page, m_state.get(), m_injectedScriptManager.get())); m_profilerAgent = profilerAgentPtr.get(); m_agents.append(profilerAgentPtr.release()); m_agents.append(InspectorHeapProfilerAgent::create(m_instrumentingAgents.get(), m_state.get(), m_injectedScriptManager.get())); m_agents.append(InspectorWorkerAgent::create(m_instrumentingAgents.get(), m_state.get())); m_agents.append(InspectorCanvasAgent::create(m_instrumentingAgents.get(), m_state.get(), pageAgent, m_injectedScriptManager.get())); m_agents.append(InspectorInputAgent::create(m_instrumentingAgents.get(), m_state.get(), page, inspectorClient)); m_agents.append(InspectorLayerTreeAgent::create(m_instrumentingAgents.get(), m_state.get())); ASSERT_ARG(inspectorClient, inspectorClient); m_injectedScriptManager->injectedScriptHost()->init(m_inspectorAgent , consoleAgent , databaseAgent , domStorageAgent , m_domAgent , m_debuggerAgent ); runtimeAgent->setScriptDebugServer(&m_debuggerAgent->scriptDebugServer()); }
InspectorController::InspectorController(Page* page, InspectorClient* inspectorClient) : m_instrumentingAgents(adoptPtr(new InstrumentingAgents())) , m_injectedScriptManager(InjectedScriptManager::createForPage()) , m_state(adoptPtr(new InspectorState(inspectorClient))) , m_page(page) , m_inspectorClient(inspectorClient) { OwnPtr<InspectorAgent> inspectorAgentPtr(InspectorAgent::create(page, m_injectedScriptManager.get(), m_instrumentingAgents.get(), m_state.get())); m_inspectorAgent = inspectorAgentPtr.get(); m_agents.append(inspectorAgentPtr.release()); OwnPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::create(m_instrumentingAgents.get(), page, m_inspectorAgent, m_state.get(), m_injectedScriptManager.get(), inspectorClient)); InspectorPageAgent* pageAgent = pageAgentPtr.get(); m_pageAgent = pageAgentPtr.get(); m_agents.append(pageAgentPtr.release()); OwnPtr<InspectorDOMAgent> domAgentPtr(InspectorDOMAgent::create(m_instrumentingAgents.get(), pageAgent, inspectorClient, m_state.get(), m_injectedScriptManager.get())); m_domAgent = domAgentPtr.get(); m_agents.append(domAgentPtr.release()); m_agents.append(InspectorCSSAgent::create(m_instrumentingAgents.get(), m_state.get(), m_domAgent)); #if ENABLE(SQL_DATABASE) OwnPtr<InspectorDatabaseAgent> databaseAgentPtr(InspectorDatabaseAgent::create(m_instrumentingAgents.get(), m_state.get())); InspectorDatabaseAgent* databaseAgent = databaseAgentPtr.get(); m_agents.append(databaseAgentPtr.release()); #endif #if ENABLE(INDEXED_DATABASE) m_agents.append(InspectorIndexedDBAgent::create(m_instrumentingAgents.get(), m_state.get(), m_injectedScriptManager.get(), pageAgent)); #endif #if ENABLE(FILE_SYSTEM) m_agents.append(InspectorFileSystemAgent::create(m_instrumentingAgents.get(), m_state.get())); #endif OwnPtr<InspectorDOMStorageAgent> domStorageAgentPtr(InspectorDOMStorageAgent::create(m_instrumentingAgents.get(), m_state.get())); InspectorDOMStorageAgent* domStorageAgent = domStorageAgentPtr.get(); m_agents.append(domStorageAgentPtr.release()); m_agents.append(InspectorMemoryAgent::create(m_instrumentingAgents.get(), m_state.get(), m_page, m_domAgent)); m_agents.append(InspectorTimelineAgent::create(m_instrumentingAgents.get(), m_state.get(), InspectorTimelineAgent::PageInspector, inspectorClient->supportsFrameInstrumentation() ? InspectorTimelineAgent::FrameInstrumentationSupported : InspectorTimelineAgent::FrameInstrumentationNotSupported)); m_agents.append(InspectorApplicationCacheAgent::create(m_instrumentingAgents.get(), m_state.get(), pageAgent)); OwnPtr<InspectorResourceAgent> resourceAgentPtr(InspectorResourceAgent::create(m_instrumentingAgents.get(), pageAgent, inspectorClient, m_state.get())); m_resourceAgent = resourceAgentPtr.get(); m_agents.append(resourceAgentPtr.release()); OwnPtr<InspectorRuntimeAgent> runtimeAgentPtr(PageRuntimeAgent::create(m_instrumentingAgents.get(), m_state.get(), m_injectedScriptManager.get(), page, pageAgent)); InspectorRuntimeAgent* runtimeAgent = runtimeAgentPtr.get(); m_agents.append(runtimeAgentPtr.release()); OwnPtr<InspectorConsoleAgent> consoleAgentPtr(PageConsoleAgent::create(m_instrumentingAgents.get(), m_inspectorAgent, m_state.get(), m_injectedScriptManager.get(), m_domAgent)); InspectorConsoleAgent* consoleAgent = consoleAgentPtr.get(); m_agents.append(consoleAgentPtr.release()); #if ENABLE(JAVASCRIPT_DEBUGGER) OwnPtr<InspectorDebuggerAgent> debuggerAgentPtr(PageDebuggerAgent::create(m_instrumentingAgents.get(), m_state.get(), page, m_injectedScriptManager.get())); m_debuggerAgent = debuggerAgentPtr.get(); m_agents.append(debuggerAgentPtr.release()); m_agents.append(InspectorDOMDebuggerAgent::create(m_instrumentingAgents.get(), m_state.get(), m_domAgent, m_debuggerAgent, m_inspectorAgent)); OwnPtr<InspectorProfilerAgent> profilerAgentPtr(InspectorProfilerAgent::create(m_instrumentingAgents.get(), consoleAgent, page, m_state.get(), m_injectedScriptManager.get())); m_profilerAgent = profilerAgentPtr.get(); m_agents.append(profilerAgentPtr.release()); #endif #if ENABLE(WORKERS) m_agents.append(InspectorWorkerAgent::create(m_instrumentingAgents.get(), m_state.get())); #endif ASSERT_ARG(inspectorClient, inspectorClient); m_injectedScriptManager->injectedScriptHost()->init(m_inspectorAgent , consoleAgent #if ENABLE(SQL_DATABASE) , databaseAgent #endif , domStorageAgent , m_domAgent ); #if ENABLE(JAVASCRIPT_DEBUGGER) runtimeAgent->setScriptDebugServer(&m_debuggerAgent->scriptDebugServer()); #endif }