Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Unified Diff: third_party/WebKit/Source/core/inspector/PageConsoleAgent.cpp

Issue 1777323005: Revert of [DevTools] Remove extra plumbing from InspectorWorkerAgent, prepare to multi-client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/PageConsoleAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/PageConsoleAgent.cpp b/third_party/WebKit/Source/core/inspector/PageConsoleAgent.cpp
index 8404ded5bd599f729243ca9762ca71b2398784bd..48c5eb77f0789b78dab4e576299310a589047345 100644
--- a/third_party/WebKit/Source/core/inspector/PageConsoleAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/PageConsoleAgent.cpp
@@ -64,9 +64,6 @@
{
visitor->trace(m_inspectorDOMAgent);
visitor->trace(m_inspectedFrames);
-#if ENABLE(OILPAN)
- visitor->trace(m_workersWithEnabledConsole);
-#endif
InspectorConsoleAgent::trace(visitor);
}
@@ -89,9 +86,9 @@
messageStorage()->clear(m_inspectedFrames->root()->document());
}
-void PageConsoleAgent::workerConsoleAgentEnabled(WorkerInspectorProxy* workerInspectorProxy)
+void PageConsoleAgent::workerConsoleAgentEnabled(WorkerGlobalScopeProxy* proxy)
{
- m_workersWithEnabledConsole.add(workerInspectorProxy);
+ m_workersWithEnabledConsole.add(proxy);
}
ConsoleMessageStorage* PageConsoleAgent::messageStorage()
@@ -101,15 +98,21 @@
void PageConsoleAgent::workerTerminated(WorkerInspectorProxy* workerInspectorProxy)
{
- if (m_workersWithEnabledConsole.find(workerInspectorProxy) != m_workersWithEnabledConsole.end())
+ WorkerGlobalScopeProxy* proxy = workerInspectorProxy->workerGlobalScopeProxy();
+ if (!proxy)
+ return;
+
+ HashSet<WorkerGlobalScopeProxy*>::iterator iterator = m_workersWithEnabledConsole.find(proxy);
+ bool workerAgentWasEnabled = iterator != m_workersWithEnabledConsole.end();
+ if (workerAgentWasEnabled)
return;
ConsoleMessageStorage* storage = messageStorage();
size_t messageCount = storage->size();
for (size_t i = 0; i < messageCount; ++i) {
ConsoleMessage* message = storage->at(i);
- if (message->workerInspectorProxy() == workerInspectorProxy) {
- message->setWorkerInspectorProxy(nullptr);
+ if (message->workerGlobalScopeProxy() == proxy) {
+ message->setWorkerGlobalScopeProxy(nullptr);
sendConsoleMessageToFrontend(message, false);
}
}

Powered by Google App Engine
This is Rietveld 408576698