Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1544)

Unified Diff: content/browser/notifications/notification_message_filter.h

Issue 2151993002: [WebAPKs] Plumb service worker scope to notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into notification_scope Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5ebce0ecdc76981b129b292619c4cd59e1021566 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 ServiceWorkerContextWrapper;
+class ServiceWorkerRegistration;
class NotificationMessageFilter : public BrowserMessageFilter {
public:
@@ -34,6 +37,7 @@ class NotificationMessageFilter : public BrowserMessageFilter {
int process_id,
PlatformNotificationContextImpl* notification_context,
ResourceContext* resource_context,
+ const scoped_refptr<ServiceWorkerContextWrapper>& 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_;
+ scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
BrowserContext* browser_context_;
// Map mapping notification ids to their associated close closures.

Powered by Google App Engine
This is Rietveld 408576698