Changeset 246177 in webkit
- Timestamp:
- Jun 6, 2019 4:31:40 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r246166 r246177 1 2019-06-06 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: create CommandLineAPIHost lazily like the other agents 4 https://bugs.webkit.org/show_bug.cgi?id=196047 5 <rdar://problem/49087835> 6 7 Reviewed by Timothy Hatcher. 8 9 * inspector/InjectedScriptManager.h: 10 * inspector/InjectedScriptManager.cpp: 11 (Inspector::InjectedScriptManager::connect): Added. 12 1 13 2019-06-06 Keith Miller <keith_miller@apple.com> 2 14 -
trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp
r243161 r246177 58 58 } 59 59 60 void InjectedScriptManager::connect() 61 { 62 } 63 60 64 void InjectedScriptManager::disconnect() 61 65 { -
trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.h
r243161 r246177 50 50 virtual ~InjectedScriptManager(); 51 51 52 virtual void connect(); 52 53 virtual void disconnect(); 53 54 virtual void discardInjectedScripts(); -
trunk/Source/WebCore/ChangeLog
r246170 r246177 1 2019-06-06 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: create CommandLineAPIHost lazily like the other agents 4 https://bugs.webkit.org/show_bug.cgi?id=196047 5 <rdar://problem/49087835> 6 7 Reviewed by Timothy Hatcher. 8 9 No change in functionality. 10 11 * inspector/InspectorController.cpp: 12 (WebCore::InspectorController::InspectorController): 13 (WebCore::InspectorController::createLazyAgents): 14 * inspector/WorkerInspectorController.cpp: 15 (WebCore::WorkerInspectorController::WorkerInspectorController): 16 (WebCore::WorkerInspectorController::createLazyAgents): 17 18 * inspector/WebInjectedScriptManager.h: 19 * inspector/WebInjectedScriptManager.cpp: 20 (WebCore::WebInjectedScriptManager::WebInjectedScriptManager): 21 (WebCore::WebInjectedScriptManager::connect): Added. 22 (WebCore::WebInjectedScriptManager::disconnect): 23 (WebCore::WebInjectedScriptManager::discardInjectedScripts): 24 25 * inspector/agents/InspectorDOMAgent.cpp: 26 (WebCore::InspectorDOMAgent::setInspectedNode): 27 1 28 2019-06-05 Said Abou-Hallawa <sabouhallawa@apple.com> 2 29 -
trunk/Source/WebCore/inspector/InspectorController.cpp
r246142 r246177 110 110 m_instrumentingAgents->setWebConsoleAgent(consoleAgent.get()); 111 111 m_agents.append(WTFMove(consoleAgent)); 112 113 ASSERT(m_injectedScriptManager->commandLineAPIHost());114 if (auto* commandLineAPIHost = m_injectedScriptManager->commandLineAPIHost())115 commandLineAPIHost->init(m_instrumentingAgents.copyRef());116 112 } 117 113 … … 150 146 151 147 m_didCreateLazyAgents = true; 148 149 m_injectedScriptManager->connect(); 152 150 153 151 auto pageContext = pageAgentContext(); … … 187 185 m_agents.append(std::make_unique<InspectorCanvasAgent>(pageContext)); 188 186 m_agents.append(std::make_unique<InspectorTimelineAgent>(pageContext)); 187 188 if (auto& commandLineAPIHost = m_injectedScriptManager->commandLineAPIHost()) 189 commandLineAPIHost->init(m_instrumentingAgents.copyRef()); 189 190 } 190 191 -
trunk/Source/WebCore/inspector/WebInjectedScriptManager.cpp
r225263 r246177 37 37 WebInjectedScriptManager::WebInjectedScriptManager(InspectorEnvironment& environment, Ref<InjectedScriptHost>&& host) 38 38 : InjectedScriptManager(environment, WTFMove(host)) 39 , m_commandLineAPIHost(CommandLineAPIHost::create())40 39 { 40 } 41 42 void WebInjectedScriptManager::connect() 43 { 44 InjectedScriptManager::connect(); 45 46 m_commandLineAPIHost = CommandLineAPIHost::create(); 41 47 } 42 48 … … 45 51 InjectedScriptManager::disconnect(); 46 52 47 m_commandLineAPIHost->disconnect(); 48 m_commandLineAPIHost = nullptr; 53 if (m_commandLineAPIHost) { 54 m_commandLineAPIHost->disconnect(); 55 m_commandLineAPIHost = nullptr; 56 } 49 57 } 50 58 … … 53 61 InjectedScriptManager::discardInjectedScripts(); 54 62 55 m_commandLineAPIHost->clearAllWrappers(); 63 if (m_commandLineAPIHost) 64 m_commandLineAPIHost->clearAllWrappers(); 56 65 } 57 66 -
trunk/Source/WebCore/inspector/WebInjectedScriptManager.h
r228218 r246177 41 41 virtual ~WebInjectedScriptManager() = default; 42 42 43 CommandLineAPIHost* commandLineAPIHost() const { return m_commandLineAPIHost.get(); }43 const RefPtr<CommandLineAPIHost>& commandLineAPIHost() const { return m_commandLineAPIHost; } 44 44 45 void connect() override; 45 46 void disconnect() override; 46 47 void discardInjectedScripts() override; -
trunk/Source/WebCore/inspector/WorkerInspectorController.cpp
r243243 r246177 73 73 m_instrumentingAgents->setWebConsoleAgent(consoleAgent.get()); 74 74 m_agents.append(WTFMove(consoleAgent)); 75 76 if (auto* commandLineAPIHost = m_injectedScriptManager->commandLineAPIHost())77 commandLineAPIHost->init(m_instrumentingAgents.copyRef());78 75 } 79 76 … … 164 161 m_didCreateLazyAgents = true; 165 162 163 m_injectedScriptManager->connect(); 164 166 165 auto workerContext = workerAgentContext(); 167 166 … … 178 177 m_agents.append(std::make_unique<WorkerDebuggerAgent>(workerContext)); 179 178 m_agents.append(std::make_unique<WorkerAuditAgent>(workerContext)); 179 180 if (auto& commandLineAPIHost = m_injectedScriptManager->commandLineAPIHost()) 181 commandLineAPIHost->init(m_instrumentingAgents.copyRef()); 180 182 } 181 183 -
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
r245730 r246177 1410 1410 m_inspectedNode = node; 1411 1411 1412 if ( CommandLineAPIHost*commandLineAPIHost = static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).commandLineAPIHost())1412 if (auto& commandLineAPIHost = static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).commandLineAPIHost()) 1413 1413 commandLineAPIHost->addInspectedObject(std::make_unique<InspectableNode>(node)); 1414 1414
Note: See TracChangeset
for help on using the changeset viewer.