Changeset 244172 in webkit
- Timestamp:
- Apr 10, 2019, 5:33:29 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp (modified) (4 diffs)
-
JavaScriptCore/inspector/agents/InspectorAgent.cpp (modified) (1 diff)
-
JavaScriptCore/inspector/agents/InspectorAgent.h (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/inspector/InspectorController.cpp (modified) (4 diffs)
-
WebCore/inspector/InspectorController.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r244163 r244172 1 2019-04-10 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Inspector: lazily create the agent 4 https://bugs.webkit.org/show_bug.cgi?id=195971 5 <rdar://problem/49039645> 6 7 Reviewed by Joseph Pecoraro. 8 9 * inspector/JSGlobalObjectInspectorController.cpp: 10 (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController): 11 (Inspector::JSGlobalObjectInspectorController::connectFrontend): 12 (Inspector::JSGlobalObjectInspectorController::appendExtraAgent): 13 (Inspector::JSGlobalObjectInspectorController::createLazyAgents): 14 15 * inspector/agents/InspectorAgent.h: 16 * inspector/agents/InspectorAgent.cpp: 17 1 18 2019-04-10 Saam Barati <sbarati@apple.com> 2 19 -
trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
r243243 r244172 72 72 auto context = jsAgentContext(); 73 73 74 auto inspectorAgent = std::make_unique<InspectorAgent>(context);75 74 auto consoleAgent = std::make_unique<InspectorConsoleAgent>(context); 76 77 m_inspectorAgent = inspectorAgent.get();78 75 m_consoleAgent = consoleAgent.get(); 76 m_agents.append(WTFMove(consoleAgent)); 77 79 78 m_consoleClient = std::make_unique<JSGlobalObjectConsoleClient>(m_consoleAgent); 80 81 m_agents.append(WTFMove(inspectorAgent));82 m_agents.append(WTFMove(consoleAgent));83 79 84 80 m_executionStopwatch->start(); … … 123 119 124 120 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) 121 ASSERT(m_inspectorAgent); 125 122 m_inspectorAgent->activateExtraDomains(m_agents.extraDomains()); 126 123 … … 278 275 m_agents.appendExtraAgent(WTFMove(agent)); 279 276 277 ASSERT(m_inspectorAgent); 280 278 m_inspectorAgent->activateExtraDomain(domainName); 281 279 } … … 308 306 auto context = jsAgentContext(); 309 307 308 auto inspectorAgent = std::make_unique<InspectorAgent>(context); 309 m_inspectorAgent = inspectorAgent.get(); 310 m_agents.append(WTFMove(inspectorAgent)); 311 310 312 m_agents.append(std::make_unique<JSGlobalObjectRuntimeAgent>(context)); 311 313 -
trunk/Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp
r239460 r244172 43 43 , m_frontendDispatcher(std::make_unique<InspectorFrontendDispatcher>(context.frontendRouter)) 44 44 , m_backendDispatcher(InspectorBackendDispatcher::create(context.backendDispatcher, this)) 45 {46 }47 48 InspectorAgent::~InspectorAgent()49 45 { 50 46 } -
trunk/Source/JavaScriptCore/inspector/agents/InspectorAgent.h
r239460 r244172 48 48 public: 49 49 InspectorAgent(AgentContext&); 50 virtual ~InspectorAgent() ;50 virtual ~InspectorAgent() = default; 51 51 52 52 void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) override; -
trunk/Source/WebCore/ChangeLog
r244169 r244172 1 2019-04-10 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Inspector: lazily create the agent 4 https://bugs.webkit.org/show_bug.cgi?id=195971 5 <rdar://problem/49039645> 6 7 Reviewed by Joseph Pecoraro. 8 9 No change in functionality. 10 11 * inspector/InspectorController.h: 12 * inspector/InspectorController.cpp: 13 (WebCore::InspectorController::InspectorController): 14 (WebCore::InspectorController::createLazyAgents): 15 (WebCore::InspectorController::evaluateForTestInFrontend): 16 (WebCore::InspectorController::ensureInspectorAgent): 17 1 18 2019-04-10 Megan Gardner <megan_gardner@apple.com> 2 19 -
trunk/Source/WebCore/inspector/InspectorController.cpp
r244167 r244172 107 107 auto pageContext = pageAgentContext(); 108 108 109 auto inspectorAgentPtr = std::make_unique<InspectorAgent>(pageContext);110 m_inspectorAgent = inspectorAgentPtr.get();111 m_instrumentingAgents->setInspectorAgent(m_inspectorAgent);112 m_agents.append(WTFMove(inspectorAgentPtr));113 114 109 auto consoleAgent = std::make_unique<PageConsoleAgent>(pageContext); 115 110 m_instrumentingAgents->setWebConsoleAgent(consoleAgent.get()); … … 158 153 auto pageContext = pageAgentContext(); 159 154 155 ensureInspectorAgent(); 160 156 ensurePageAgent(); 161 157 … … 360 356 void InspectorController::evaluateForTestInFrontend(const String& script) 361 357 { 362 m_inspectorAgent->evaluateForTestInFrontend(script);358 ensureInspectorAgent().evaluateForTestInFrontend(script); 363 359 } 364 360 … … 421 417 } 422 418 419 InspectorAgent& InspectorController::ensureInspectorAgent() 420 { 421 if (!m_inspectorAgent) { 422 auto pageContext = pageAgentContext(); 423 auto inspectorAgent = std::make_unique<InspectorAgent>(pageContext); 424 m_inspectorAgent = inspectorAgent.get(); 425 m_instrumentingAgents->setInspectorAgent(m_inspectorAgent); 426 m_agents.append(WTFMove(inspectorAgent)); 427 } 428 return *m_inspectorAgent; 429 } 430 423 431 InspectorDOMAgent& InspectorController::ensureDOMAgent() 424 432 { -
trunk/Source/WebCore/inspector/InspectorController.h
r244167 r244172 107 107 InspectorFrontendClient* inspectorFrontendClient() const { return m_inspectorFrontendClient; } 108 108 109 Inspector::InspectorAgent& ensureInspectorAgent(); 109 110 InspectorDOMAgent& ensureDOMAgent(); 110 111 WEBCORE_EXPORT InspectorPageAgent& ensurePageAgent(); … … 139 140 InspectorFrontendClient* m_inspectorFrontendClient { nullptr }; 140 141 142 // Lazy, but also on-demand agents. 141 143 Inspector::InspectorAgent* m_inspectorAgent { nullptr }; 142 143 // Lazy, but also on-demand agents.144 144 InspectorDOMAgent* m_inspectorDOMAgent { nullptr }; 145 145 InspectorPageAgent* m_inspectorPageAgent { nullptr };
Note:
See TracChangeset
for help on using the changeset viewer.