Migrate interfaces from notification_service.mojom to new Mojo types

Convert the implementation and clients in the browser and renderer
processes for the blink.mojom.NonPersistentNotificationListener and
blink.mojom.NotificationService mojo interfaces, and adapt unit tests.

Bug: 955171, 978694
Change-Id: I03aa11addfcc84fa3c16680f31f58cdca69a29db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1712573
Commit-Queue: Mario Sanchez Prada <[email protected]>
Reviewed-by: Dominick Ng <[email protected]>
Reviewed-by: Ken Rockot <[email protected]>
Reviewed-by: Peter Beverloo <[email protected]>
Reviewed-by: Camille Lamy <[email protected]>
Reviewed-by: Mike West <[email protected]>
Cr-Commit-Position: refs/heads/master@{#680097}
diff --git a/content/browser/notifications/blink_notification_service_impl.h b/content/browser/notifications/blink_notification_service_impl.h
index 3b7875f0..5253f6b 100644
--- a/content/browser/notifications/blink_notification_service_impl.h
+++ b/content/browser/notifications/blink_notification_service_impl.h
@@ -5,13 +5,17 @@
 #ifndef CONTENT_BROWSER_NOTIFICATIONS_BLINK_NOTIFICATION_SERVICE_IMPL_H_
 #define CONTENT_BROWSER_NOTIFICATIONS_BLINK_NOTIFICATION_SERVICE_IMPL_H_
 
+#include <string>
+#include <vector>
+
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
 #include "content/browser/service_worker/service_worker_context_wrapper.h"
 #include "content/common/content_export.h"
 #include "content/public/browser/browser_context.h"
-#include "mojo/public/cpp/bindings/binding.h"
-#include "mojo/public/cpp/bindings/interface_request.h"
+#include "mojo/public/cpp/bindings/pending_receiver.h"
+#include "mojo/public/cpp/bindings/pending_remote.h"
+#include "mojo/public/cpp/bindings/receiver.h"
 #include "third_party/blink/public/mojom/notifications/notification_service.mojom.h"
 #include "third_party/blink/public/mojom/permissions/permission_status.mojom.h"
 #include "url/origin.h"
@@ -37,7 +41,7 @@
       BrowserContext* browser_context,
       scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
       const url::Origin& origin,
-      mojo::InterfaceRequest<blink::mojom::NotificationService> request);
+      mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
   ~BlinkNotificationServiceImpl() override;
 
   // blink::mojom::NotificationService implementation.
@@ -46,7 +50,8 @@
       const std::string& token,
       const blink::PlatformNotificationData& platform_notification_data,
       const blink::NotificationResources& notification_resources,
-      blink::mojom::NonPersistentNotificationListenerPtr listener_ptr) override;
+      mojo::PendingRemote<blink::mojom::NonPersistentNotificationListener>
+          listener_remote) override;
   void CloseNonPersistentNotification(const std::string& token) override;
   void DisplayPersistentNotification(
       int64_t service_worker_registration_id,
@@ -101,7 +106,7 @@
   // The origin that this notification service is communicating with.
   url::Origin origin_;
 
-  mojo::Binding<blink::mojom::NotificationService> binding_;
+  mojo::Receiver<blink::mojom::NotificationService> receiver_;
 
   base::WeakPtrFactory<BlinkNotificationServiceImpl> weak_factory_for_io_{this};
   base::WeakPtrFactory<BlinkNotificationServiceImpl> weak_factory_for_ui_{this};