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

Unified Diff: Source/core/inspector/WorkerDebuggerAgent.cpp

Issue 1133903005: DevTools: [wip] do not use InspectorInstrumentation for will/didProcessTask events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « Source/core/inspector/WorkerDebuggerAgent.h ('k') | Source/core/inspector/WorkerInspectorController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/WorkerDebuggerAgent.cpp
diff --git a/Source/core/inspector/WorkerDebuggerAgent.cpp b/Source/core/inspector/WorkerDebuggerAgent.cpp
index 7026b98549ca49054ffef4f9069325734571b16b..bc9cfacbb24c8a6085f650b53c415735a59d9d75 100644
--- a/Source/core/inspector/WorkerDebuggerAgent.cpp
+++ b/Source/core/inspector/WorkerDebuggerAgent.cpp
@@ -31,7 +31,7 @@
#include "config.h"
#include "core/inspector/WorkerDebuggerAgent.h"
-#include "bindings/core/v8/ScriptDebugServer.h"
+#include "bindings/core/v8/WorkerScriptDebugServer.h"
#include "core/inspector/InjectedScript.h"
#include "core/inspector/WorkerInspectorController.h"
#include "core/workers/WorkerGlobalScope.h"
@@ -44,33 +44,34 @@ namespace {
class RunInspectorCommandsTask final : public ScriptDebugServer::Task {
public:
- explicit RunInspectorCommandsTask(WorkerThread* thread)
- : m_thread(thread) { }
+ explicit RunInspectorCommandsTask(WorkerThread* thread, WebThread::TaskObserver* taskObserver)
+ : m_thread(thread)
+ , m_taskObserver(taskObserver) { }
virtual ~RunInspectorCommandsTask() { }
virtual void run() override
{
- // Process all queued debugger commands. WorkerThread is certainly
- // alive if this task is being executed.
- m_thread->willEnterNestedLoop();
+ m_taskObserver->willProcessTask();
while (MessageQueueMessageReceived == m_thread->runDebuggerTask(WorkerThread::DontWaitForMessage)) { }
- m_thread->didLeaveNestedLoop();
+ m_taskObserver->didProcessTask();
}
private:
WorkerThread* m_thread;
+ WebThread::TaskObserver* m_taskObserver;
};
} // namespace
-PassOwnPtrWillBeRawPtr<WorkerDebuggerAgent> WorkerDebuggerAgent::create(WorkerScriptDebugServer* scriptDebugServer, WorkerGlobalScope* inspectedWorkerGlobalScope, InjectedScriptManager* injectedScriptManager)
+PassOwnPtrWillBeRawPtr<WorkerDebuggerAgent> WorkerDebuggerAgent::create(WorkerScriptDebugServer* scriptDebugServer, WorkerGlobalScope* inspectedWorkerGlobalScope, InjectedScriptManager* injectedScriptManager, WebThread::TaskObserver* taskObserver)
{
- return adoptPtrWillBeNoop(new WorkerDebuggerAgent(scriptDebugServer, inspectedWorkerGlobalScope, injectedScriptManager));
+ return adoptPtrWillBeNoop(new WorkerDebuggerAgent(scriptDebugServer, inspectedWorkerGlobalScope, injectedScriptManager, taskObserver));
}
-WorkerDebuggerAgent::WorkerDebuggerAgent(WorkerScriptDebugServer* scriptDebugServer, WorkerGlobalScope* inspectedWorkerGlobalScope, InjectedScriptManager* injectedScriptManager)
+WorkerDebuggerAgent::WorkerDebuggerAgent(WorkerScriptDebugServer* scriptDebugServer, WorkerGlobalScope* inspectedWorkerGlobalScope, InjectedScriptManager* injectedScriptManager, WebThread::TaskObserver* taskObserver)
: InspectorDebuggerAgent(injectedScriptManager, scriptDebugServer->scriptDebugServer()->isolate())
, m_scriptDebugServer(scriptDebugServer)
, m_inspectedWorkerGlobalScope(inspectedWorkerGlobalScope)
+ , m_taskObserver(taskObserver)
{
}
@@ -86,7 +87,7 @@ DEFINE_TRACE(WorkerDebuggerAgent)
void WorkerDebuggerAgent::interruptAndDispatchInspectorCommands()
{
- scriptDebugServer().interruptAndRun(adoptPtr(new RunInspectorCommandsTask(m_inspectedWorkerGlobalScope->thread())));
+ scriptDebugServer().interruptAndRun(adoptPtr(new RunInspectorCommandsTask(m_inspectedWorkerGlobalScope->thread(), m_taskObserver)));
}
void WorkerDebuggerAgent::startListeningScriptDebugServer()
« no previous file with comments | « Source/core/inspector/WorkerDebuggerAgent.h ('k') | Source/core/inspector/WorkerInspectorController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698