Commit f57e60c6 authored by Kit Cambridge's avatar Kit Cambridge
Browse files

Bug 1247089 - Log Web Push decryption errors. r=bkelly

MozReview-Commit-ID: HEEq8IPlwBx

--HG--
extra : rebase_source : 8501836fa322b3a09ffec21e83fdb32e4aa3abf5
parent c92c8e51
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@ interface nsIPushNotifier : nsISupports
                          [array, size_is(dataLen)] in uint8_t data);

  void notifySubscriptionChange(in ACString scope, in nsIPrincipal principal);

  void notifyError(in ACString scope, in nsIPrincipal principal,
                   in DOMString message, in uint32_t flags);
};

/**
+17 −0
Original line number Diff line number Diff line
@@ -3331,5 +3331,22 @@ ContentChild::RecvPushSubscriptionChange(const nsCString& aScope,
  return true;
}

bool
ContentChild::RecvPushError(const nsCString& aScope, const nsString& aMessage,
                            const uint32_t& aFlags)
{
#ifndef MOZ_SIMPLEPUSH
  nsCOMPtr<nsIPushNotifier> pushNotifierIface =
      do_GetService("@mozilla.org/push/Notifier;1");
  if (NS_WARN_IF(!pushNotifierIface)) {
      return true;
  }
  PushNotifier* pushNotifier =
    static_cast<PushNotifier*>(pushNotifierIface.get());
  pushNotifier->NotifyErrorWorkers(aScope, aMessage, aFlags);
#endif
  return true;
}

} // namespace dom
} // namespace mozilla
+4 −0
Original line number Diff line number Diff line
@@ -544,6 +544,10 @@ public:
  RecvPushSubscriptionChange(const nsCString& aScope,
                             const IPC::Principal& aPrincipal) override;

  virtual bool
  RecvPushError(const nsCString& aScope, const nsString& aMessage,
                const uint32_t& aFlags) override;

  // Get the directory for IndexedDB files. We query the parent for this and
  // cache the value
  nsString &GetIndexedDBPath();
+5 −0
Original line number Diff line number Diff line
@@ -743,6 +743,11 @@ child:
     */
    async PushSubscriptionChange(nsCString scope, Principal principal);

    /**
     * Send a Push error message to all service worker clients in the child.
     */
    async PushError(nsCString scope, nsString message, uint32_t flags);

    /**
     * Windows specific: associate this content process with the browsers
     * audio session.
+2 −0
Original line number Diff line number Diff line
@@ -205,3 +205,5 @@ TargetPrincipalDoesNotMatch=Failed to execute 'postMessage' on 'DOMWindow': The
RewriteYoutubeEmbed=Rewriting old-style Youtube Flash embed (%S) to iframe embed (%S). Please update page to use iframe instead of embed/object, if possible.
# LOCALIZATION NOTE: Do not translate 'youtube'. %S values are origins, like https://domain.com:port
RewriteYoutubeEmbedInvalidQuery=Rewriting old-style Youtube Flash embed (%S) to iframe embed (%S). Query was invalid and removed from URL. Please update page to use iframe instead of embed/object, if possible.
# LOCALIZATION NOTE: Do not translate "ServiceWorker". %1$S is the ServiceWorker scope URL. %2$S is an error string.
PushMessageDecryptionFailure=The ServiceWorker for scope '%1$S' encountered an error decrypting a push message: '%2$S'. For help with encryption, please see https://developer.mozilla.org/en-US/docs/Web/API/Push_API/Using_the_Push_API#Encryption
Loading