Backed out changeset 9d8b4c0b99ed (bug 1945683) for causing btime failures. CLOSED...
[gecko.git] / dom / workers / remoteworkers / RemoteWorkerOp.cpp
blob313a9a587e04c57b022dda482adfe72d939ed4b7
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "RemoteWorkerOp.h"
7 namespace mozilla::dom::remoteworker {
9 WorkerPrivateAccessibleState::~WorkerPrivateAccessibleState() {
10 // We should now only be performing state transitions on the main thread, so
11 // we should assert we're only releasing on the main thread.
12 MOZ_ASSERT(!mWorkerPrivate || NS_IsMainThread());
13 // mWorkerPrivate can be safely released on the main thread.
14 if (!mWorkerPrivate || NS_IsMainThread()) {
15 return;
17 // But as a backstop, do proxy the release to the main thread.
18 NS_ReleaseOnMainThread(
19 "RemoteWorkerChild::WorkerPrivateAccessibleState::mWorkerPrivate",
20 mWorkerPrivate.forget());
23 } // namespace mozilla::dom::remoteworker