Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1299)

Unified Diff: Source/modules/serviceworkers/WaitUntilObserver.cpp

Issue 210833004: Inform the client when the Service Worker rejects an install event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: use m_hasError in WaitUntilObserver Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/serviceworkers/WaitUntilObserver.h ('k') | Source/web/ServiceWorkerGlobalScopeClientImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/WaitUntilObserver.cpp
diff --git a/Source/modules/serviceworkers/WaitUntilObserver.cpp b/Source/modules/serviceworkers/WaitUntilObserver.cpp
index f239f541f70185976a3e31dc9aab55232ea62e79..c5a4d4e1c14edc6df99dc01057de445bd133f8c1 100644
--- a/Source/modules/serviceworkers/WaitUntilObserver.cpp
+++ b/Source/modules/serviceworkers/WaitUntilObserver.cpp
@@ -10,6 +10,7 @@
#include "bindings/v8/ScriptValue.h"
#include "core/dom/ExecutionContext.h"
#include "platform/NotImplemented.h"
+#include "public/platform/WebServiceWorkerEventResult.h"
#include "wtf/Assertions.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
@@ -84,6 +85,7 @@ WaitUntilObserver::WaitUntilObserver(ExecutionContext* context, int eventID)
: ContextLifecycleObserver(context)
, m_eventID(eventID)
, m_pendingActivity(0)
+ , m_hasError(false)
{
}
@@ -91,6 +93,8 @@ void WaitUntilObserver::reportError(const ScriptValue& value)
{
// FIXME: Propagate error message to the client for onerror handling.
notImplemented();
+
+ m_hasError = true;
}
void WaitUntilObserver::incrementPendingActivity()
@@ -104,7 +108,8 @@ void WaitUntilObserver::decrementPendingActivity()
if (--m_pendingActivity || !executionContext())
return;
- ServiceWorkerGlobalScopeClient::from(executionContext())->didHandleInstallEvent(m_eventID);
+ blink::WebServiceWorkerEventResult result = m_hasError ? blink::WebServiceWorkerEventResultRejected : blink::WebServiceWorkerEventResultCompleted;
+ ServiceWorkerGlobalScopeClient::from(executionContext())->didHandleInstallEvent(m_eventID, result);
observeContext(0);
}
« no previous file with comments | « Source/modules/serviceworkers/WaitUntilObserver.h ('k') | Source/web/ServiceWorkerGlobalScopeClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698