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 |