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

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

Issue 1728803002: Rename WorkerThread to WorkerScript Base URL: https://chromium.googlesource.com/chromium/src.git@workerscript-controller
Patch Set: Created 4 years, 10 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/workers/WorkerInspectorProxy.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerInspectorProxy.cpp b/third_party/WebKit/Source/core/workers/WorkerInspectorProxy.cpp
index 204b90e92cca523e18cac520e64ca2e373cf11ef..4c2501ec0a45931aaf7cb6f554280dc92dad3294 100644
--- a/third_party/WebKit/Source/core/workers/WorkerInspectorProxy.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerInspectorProxy.cpp
@@ -8,7 +8,7 @@
#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/InspectorTraceEvents.h"
#include "core/inspector/WorkerInspectorController.h"
-#include "core/workers/WorkerThread.h"
+#include "core/workers/WorkerScript.h"
#include "platform/Task.h"
#include "platform/TraceEvent.h"
#include "platform/weborigin/KURL.h"
@@ -17,7 +17,7 @@
namespace blink {
WorkerInspectorProxy::WorkerInspectorProxy()
- : m_workerThread(nullptr)
+ : m_workerScript(nullptr)
, m_executionContext(nullptr)
, m_pageInspector(nullptr)
, m_workerGlobalScopeProxy(nullptr)
@@ -33,77 +33,77 @@ WorkerInspectorProxy::~WorkerInspectorProxy()
{
}
-void WorkerInspectorProxy::workerThreadCreated(ExecutionContext* context, WorkerThread* workerThread, const KURL& url)
+void WorkerInspectorProxy::workerScriptCreated(ExecutionContext* context, WorkerScript* workerScript, const KURL& url)
{
- m_workerThread = workerThread;
+ m_workerScript = workerScript;
m_executionContext = context;
InspectorInstrumentation::didStartWorker(context, this, url);
}
-void WorkerInspectorProxy::workerThreadTerminated()
+void WorkerInspectorProxy::workerScriptTerminated()
{
- if (m_workerThread)
+ if (m_workerScript)
InspectorInstrumentation::workerTerminated(m_executionContext, this);
- m_workerThread = nullptr;
+ m_workerScript = nullptr;
m_pageInspector = nullptr;
}
-static void connectToWorkerGlobalScopeInspectorTask(WorkerThread* workerThread)
+static void connectToWorkerGlobalScopeInspectorTask(WorkerScript* workerScript)
{
- workerThread->workerGlobalScope()->workerInspectorController()->connectFrontend();
+ workerScript->workerGlobalScope()->workerInspectorController()->connectFrontend();
}
void WorkerInspectorProxy::connectToInspector(WorkerInspectorProxy::PageInspector* pageInspector)
{
- if (!m_workerThread)
+ if (!m_workerScript)
return;
ASSERT(!m_pageInspector);
m_pageInspector = pageInspector;
- addDebuggerTaskForWorker(BLINK_FROM_HERE, adoptPtr(new Task(threadSafeBind(connectToWorkerGlobalScopeInspectorTask, AllowCrossThreadAccess(m_workerThread)))));
+ addDebuggerTaskForWorker(BLINK_FROM_HERE, adoptPtr(new Task(threadSafeBind(connectToWorkerGlobalScopeInspectorTask, AllowCrossThreadAccess(m_workerScript)))));
}
-static void disconnectFromWorkerGlobalScopeInspectorTask(WorkerThread* workerThread)
+static void disconnectFromWorkerGlobalScopeInspectorTask(WorkerScript* workerScript)
{
- workerThread->workerGlobalScope()->workerInspectorController()->disconnectFrontend();
+ workerScript->workerGlobalScope()->workerInspectorController()->disconnectFrontend();
}
void WorkerInspectorProxy::disconnectFromInspector()
{
m_pageInspector = nullptr;
- if (!m_workerThread)
+ if (!m_workerScript)
return;
- addDebuggerTaskForWorker(BLINK_FROM_HERE, adoptPtr(new Task(threadSafeBind(disconnectFromWorkerGlobalScopeInspectorTask, AllowCrossThreadAccess(m_workerThread)))));
+ addDebuggerTaskForWorker(BLINK_FROM_HERE, adoptPtr(new Task(threadSafeBind(disconnectFromWorkerGlobalScopeInspectorTask, AllowCrossThreadAccess(m_workerScript)))));
}
-static void dispatchOnInspectorBackendTask(const String& message, WorkerThread* workerThread)
+static void dispatchOnInspectorBackendTask(const String& message, WorkerScript* workerScript)
{
- workerThread->workerGlobalScope()->workerInspectorController()->dispatchMessageFromFrontend(message);
+ workerScript->workerGlobalScope()->workerInspectorController()->dispatchMessageFromFrontend(message);
}
void WorkerInspectorProxy::sendMessageToInspector(const String& message)
{
- if (!m_workerThread)
+ if (!m_workerScript)
return;
- addDebuggerTaskForWorker(BLINK_FROM_HERE, adoptPtr(new Task(threadSafeBind(dispatchOnInspectorBackendTask, message, AllowCrossThreadAccess(m_workerThread)))));
- m_workerThread->interruptAndDispatchInspectorCommands();
+ addDebuggerTaskForWorker(BLINK_FROM_HERE, adoptPtr(new Task(threadSafeBind(dispatchOnInspectorBackendTask, message, AllowCrossThreadAccess(m_workerScript)))));
+ m_workerScript->interruptAndDispatchInspectorCommands();
}
void WorkerInspectorProxy::writeTimelineStartedEvent(const String& sessionId, const String& workerId)
{
- if (!m_workerThread)
+ if (!m_workerScript)
return;
- TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "TracingSessionIdForWorker", TRACE_EVENT_SCOPE_THREAD, "data", InspectorTracingSessionIdForWorkerEvent::data(sessionId, workerId, m_workerThread));
+ TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "TracingSessionIdForWorker", TRACE_EVENT_SCOPE_THREAD, "data", InspectorTracingSessionIdForWorkerEvent::data(sessionId, workerId, m_workerScript));
}
-static void runDebuggerTaskForWorker(WorkerThread* workerThread)
+static void runDebuggerTaskForWorker(WorkerScript* workerScript)
{
- workerThread->runDebuggerTask(WorkerThread::DontWaitForTask);
+ workerScript->runDebuggerTask(WorkerScript::DontWaitForTask);
}
void WorkerInspectorProxy::addDebuggerTaskForWorker(const WebTraceLocation& location, PassOwnPtr<WebTaskRunner::Task> task)
{
- m_workerThread->appendDebuggerTask(task);
- m_workerThread->backingThread().postTask(location, new Task(threadSafeBind(&runDebuggerTaskForWorker, AllowCrossThreadAccess(m_workerThread))));
+ m_workerScript->appendDebuggerTask(task);
+ m_workerScript->backingThread().postTask(location, new Task(threadSafeBind(&runDebuggerTaskForWorker, AllowCrossThreadAccess(m_workerScript))));
}
DEFINE_TRACE(WorkerInspectorProxy)

Powered by Google App Engine
This is Rietveld 408576698