зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1748981 - hal::LockScreenOrientation in content process never returns rejected promise even if platform's implementation returns rejected promise. r=calu
IPC's promise returns resolved promise when IPC connection is successful. So even if platform implementations such as android returns rejected promise, it is converted to resolved promise by SandboxHal.cpp unfortunately. So we should check return value when RecvLockScreenOrientation returns false. Differential Revision: https://phabricator.services.mozilla.com/D135330
This commit is contained in:
Родитель
cd2693c5cf
Коммит
bf31f73133
|
@ -90,7 +90,7 @@ RefPtr<mozilla::MozPromise<bool, bool, false>> LockScreenOrientation(
|
||||||
GetCurrentSerialEventTarget(), __func__,
|
GetCurrentSerialEventTarget(), __func__,
|
||||||
[=](const mozilla::MozPromise<bool, ipc::ResponseRejectReason,
|
[=](const mozilla::MozPromise<bool, ipc::ResponseRejectReason,
|
||||||
true>::ResolveOrRejectValue& aValue) {
|
true>::ResolveOrRejectValue& aValue) {
|
||||||
if (aValue.IsResolve()) {
|
if (aValue.IsResolve() && aValue.ResolveValue()) {
|
||||||
return mozilla::MozPromise<bool, bool, false>::CreateAndResolve(
|
return mozilla::MozPromise<bool, bool, false>::CreateAndResolve(
|
||||||
true, __func__);
|
true, __func__);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче