зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1524619 - Part 5 - Propagate user interaction through APIs that return ServiceWorkerRegistrations. r=Ehsan
This is done to support requiring user interaction when calling PushManager.subscribe(). Because PushManager must usually be accessed with async APIs, this makes for a better developer experience and should reduce breakage. Differential Revision: https://phabricator.services.mozilla.com/D23970 --HG-- extra : rebase_source : 047b28e99d80e1adfe14aaea99bc56800dc4281b
This commit is contained in:
Родитель
912602e7fc
Коммит
6e3969226a
|
@ -368,7 +368,8 @@ already_AddRefed<Promise> ServiceWorkerContainer::Register(
|
|||
|
||||
window->NoteCalledRegisterForServiceWorkerScope(cleanedScopeURL);
|
||||
|
||||
RefPtr<Promise> outer = Promise::Create(global, aRv);
|
||||
RefPtr<Promise> outer =
|
||||
Promise::Create(global, aRv, Promise::ePropagateUserInteraction);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -417,7 +418,8 @@ already_AddRefed<Promise> ServiceWorkerContainer::GetRegistrations(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<Promise> outer = Promise::Create(global, aRv);
|
||||
RefPtr<Promise> outer =
|
||||
Promise::Create(global, aRv, Promise::ePropagateUserInteraction);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -492,7 +494,8 @@ already_AddRefed<Promise> ServiceWorkerContainer::GetRegistration(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<Promise> outer = Promise::Create(global, aRv);
|
||||
RefPtr<Promise> outer =
|
||||
Promise::Create(global, aRv, Promise::ePropagateUserInteraction);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -543,7 +546,8 @@ Promise* ServiceWorkerContainer::GetReady(ErrorResult& aRv) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
mReadyPromise = Promise::Create(global, aRv);
|
||||
mReadyPromise =
|
||||
Promise::Create(global, aRv, Promise::ePropagateUserInteraction);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче