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

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

Issue 2867023002: [ServiceWorker] waitUntil() should wait until all promises got resolved/rejected. (Closed)
Patch Set: Created 3 years, 7 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 | « third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp
index 839f336a2d17707a5f95b998d9b2cb2cfe5e688f..968ee26a76442eccc994a789da7205c59252ab46 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp
@@ -65,7 +65,7 @@ class WaitUntilObserver::ThenFunction final : public ScriptFunction {
ASSERT(observer_);
ASSERT(resolve_type_ == kFulfilled || resolve_type_ == kRejected);
if (resolve_type_ == kRejected) {
- observer_->ReportError(value);
+ observer_->ReportPromiseRejected(value);
value =
ScriptPromise::Reject(value.GetScriptState(), value).GetScriptValue();
}
@@ -143,11 +143,11 @@ WaitUntilObserver::WaitUntilObserver(ExecutionContext* context,
this,
&WaitUntilObserver::ConsumeWindowInteraction) {}
-void WaitUntilObserver::ReportError(const ScriptValue& value) {
+void WaitUntilObserver::ReportPromiseRejected(const ScriptValue& value) {
// FIXME: Propagate error message to the client for onerror handling.
leonhsl(Using Gerrit) 2017/05/08 10:33:48 ServiceWorker spec does not have such requirement,
NOTIMPLEMENTED();
leonhsl(Using Gerrit) 2017/05/08 10:33:48 I'm confused why NOTIMPLEMENTED() here does not cr
falken 2017/05/09 04:00:25 I think it's fine to delete the FIXME and the NOTI
leonhsl(Using Gerrit) 2017/05/09 07:26:52 Done.
- has_error_ = true;
+ has_rejected_promise_ = true;
}
void WaitUntilObserver::IncrementPendingActivity() {
@@ -162,8 +162,9 @@ void WaitUntilObserver::DecrementPendingActivity() {
ServiceWorkerGlobalScopeClient* client =
ServiceWorkerGlobalScopeClient::From(execution_context_);
WebServiceWorkerEventResult result =
- has_error_ ? kWebServiceWorkerEventResultRejected
- : kWebServiceWorkerEventResultCompleted;
+ (has_error_ || has_rejected_promise_)
+ ? kWebServiceWorkerEventResultRejected
+ : kWebServiceWorkerEventResultCompleted;
switch (type_) {
case kActivate:
client->DidHandleActivateEvent(event_id_, result, event_dispatch_time_);
« no previous file with comments | « third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698