Files
sousa-gecko/dom/workers/remoteworkers/RemoteWorkerOp.cpp
T
Eden Chuang 0b81d49e47 Bug 1672493 - P3 Move RemoteWorker::Op and SharedWorkerOp out from RemoteWorkerChild. r=asuth
To reuse the code of RemoteWorker::State and RemoteWorker::Op in RemoteWorkerNonLifeCycleOpControllerChild, this patch isolates these reused codes into a new file RemoteWorkerOp.h. And also extract RemoteWorker::SharedWorkerOp into SharedWorkerOp.h.cpp

Depends on D197563

Differential Revision: https://phabricator.services.mozilla.com/D198005
2024-11-14 09:46:17 +00:00

24 lines
900 B
C++

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "RemoteWorkerOp.h"
namespace mozilla::dom::remoteworker {
WorkerPrivateAccessibleState::~WorkerPrivateAccessibleState() {
// We should now only be performing state transitions on the main thread, so
// we should assert we're only releasing on the main thread.
MOZ_ASSERT(!mWorkerPrivate || NS_IsMainThread());
// mWorkerPrivate can be safely released on the main thread.
if (!mWorkerPrivate || NS_IsMainThread()) {
return;
}
// But as a backstop, do proxy the release to the main thread.
NS_ReleaseOnMainThread(
"RemoteWorkerChild::WorkerPrivateAccessibleState::mWorkerPrivate",
mWorkerPrivate.forget());
}
} // namespace mozilla::dom::remoteworker