| Index: Source/modules/serviceworkers/WaitUntilObserver.cpp
|
| diff --git a/Source/modules/serviceworkers/WaitUntilObserver.cpp b/Source/modules/serviceworkers/WaitUntilObserver.cpp
|
| index 28359e332684f192ecfa75cd111a5db9cf2b7cb6..d03bf9e79f1622e55a09b74f975d34460a5ceeea 100644
|
| --- a/Source/modules/serviceworkers/WaitUntilObserver.cpp
|
| +++ b/Source/modules/serviceworkers/WaitUntilObserver.cpp
|
| @@ -88,6 +88,16 @@ void WaitUntilObserver::waitUntil(ScriptState* scriptState, const ScriptValue& v
|
| return;
|
| }
|
|
|
| + if (!executionContext())
|
| + return;
|
| +
|
| + // When handling a notificationclick event, we want to allow one window to
|
| + // be focused. Regardless of whether one window was focused,
|
| + // |consumeWindowFocus| will be called when all the pending activities will
|
| + // be resolved.
|
| + if (m_type == NotificationClick)
|
| + executionContext()->allowWindowFocus();
|
| +
|
| incrementPendingActivity();
|
| ScriptPromise::cast(scriptState, value).then(
|
| ThenFunction::createFunction(scriptState, this, ThenFunction::Fulfilled),
|
| @@ -134,6 +144,7 @@ void WaitUntilObserver::decrementPendingActivity()
|
| break;
|
| case NotificationClick:
|
| client->didHandleNotificationClickEvent(m_eventID, result);
|
| + executionContext()->consumeWindowFocus();
|
| break;
|
| case Push:
|
| client->didHandlePushEvent(m_eventID, result);
|
|
|