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

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

Issue 2201623002: [DevTools] Move WorkerInspectorController to WorkerThread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@can-execute-scripts
Patch Set: rebased Created 4 years, 4 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 8f007207f6bfe3ea958edd8e995e24868e3fd652..0ad83652f1d2b9061dc53c9c6105d92b83156cbe 100644
--- a/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
+++ b/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
@@ -34,8 +34,10 @@
#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/InspectorLogAgent.h"
#include "core/inspector/WorkerThreadDebugger.h"
+#include "core/workers/WorkerBackingThread.h"
#include "core/workers/WorkerReportingProxy.h"
#include "core/workers/WorkerThread.h"
+#include "platform/WebThreadSupportingGC.h"
#include "platform/inspector_protocol/DispatcherBase.h"
#include "platform/v8_inspector/public/V8Inspector.h"
#include "platform/v8_inspector/public/V8InspectorSession.h"
@@ -66,8 +68,9 @@ void WorkerInspectorController::connectFrontend()
return;
// sessionId will be overwritten by WebDevToolsAgent::sendProtocolNotification call.
- m_session = new InspectorSession(this, m_instrumentingAgents.get(), 0, true /* autoFlush */, m_debugger->v8Inspector(), m_debugger->contextGroupId(), nullptr);
+ m_session = new InspectorSession(this, m_instrumentingAgents.get(), 0, m_debugger->v8Inspector(), m_debugger->contextGroupId(), nullptr);
m_session->append(new InspectorLogAgent(m_thread->consoleMessageStorage()));
+ m_thread->workerBackingThread().backingThread().addTaskObserver(this);
}
void WorkerInspectorController::disconnectFrontend()
@@ -76,6 +79,7 @@ void WorkerInspectorController::disconnectFrontend()
return;
m_session->dispose();
m_session.clear();
+ m_thread->workerBackingThread().backingThread().removeTaskObserver(this);
}
void WorkerInspectorController::dispatchMessageFromFrontend(const String& message)
@@ -94,6 +98,12 @@ void WorkerInspectorController::dispose()
m_thread = nullptr;
}
+void WorkerInspectorController::flushProtocolNotifications()
+{
+ if (m_session)
+ m_session->flushProtocolNotifications();
+}
+
void WorkerInspectorController::resumeStartup()
{
m_thread->stopRunningDebuggerTasksOnPauseOnWorkerThread();
@@ -105,6 +115,16 @@ void WorkerInspectorController::sendProtocolMessage(int sessionId, int callId, c
m_thread->workerReportingProxy().postMessageToPageInspector(response);
}
+void WorkerInspectorController::willProcessTask()
+{
+}
+
+void WorkerInspectorController::didProcessTask()
+{
+ if (m_session)
+ m_session->flushProtocolNotifications();
+}
+
DEFINE_TRACE(WorkerInspectorController)
{
visitor->trace(m_instrumentingAgents);

Powered by Google App Engine
This is Rietveld 408576698