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

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

Issue 1838523004: Initialize debugger together with isolate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed unnecessary assert hitting in unit tests Created 4 years, 9 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/WorkerThreadDebugger.cpp
diff --git a/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
index d436ceaadbb2234c307152e1e93476353ab05822..416180b1d129576574614152d78fd98c31c8628b 100644
--- a/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
@@ -39,6 +39,15 @@ namespace blink {
static const int workerContextGroupId = 1;
+WorkerThreadDebugger* WorkerThreadDebugger::from(v8::Isolate* isolate)
+{
+ V8PerIsolateData* data = V8PerIsolateData::from(isolate);
+ if (!data->threadDebugger())
+ return nullptr;
+ ASSERT(data->threadDebugger()->isWorker());
+ return static_cast<WorkerThreadDebugger*>(data->threadDebugger());
+}
+
WorkerThreadDebugger::WorkerThreadDebugger(WorkerThread* workerThread, v8::Isolate* isolate)
: ThreadDebugger(isolate)
, m_workerThread(workerThread)
@@ -49,9 +58,14 @@ WorkerThreadDebugger::~WorkerThreadDebugger()
{
}
-void WorkerThreadDebugger::setContextDebugData(v8::Local<v8::Context> context)
+void WorkerThreadDebugger::contextCreated(v8::Local<v8::Context> context)
+{
+ debugger()->contextCreated(V8ContextInfo(context, workerContextGroupId, true, m_workerThread->workerGlobalScope()->url().getString(), "", ""));
+}
+
+void WorkerThreadDebugger::contextWillBeDestroyed(v8::Local<v8::Context> context)
{
- V8Debugger::setContextDebugData(context, "worker", workerContextGroupId);
+ debugger()->contextDestroyed(context);
}
int WorkerThreadDebugger::contextGroupId()
@@ -79,7 +93,7 @@ void WorkerThreadDebugger::contextsToReport(int contextGroupId, V8ContextInfoVec
{
ASSERT(contextGroupId == workerContextGroupId);
ScriptState* scriptState = m_workerThread->workerGlobalScope()->scriptController()->getScriptState();
- contexts.append(V8ContextInfo(scriptState->context(), true, m_workerThread->workerGlobalScope()->url().getString(), "", ""));
+ contexts.append(V8ContextInfo(scriptState->context(), workerContextGroupId, true, m_workerThread->workerGlobalScope()->url().getString(), "", ""));
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698