Bug 1242436 - default value of ok = true in order to check the return of SendPush and SendPushSubscriptionChange. r?kitcambridge
--- a/dom/push/PushNotifier.cpp
+++ b/dom/push/PushNotifier.cpp
@@ -126,17 +126,17 @@ PushNotifier::NotifyPushWorkers(const ns
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return swm->SendPushEvent(originSuffix, aScope, aData);
}
// Otherwise, we're in the parent and e10s is enabled. Broadcast the event
// to all content processes.
- bool ok = false;
+ bool ok = true;
nsTArray<ContentParent*> contentActors;
ContentParent::GetAll(contentActors);
for (uint32_t i = 0; i < contentActors.Length(); ++i) {
if (aData) {
ok &= contentActors[i]->SendPushWithData(PromiseFlatCString(aScope),
IPC::Principal(aPrincipal), aData.ref());
} else {
ok &= contentActors[i]->SendPush(PromiseFlatCString(aScope),
@@ -164,17 +164,17 @@ PushNotifier::NotifySubscriptionChangeWo
nsresult rv = aPrincipal->GetOriginSuffix(originSuffix);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return swm->SendPushSubscriptionChangeEvent(originSuffix, aScope);
}
// Parent process, e10s enabled.
- bool ok = false;
+ bool ok = true;
nsTArray<ContentParent*> contentActors;
ContentParent::GetAll(contentActors);
for (uint32_t i = 0; i < contentActors.Length(); ++i) {
ok &= contentActors[i]->SendPushSubscriptionChange(
PromiseFlatCString(aScope), IPC::Principal(aPrincipal));
}
return ok ? NS_OK : NS_ERROR_FAILURE;
}