Chromium Code Reviews| Index: content/browser/notifications/notification_message_filter.h |
| diff --git a/content/browser/notifications/notification_message_filter.h b/content/browser/notifications/notification_message_filter.h |
| index 919499b47dc451c27e878b1433ec4de87906701a..319fd1ec21041bb3a15a7f49bbfe56f5b0bdd76d 100644 |
| --- a/content/browser/notifications/notification_message_filter.h |
| +++ b/content/browser/notifications/notification_message_filter.h |
| @@ -13,6 +13,7 @@ |
| #include "base/callback_forward.h" |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "content/common/service_worker/service_worker_status_code.h" |
| #include "content/public/browser/browser_message_filter.h" |
| #include "content/public/browser/notification_database_data.h" |
| #include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" |
| @@ -27,6 +28,8 @@ class PlatformNotificationContextImpl; |
| struct PlatformNotificationData; |
| class PlatformNotificationService; |
| class ResourceContext; |
| +class ServiceWorkerContext; |
| +class ServiceWorkerRegistration; |
| class NotificationMessageFilter : public BrowserMessageFilter { |
| public: |
| @@ -34,6 +37,7 @@ class NotificationMessageFilter : public BrowserMessageFilter { |
| int process_id, |
| PlatformNotificationContextImpl* notification_context, |
| ResourceContext* resource_context, |
| + ServiceWorkerContext* service_worker_context, |
| BrowserContext* browser_context); |
| // To be called by the notification's delegate when it has closed, so that |
| @@ -77,12 +81,25 @@ class NotificationMessageFilter : public BrowserMessageFilter { |
| // |success|. Will present the notification to the user when successful. |
| void DidWritePersistentNotificationData( |
| int request_id, |
| + int64_t service_worker_registration_id, |
| const GURL& origin, |
| const PlatformNotificationData& notification_data, |
| const NotificationResources& notification_resources, |
| bool success, |
| int64_t persistent_notification_id); |
| + // Callback to be invoked by the service worker context when the service |
| + // worker registration was retrieved. Will present the notification to the |
| + // user when successful. |
| + void DidFindServiceWorkerRegistration( |
| + int request_id, |
| + const GURL& origin, |
| + const PlatformNotificationData& notification_data, |
| + const NotificationResources& notification_resources, |
| + int64_t persistent_notification_id, |
| + content::ServiceWorkerStatusCode service_worker_status, |
| + const scoped_refptr<content::ServiceWorkerRegistration>& registration); |
| + |
| // Callback to be invoked when all notifications belonging to a Service Worker |
| // registration have been read from the database. The |success| argument |
| // indicates whether the data could be read successfully, whereas the actual |
| @@ -114,6 +131,7 @@ class NotificationMessageFilter : public BrowserMessageFilter { |
| int process_id_; |
| scoped_refptr<PlatformNotificationContextImpl> notification_context_; |
| ResourceContext* resource_context_; |
| + ServiceWorkerContext* service_worker_context_; |
|
Peter Beverloo
2016/07/19 14:17:17
nit: This should be a scoped_refptr. Another optio
Peter Beverloo
2016/07/19 14:17:17
nit: Use ServiceWorkerContextWrapper since we're i
|
| BrowserContext* browser_context_; |
| // Map mapping notification ids to their associated close closures. |