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

Unified Diff: content/public/browser/push_messaging_service.h

Issue 930083002: Unregister with push service and SW database when permission is lost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ready Created 5 years, 10 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/public/browser/push_messaging_service.h
diff --git a/content/public/browser/push_messaging_service.h b/content/public/browser/push_messaging_service.h
index 4d06cdde2c1ea99adff2acc7adc2f7a3fbcbf60e..33d47e69fb11238aa9c5790e49d01330b7c782b9 100644
--- a/content/public/browser/push_messaging_service.h
+++ b/content/public/browser/push_messaging_service.h
@@ -15,6 +15,7 @@
namespace content {
+class BrowserContext;
class ServiceWorkerContext;
// A push service-agnostic interface that the Push API uses for talking to
@@ -32,21 +33,6 @@ class CONTENT_EXPORT PushMessagingService {
PushRegistrationStatus /* status */)>;
using UnregisterCallback = base::Callback<void(PushUnregistrationStatus)>;
- // Provide a storage mechanism to read/write an opaque
- // "notifications_shown_by_last_few_pushes" string associated with a Service
- // Worker registration. Stored data is deleted when the associated
- // registration is deleted.
- static void GetNotificationsShownByLastFewPushes(
- ServiceWorkerContext* service_worker_context,
- int64 service_worker_registration_id,
- const GetNotificationsShownCallback& callback);
- static void SetNotificationsShownByLastFewPushes(
- ServiceWorkerContext* service_worker_context,
- int64 service_worker_registration_id,
- const GURL& origin,
- const std::string& notifications_shown,
- const ResultCallback& callback);
-
virtual ~PushMessagingService() {}
// Returns the absolute URL exposed by the push server where the webapp server
@@ -86,6 +72,28 @@ class CONTENT_EXPORT PushMessagingService {
virtual blink::WebPushPermissionStatus GetPermissionStatus(
const GURL& requesting_origin,
const GURL& embedding_origin) = 0;
+
+ protected:
+ // Provide a storage mechanism to read/write an opaque
+ // "notifications_shown_by_last_few_pushes" string associated with a Service
+ // Worker registration. Stored data is deleted when the associated
+ // registration is deleted.
+ static void GetNotificationsShownByLastFewPushes(
+ ServiceWorkerContext* service_worker_context,
+ int64 service_worker_registration_id,
+ const GetNotificationsShownCallback& callback);
+ static void SetNotificationsShownByLastFewPushes(
+ ServiceWorkerContext* service_worker_context,
+ int64 service_worker_registration_id,
+ const GURL& origin,
+ const std::string& notifications_shown,
+ const ResultCallback& callback);
+
+ // Clear the push registration id stored in the service worker with the given
+ // |service_worker_registration_id| for the given |origin|.
+ static void ClearPushRegistrationID(BrowserContext* browser_context,
+ const GURL& origin,
+ int64 service_worker_registration_id);
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698