It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
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 "RemoteWorkerNonLifeCycleOpControllerParent.h"
|
|
|
|
#include "mozilla/dom/RemoteWorkerController.h"
|
|
|
|
namespace mozilla::dom {
|
|
|
|
RemoteWorkerNonLifeCycleOpControllerParent::
|
|
RemoteWorkerNonLifeCycleOpControllerParent(
|
|
RemoteWorkerController* aController)
|
|
: mController(aController) {
|
|
MOZ_ASSERT(mController);
|
|
}
|
|
|
|
RemoteWorkerNonLifeCycleOpControllerParent::
|
|
~RemoteWorkerNonLifeCycleOpControllerParent() = default;
|
|
|
|
void RemoteWorkerNonLifeCycleOpControllerParent::Shutdown() {
|
|
if (CanSend()) {
|
|
(void)SendShutdown();
|
|
}
|
|
if (mController) {
|
|
mController = nullptr;
|
|
}
|
|
if (GetIPCChannel()) {
|
|
GetIPCChannel()->Close();
|
|
}
|
|
}
|
|
|
|
IPCResult RemoteWorkerNonLifeCycleOpControllerParent::RecvTerminated() {
|
|
// mController could be nullptr when the controller had already shutted down.
|
|
if (mController) {
|
|
mController->mNonLifeCycleOpController = nullptr;
|
|
mController = nullptr;
|
|
}
|
|
|
|
if (GetIPCChannel()) {
|
|
GetIPCChannel()->Close();
|
|
}
|
|
|
|
return IPC_OK();
|
|
}
|
|
|
|
IPCResult RemoteWorkerNonLifeCycleOpControllerParent::RecvError(
|
|
const ErrorValue& aError) {
|
|
MOZ_ASSERT(mController);
|
|
mController->ErrorPropagation(aError);
|
|
return IPC_OK();
|
|
}
|
|
|
|
} // namespace mozilla::dom
|