WebKit Bugzilla
Attachment 369759 Details for
Bug 196047
: Web Inspector: create CommandLineAPIHost lazily like the other agents
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-196047-20190513120624.patch (text/plain), 9.37 KB, created by
Devin Rousso
on 2019-05-13 12:06:25 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-05-13 12:06:25 PDT
Size:
9.37 KB
patch
obsolete
>diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index eeb5b5c5aba6c329c7d8147131d091051250eac1..2e7d57ec27ac1c6f89caeabf33b52de13c08bf7f 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,15 @@ >+2019-05-13 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: create CommandLineAPIHost lazily like the other agents >+ https://bugs.webkit.org/show_bug.cgi?id=196047 >+ <rdar://problem/49087835> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/InjectedScriptManager.h: >+ * inspector/InjectedScriptManager.cpp: >+ (Inspector::InjectedScriptManager::connect): Added. >+ > 2019-05-12 Yusuke Suzuki <ysuzuki@apple.com> > > [JSC] Compress Watchpoint size by using enum type and Packed<> data structure >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e8d144433f1e105561f6d4832511776d9c5f2759..5bd7317d78787d3afc09abd950a116377d6a967c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,29 @@ >+2019-05-13 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: create CommandLineAPIHost lazily like the other agents >+ https://bugs.webkit.org/show_bug.cgi?id=196047 >+ <rdar://problem/49087835> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No change in functionality. >+ >+ * inspector/InspectorController.cpp: >+ (WebCore::InspectorController::InspectorController): >+ (WebCore::InspectorController::createLazyAgents): >+ * inspector/WorkerInspectorController.cpp: >+ (WebCore::WorkerInspectorController::WorkerInspectorController): >+ (WebCore::WorkerInspectorController::createLazyAgents): >+ >+ * inspector/WebInjectedScriptManager.h: >+ * inspector/WebInjectedScriptManager.cpp: >+ (WebCore::WebInjectedScriptManager::WebInjectedScriptManager): >+ (WebCore::WebInjectedScriptManager::connect): Added. >+ (WebCore::WebInjectedScriptManager::discardInjectedScripts): >+ >+ * inspector/agents/InspectorDOMAgent.cpp: >+ (WebCore::InspectorDOMAgent::setInspectedNode): >+ > 2019-05-12 Simon Fraser <simon.fraser@apple.com> > > When the set of backing-sharing layers changes, we need to issue a repaint >diff --git a/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp b/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp >index 53e88f9f8b2177e21792847e1caad6cc2b25011b..76d988cd5d4525cefcb0d0c988927f470bb9a9a9 100644 >--- a/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp >+++ b/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp >@@ -57,6 +57,10 @@ InjectedScriptManager::~InjectedScriptManager() > { > } > >+void InjectedScriptManager::connect() >+{ >+} >+ > void InjectedScriptManager::disconnect() > { > discardInjectedScripts(); >diff --git a/Source/JavaScriptCore/inspector/InjectedScriptManager.h b/Source/JavaScriptCore/inspector/InjectedScriptManager.h >index ea48fa9301c5598f51960194682e48d609d6808d..8a329581f3bdaf47ed0c88b6608acdc4d505833a 100644 >--- a/Source/JavaScriptCore/inspector/InjectedScriptManager.h >+++ b/Source/JavaScriptCore/inspector/InjectedScriptManager.h >@@ -49,6 +49,7 @@ public: > InjectedScriptManager(InspectorEnvironment&, Ref<InjectedScriptHost>&&); > virtual ~InjectedScriptManager(); > >+ virtual void connect(); > virtual void disconnect(); > virtual void discardInjectedScripts(); > >diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp >index 71a07612e7581acfc5c46324b03c6fd39233a567..db0e988209a2594408ba9221a4ef467c5f8d7868 100644 >--- a/Source/WebCore/inspector/InspectorController.cpp >+++ b/Source/WebCore/inspector/InspectorController.cpp >@@ -109,10 +109,6 @@ InspectorController::InspectorController(Page& page, InspectorClient* inspectorC > auto consoleAgent = std::make_unique<PageConsoleAgent>(pageContext); > m_instrumentingAgents->setWebConsoleAgent(consoleAgent.get()); > m_agents.append(WTFMove(consoleAgent)); >- >- ASSERT(m_injectedScriptManager->commandLineAPIHost()); >- if (auto* commandLineAPIHost = m_injectedScriptManager->commandLineAPIHost()) >- commandLineAPIHost->init(m_instrumentingAgents.copyRef()); > } > > InspectorController::~InspectorController() >@@ -150,6 +146,8 @@ void InspectorController::createLazyAgents() > > m_didCreateLazyAgents = true; > >+ m_injectedScriptManager->connect(); >+ > auto pageContext = pageAgentContext(); > > ensureInspectorAgent(); >@@ -186,6 +184,9 @@ void InspectorController::createLazyAgents() > m_agents.append(std::make_unique<PageAuditAgent>(pageContext)); > m_agents.append(std::make_unique<InspectorCanvasAgent>(pageContext)); > m_agents.append(std::make_unique<InspectorTimelineAgent>(pageContext)); >+ >+ if (auto commandLineAPIHost = m_injectedScriptManager->commandLineAPIHost()) >+ commandLineAPIHost->init(m_instrumentingAgents.copyRef()); > } > > void InspectorController::inspectedPageDestroyed() >diff --git a/Source/WebCore/inspector/WebInjectedScriptManager.cpp b/Source/WebCore/inspector/WebInjectedScriptManager.cpp >index 67cc1e91b9ce1395331a4bd8a43c3f2b397ca48d..ad758f94cc64feeb9e14a1e0dd92cbd61306331e 100644 >--- a/Source/WebCore/inspector/WebInjectedScriptManager.cpp >+++ b/Source/WebCore/inspector/WebInjectedScriptManager.cpp >@@ -36,10 +36,16 @@ using namespace Inspector; > > WebInjectedScriptManager::WebInjectedScriptManager(InspectorEnvironment& environment, Ref<InjectedScriptHost>&& host) > : InjectedScriptManager(environment, WTFMove(host)) >- , m_commandLineAPIHost(CommandLineAPIHost::create()) > { > } > >+void WebInjectedScriptManager::connect() >+{ >+ InjectedScriptManager::connect(); >+ >+ m_commandLineAPIHost = CommandLineAPIHost::create(); >+} >+ > void WebInjectedScriptManager::disconnect() > { > InjectedScriptManager::disconnect(); >@@ -52,7 +58,8 @@ void WebInjectedScriptManager::discardInjectedScripts() > { > InjectedScriptManager::discardInjectedScripts(); > >- m_commandLineAPIHost->clearAllWrappers(); >+ if (m_commandLineAPIHost) >+ m_commandLineAPIHost->clearAllWrappers(); > } > > void WebInjectedScriptManager::didCreateInjectedScript(const Inspector::InjectedScript& injectedScript) >diff --git a/Source/WebCore/inspector/WebInjectedScriptManager.h b/Source/WebCore/inspector/WebInjectedScriptManager.h >index d6ba9d7630a5fe871a02bb74678157b4e426b2ab..0521807f8ce3040a736ad692c10ab73b6abecb00 100644 >--- a/Source/WebCore/inspector/WebInjectedScriptManager.h >+++ b/Source/WebCore/inspector/WebInjectedScriptManager.h >@@ -40,8 +40,9 @@ public: > WebInjectedScriptManager(Inspector::InspectorEnvironment&, Ref<Inspector::InjectedScriptHost>&&); > virtual ~WebInjectedScriptManager() = default; > >- CommandLineAPIHost* commandLineAPIHost() const { return m_commandLineAPIHost.get(); } >+ RefPtr<CommandLineAPIHost> commandLineAPIHost() const { return m_commandLineAPIHost; } > >+ void connect() override; > void disconnect() override; > void discardInjectedScripts() override; > >diff --git a/Source/WebCore/inspector/WorkerInspectorController.cpp b/Source/WebCore/inspector/WorkerInspectorController.cpp >index de89ee2ab65d8200efa422987f91d8bddb55424e..6707630fad808f92937af4e581c6dc923188b8d7 100644 >--- a/Source/WebCore/inspector/WorkerInspectorController.cpp >+++ b/Source/WebCore/inspector/WorkerInspectorController.cpp >@@ -72,9 +72,6 @@ WorkerInspectorController::WorkerInspectorController(WorkerGlobalScope& workerGl > auto consoleAgent = std::make_unique<WorkerConsoleAgent>(workerContext); > m_instrumentingAgents->setWebConsoleAgent(consoleAgent.get()); > m_agents.append(WTFMove(consoleAgent)); >- >- if (auto* commandLineAPIHost = m_injectedScriptManager->commandLineAPIHost()) >- commandLineAPIHost->init(m_instrumentingAgents.copyRef()); > } > > WorkerInspectorController::~WorkerInspectorController() >@@ -163,6 +160,8 @@ void WorkerInspectorController::createLazyAgents() > > m_didCreateLazyAgents = true; > >+ m_injectedScriptManager->connect(); >+ > auto workerContext = workerAgentContext(); > > m_agents.append(std::make_unique<WorkerRuntimeAgent>(workerContext)); >@@ -177,6 +176,9 @@ void WorkerInspectorController::createLazyAgents() > m_agents.append(std::make_unique<WebHeapAgent>(workerContext)); > m_agents.append(std::make_unique<WorkerDebuggerAgent>(workerContext)); > m_agents.append(std::make_unique<WorkerAuditAgent>(workerContext)); >+ >+ if (auto commandLineAPIHost = m_injectedScriptManager->commandLineAPIHost()) >+ commandLineAPIHost->init(m_instrumentingAgents.copyRef()); > } > > InspectorFunctionCallHandler WorkerInspectorController::functionCallHandler() const >diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp >index f345f15b7ae5bf6cc45823add29e4b67e4ac6700..0f193cc0fb9b9b86a1591c9a066b3f4201519a30 100644 >--- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp >@@ -1407,7 +1407,7 @@ void InspectorDOMAgent::setInspectedNode(ErrorString& errorString, int nodeId) > > m_inspectedNode = node; > >- if (CommandLineAPIHost* commandLineAPIHost = static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).commandLineAPIHost()) >+ if (auto commandLineAPIHost = static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).commandLineAPIHost()) > commandLineAPIHost->addInspectedObject(std::make_unique<InspectableNode>(node)); > > m_suppressEventListenerChangedEvent = false;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 196047
:
369100
|
369102
|
369104
|
369105
|
369107
|
369109
|
369759
|
369767
|
369768
|
369771
|
369805
|
369806
|
369807
|
369808
|
369809
|
369818
|
369937
|
369945