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

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

Issue 2151273003: [DevTools] Move browser logging from Console domain to Log domain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@internals-method
Patch Set: protocol improvements Created 4 years, 5 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/WorkerInspectorController.cpp
diff --git a/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp b/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
index fcd952fa04a59999a4ffc838063886b1bde28349..67c7785bf30f2c924fdb5c1cb9ae8f4627cd674f 100644
--- a/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
+++ b/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
@@ -32,6 +32,7 @@
#include "core/InstrumentingAgents.h"
#include "core/inspector/InspectorInstrumentation.h"
+#include "core/inspector/InspectorLogAgent.h"
#include "core/inspector/WorkerThreadDebugger.h"
#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerReportingProxy.h"
@@ -52,6 +53,7 @@ WorkerInspectorController::WorkerInspectorController(WorkerGlobalScope* workerGl
: m_debugger(debugger)
, m_workerGlobalScope(workerGlobalScope)
, m_instrumentingAgents(new InstrumentingAgents())
+ , m_logAgent(nullptr)
{
}
@@ -66,6 +68,8 @@ void WorkerInspectorController::connectFrontend()
// sessionId will be overwritten by WebDevToolsAgent::sendProtocolNotification call.
m_session = new InspectorSession(this, nullptr, m_instrumentingAgents.get(), 0, true /* autoFlush */, m_debugger->debugger(), m_debugger->contextGroupId(), nullptr);
+ m_logAgent = new InspectorLogAgent(m_workerGlobalScope->consoleMessageStorage());
+ m_session->append(m_logAgent.get());
}
void WorkerInspectorController::disconnectFrontend()
@@ -102,11 +106,18 @@ void WorkerInspectorController::sendProtocolMessage(int sessionId, int callId, c
m_workerGlobalScope->thread()->workerReportingProxy().postMessageToPageInspector(response);
}
+void WorkerInspectorController::consoleCleared()
+{
+ if (m_logAgent)
+ m_logAgent->clear(nullptr);
+}
+
DEFINE_TRACE(WorkerInspectorController)
{
visitor->trace(m_workerGlobalScope);
visitor->trace(m_instrumentingAgents);
visitor->trace(m_session);
+ visitor->trace(m_logAgent);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698