WebKit Bugzilla
Attachment 369805 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.patch (text/plain), 8.08 KB, created by
Devin Rousso
on 2019-05-13 17:53:27 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-05-13 17:53:27 PDT
Size:
8.08 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8848d916c96fc9f5bcef74dd9b26f80cd7b61e43..43503a0d03026de17096ac603fa8b3696c89c82d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,32 @@ >+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: >+ (WebCore::WebInjectedScriptManager::commandLineAPIHost): Deleted. >+ * inspector/WebInjectedScriptManager.cpp: >+ (WebCore::WebInjectedScriptManager::WebInjectedScriptManager): >+ (WebCore::WebInjectedScriptManager::ensureCommandLineAPIHost): Added. >+ (WebCore::WebInjectedScriptManager::discardInjectedScripts): >+ >+ * inspector/inspector/CommandLineAPIModule.cpp: >+ (WebCore::CommandLineAPIModule::host): >+ * inspector/agents/InspectorDOMAgent.cpp: >+ (WebCore::InspectorDOMAgent::setInspectedNode): >+ > 2019-05-13 Antti Koivisto <antti@apple.com> > > REGRESSION (r245208): compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html asserts >diff --git a/Source/WebCore/inspector/CommandLineAPIModule.cpp b/Source/WebCore/inspector/CommandLineAPIModule.cpp >index c8bc6636d21bc6977e814670017a1d61ca8b79a8..2c5d7f0d08814b8c4cfd35cc58bae1a572dbc19b 100644 >--- a/Source/WebCore/inspector/CommandLineAPIModule.cpp >+++ b/Source/WebCore/inspector/CommandLineAPIModule.cpp >@@ -57,10 +57,9 @@ JSValue CommandLineAPIModule::host(InjectedScriptManager* injectedScriptManager, > { > // CommandLineAPIModule should only ever be used by a WebInjectedScriptManager. > WebInjectedScriptManager* pageInjectedScriptManager = static_cast<WebInjectedScriptManager*>(injectedScriptManager); >- ASSERT(pageInjectedScriptManager->commandLineAPIHost()); > > JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()); >- return pageInjectedScriptManager->commandLineAPIHost()->wrapper(exec, globalObject); >+ return pageInjectedScriptManager->ensureCommandLineAPIHost().wrapper(exec, globalObject); > } > > } // namespace WebCore >diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp >index 71a07612e7581acfc5c46324b03c6fd39233a567..d25ed71b883d5310dc1e395d77c7692eb039c650 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() >@@ -186,6 +182,8 @@ 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)); >+ >+ m_injectedScriptManager->ensureCommandLineAPIHost().init(m_instrumentingAgents.copyRef()); > } > > void InspectorController::inspectedPageDestroyed() >diff --git a/Source/WebCore/inspector/WebInjectedScriptManager.cpp b/Source/WebCore/inspector/WebInjectedScriptManager.cpp >index 67cc1e91b9ce1395331a4bd8a43c3f2b397ca48d..a768fb391191e2e9c9ae3829dfeff25ba4fc0c35 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()) > { > } > >+CommandLineAPIHost& WebInjectedScriptManager::ensureCommandLineAPIHost() >+{ >+ if (!m_commandLineAPIHost) >+ m_commandLineAPIHost = CommandLineAPIHost::create(); >+ return *m_commandLineAPIHost; >+} >+ > 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..c1424e4c33b8322a5e17c59760b6a01cd5c7179c 100644 >--- a/Source/WebCore/inspector/WebInjectedScriptManager.h >+++ b/Source/WebCore/inspector/WebInjectedScriptManager.h >@@ -40,7 +40,7 @@ public: > WebInjectedScriptManager(Inspector::InspectorEnvironment&, Ref<Inspector::InjectedScriptHost>&&); > virtual ~WebInjectedScriptManager() = default; > >- CommandLineAPIHost* commandLineAPIHost() const { return m_commandLineAPIHost.get(); } >+ CommandLineAPIHost& ensureCommandLineAPIHost(); > > void disconnect() override; > void discardInjectedScripts() override; >diff --git a/Source/WebCore/inspector/WorkerInspectorController.cpp b/Source/WebCore/inspector/WorkerInspectorController.cpp >index de89ee2ab65d8200efa422987f91d8bddb55424e..4494647bf2ca6e04199a74542d703768ac5928c8 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() >@@ -177,6 +174,8 @@ 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)); >+ >+ m_injectedScriptManager->ensureCommandLineAPIHost().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..de6335d27f3cf5446b21307f81772564aaea4317 100644 >--- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp >@@ -1407,8 +1407,7 @@ void InspectorDOMAgent::setInspectedNode(ErrorString& errorString, int nodeId) > > m_inspectedNode = node; > >- if (CommandLineAPIHost* commandLineAPIHost = static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).commandLineAPIHost()) >- commandLineAPIHost->addInspectedObject(std::make_unique<InspectableNode>(node)); >+ static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).ensureCommandLineAPIHost().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