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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerThread.cpp

Issue 2485633004: Revert of DevTools: Make WorkerThreadDebugger available for Worklets (Closed)
Patch Set: Created 4 years, 1 month 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/workers/WorkerThread.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
index 4d516a1ed5c4c174476d5fe0641865425f7ffc5d..3a7332a8a4e21786ab42e66192e3a5c695a291c1 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -35,7 +35,6 @@
#include "core/inspector/WorkerInspectorController.h"
#include "core/inspector/WorkerThreadDebugger.h"
#include "core/origin_trials/OriginTrialContext.h"
-#include "core/workers/ThreadedWorkletGlobalScope.h"
#include "core/workers/WorkerBackingThread.h"
#include "core/workers/WorkerClients.h"
#include "core/workers/WorkerGlobalScope.h"
@@ -122,13 +121,6 @@
return threads;
}
-static int getNextWorkerThreadId() {
- DCHECK(isMainThread());
- static int nextWorkerThreadId = 1;
- CHECK_LT(nextWorkerThreadId, std::numeric_limits<int>::max());
- return nextWorkerThreadId++;
-}
-
WorkerThreadLifecycleContext::WorkerThreadLifecycleContext() {
DCHECK(isMainThread());
}
@@ -342,8 +334,7 @@
WorkerThread::WorkerThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy,
WorkerReportingProxy& workerReportingProxy)
- : m_workerThreadId(getNextWorkerThreadId()),
- m_forceTerminationDelayInMs(kForceTerminationDelayInMs),
+ : m_forceTerminationDelayInMs(kForceTerminationDelayInMs),
m_inspectorTaskRunner(wrapUnique(new InspectorTaskRunner())),
m_workerLoaderProxy(workerLoaderProxy),
m_workerReportingProxy(workerReportingProxy),
@@ -483,6 +474,10 @@
if (isOwningBackingThread())
workerBackingThread().initialize();
+
+ if (shouldAttachThreadDebugger())
+ V8PerIsolateData::from(isolate())->setThreadDebugger(
+ wrapUnique(new WorkerThreadDebugger(this, isolate())));
workerBackingThread().backingThread().addTaskObserver(this);
// Optimize for memory usage instead of latency for the worker isolate.
@@ -546,11 +541,11 @@
InspectorInstrumentation::allAsyncTasksCanceled(globalScope());
globalScope()->notifyContextDestroyed();
+ globalScope()->dispose();
if (m_workerInspectorController) {
m_workerInspectorController->dispose();
m_workerInspectorController.clear();
}
- globalScope()->dispose();
m_consoleMessageStorage.clear();
workerBackingThread().backingThread().removeTaskObserver(this);
}

Powered by Google App Engine
This is Rietveld 408576698