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

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

Issue 2171973006: [worklets] Change WorkerInspectorController to accept a WorkerThread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@script-env
Patch Set: . 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 67c7785bf30f2c924fdb5c1cb9ae8f4627cd674f..94e1baa13eefb4d8c1a6ea42447a7875540358f1 100644
--- a/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
+++ b/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
@@ -43,15 +43,15 @@
namespace blink {
-WorkerInspectorController* WorkerInspectorController::create(WorkerGlobalScope* workerGlobalScope)
+WorkerInspectorController* WorkerInspectorController::create(WorkerThread* thread)
{
- WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(workerGlobalScope->thread()->isolate());
- return debugger ? new WorkerInspectorController(workerGlobalScope, debugger) : nullptr;
+ WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(thread->isolate());
+ return debugger ? new WorkerInspectorController(thread, debugger) : nullptr;
}
-WorkerInspectorController::WorkerInspectorController(WorkerGlobalScope* workerGlobalScope, WorkerThreadDebugger* debugger)
+WorkerInspectorController::WorkerInspectorController(WorkerThread* thread, WorkerThreadDebugger* debugger)
: m_debugger(debugger)
- , m_workerGlobalScope(workerGlobalScope)
+ , m_thread(thread)
, m_instrumentingAgents(new InstrumentingAgents())
, m_logAgent(nullptr)
{
@@ -68,7 +68,7 @@ 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_logAgent = new InspectorLogAgent(m_thread->consoleMessageStorage());
dgozman 2016/07/27 01:47:52 Does this work?
ikilpatrick 2016/07/27 17:50:41 Yup, WorkerThread has a consoleMessageStorage meth
m_session->append(m_logAgent.get());
}
@@ -93,17 +93,18 @@ void WorkerInspectorController::dispatchMessageFromFrontend(const String& messag
void WorkerInspectorController::dispose()
{
disconnectFrontend();
+ m_thread = nullptr;
}
void WorkerInspectorController::resumeStartup()
{
- m_workerGlobalScope->thread()->stopRunningDebuggerTasksOnPauseOnWorkerThread();
+ m_thread->stopRunningDebuggerTasksOnPauseOnWorkerThread();
}
void WorkerInspectorController::sendProtocolMessage(int sessionId, int callId, const String& response, const String& state)
{
// Worker messages are wrapped, no need to handle callId or state.
- m_workerGlobalScope->thread()->workerReportingProxy().postMessageToPageInspector(response);
+ m_thread->workerReportingProxy().postMessageToPageInspector(response);
}
void WorkerInspectorController::consoleCleared()
@@ -114,7 +115,6 @@ void WorkerInspectorController::consoleCleared()
DEFINE_TRACE(WorkerInspectorController)
{
- visitor->trace(m_workerGlobalScope);
visitor->trace(m_instrumentingAgents);
visitor->trace(m_session);
visitor->trace(m_logAgent);

Powered by Google App Engine
This is Rietveld 408576698