Bug 1435263 - Get rid of WorkerPrivateParent template - part 11 - Debugger, r=bkelly

This commit is contained in:
Andrea Marchesini 2018-02-08 09:33:33 +01:00
Родитель dc6e77233b
Коммит bc2868d467
2 изменённых файлов: 12 добавлений и 18 удалений

Просмотреть файл

@ -1627,29 +1627,23 @@ WorkerPrivate::DispatchPrivate(already_AddRefed<WorkerRunnable> aRunnable,
return NS_OK;
}
template <class Derived>
void
WorkerPrivateParent<Derived>::EnableDebugger()
WorkerPrivate::EnableDebugger()
{
AssertIsOnParentThread();
WorkerPrivate* self = ParentAsWorkerPrivate();
if (NS_FAILED(RegisterWorkerDebugger(self))) {
if (NS_FAILED(RegisterWorkerDebugger(this))) {
NS_WARNING("Failed to register worker debugger!");
return;
}
}
template <class Derived>
void
WorkerPrivateParent<Derived>::DisableDebugger()
WorkerPrivate::DisableDebugger()
{
AssertIsOnParentThread();
WorkerPrivate* self = ParentAsWorkerPrivate();
if (NS_FAILED(UnregisterWorkerDebugger(self))) {
if (NS_FAILED(UnregisterWorkerDebugger(this))) {
NS_WARNING("Failed to unregister worker debugger!");
}
}
@ -1874,7 +1868,7 @@ WorkerPrivateParent<Derived>::Freeze(nsPIDOMWindowInner* aWindow)
}
}
DisableDebugger();
self->DisableDebugger();
RefPtr<FreezeRunnable> runnable =
new FreezeRunnable(ParentAsWorkerPrivate());
@ -1937,7 +1931,7 @@ WorkerPrivateParent<Derived>::Thaw(nsPIDOMWindowInner* aWindow)
}
}
EnableDebugger();
self->EnableDebugger();
// Execute queued runnables before waking up the worker, otherwise the worker
// could post new messages before we run those that have been queued.

Просмотреть файл

@ -155,12 +155,6 @@ private:
public:
NS_INLINE_DECL_REFCOUNTING(WorkerPrivateParent)
void
EnableDebugger();
void
DisableDebugger();
nsresult
Dispatch(already_AddRefed<WorkerRunnable> aRunnable);
@ -1392,6 +1386,12 @@ public:
void
FlushReportsToSharedWorkers(nsIConsoleReportCollector* aReporter);
void
EnableDebugger();
void
DisableDebugger();
private:
WorkerPrivate(WorkerPrivate* aParent,
const nsAString& aScriptURL, bool aIsChromeWorker,