Backed out changeset d4b644dd05b2 (bug 1657130) for causing worker crashes. a=backout

DONTBUILD
This commit is contained in:
Mihai Alexandru Michis 2021-01-21 11:38:45 +02:00
Родитель 404511fd71
Коммит 910e64de92
4 изменённых файлов: 5 добавлений и 38 удалений

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

@ -269,45 +269,19 @@ WorkerDebugger::GetWindow(mozIDOMWindow** aResult) {
return NS_ERROR_UNEXPECTED;
}
nsCOMPtr<nsPIDOMWindowInner> window = DedicatedWorkerWindow();
window.forget(aResult);
return NS_OK;
}
NS_IMETHODIMP
WorkerDebugger::GetWindowIDs(nsTArray<uint64_t>& aResult) {
AssertIsOnMainThread();
if (!mWorkerPrivate) {
return NS_ERROR_UNEXPECTED;
}
if (mWorkerPrivate->IsDedicatedWorker()) {
const auto window = DedicatedWorkerWindow();
aResult.AppendElement(window->WindowID());
} else if (mWorkerPrivate->IsSharedWorker()) {
const RemoteWorkerChild* const controller =
mWorkerPrivate->GetRemoteWorkerController();
MOZ_ASSERT(controller);
aResult = controller->WindowIDs().Clone();
}
return NS_OK;
}
nsCOMPtr<nsPIDOMWindowInner> WorkerDebugger::DedicatedWorkerWindow() {
MOZ_ASSERT(mWorkerPrivate);
WorkerPrivate* worker = mWorkerPrivate;
while (worker->GetParent()) {
worker = worker->GetParent();
}
if (!worker->IsDedicatedWorker()) {
return nullptr;
*aResult = nullptr;
return NS_OK;
}
return worker->GetWindow();
nsCOMPtr<nsPIDOMWindowInner> window = worker->GetWindow();
window.forget(aResult);
return NS_OK;
}
NS_IMETHODIMP

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

@ -13,7 +13,6 @@
class mozIDOMWindow;
class nsIPrincipal;
class nsPIDOMWindowInner;
namespace mozilla {
namespace dom {
@ -57,8 +56,6 @@ class WorkerDebugger : public nsIWorkerDebugger {
void ReportErrorToDebuggerOnMainThread(const nsAString& aFilename,
uint32_t aLineno,
const nsAString& aMessage);
nsCOMPtr<nsPIDOMWindowInner> DedicatedWorkerWindow();
};
} // namespace dom

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

@ -37,8 +37,6 @@ interface nsIWorkerDebugger : nsISupports
// nested workers) its top-level ancestral worker is associated with.
readonly attribute mozIDOMWindow window;
readonly attribute Array<uint64_t> windowIDs;
readonly attribute nsIPrincipal principal;
readonly attribute unsigned long serviceWorkerID;

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

@ -66,8 +66,6 @@ class RemoteWorkerChild final
RefPtr<GenericPromise> MaybeSendSetServiceWorkerSkipWaitingFlag();
const nsTArray<uint64_t>& WindowIDs() const { return mWindowIDs; }
private:
class InitializeWorkerRunnable;