Bug 1242436 - default value of ok = true in order to check the return of SendPush and SendPushSubscriptionChange. r?kitcambridge draft
authorBogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Mon, 25 Jan 2016 14:47:06 +0200
changeset 325033 52f5e626a6d1980435db19aa13e795744c970bc5
parent 324949 c2256ee8ae9a8ee0bf7ab49a8b1924720d846cc7
child 513440 5db0841c5098fc7e3ce4a8892d869e61c0c8f2c5
push id9970
push userbmo:bogdan.postelnicu@softvision.ro
push dateMon, 25 Jan 2016 12:47:30 +0000
reviewerskitcambridge
bugs1242436
milestone46.0a1
Bug 1242436 - default value of ok = true in order to check the return of SendPush and SendPushSubscriptionChange. r?kitcambridge
dom/push/PushNotifier.cpp
--- 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;
 }