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 885cbc1d8e7a2d25620b3649d6484d0d751e9688..7c7c3a42cad9bedec1ae17234984693adfe5d96c 100644 |
--- a/content/public/browser/push_messaging_service.h |
+++ b/content/public/browser/push_messaging_service.h |
@@ -15,15 +15,38 @@ |
namespace content { |
+class ServiceWorkerContext; |
+ |
// A push service-agnostic interface that the Push API uses for talking to |
// push messaging services like GCM. Must only be used on the UI thread. |
class CONTENT_EXPORT PushMessagingService { |
public: |
+ using GetNotificationsShownCallback = |
+ base::Callback<void(const std::string& notifications_shown, |
+ bool success, bool not_found)>; |
+ |
+ using ResultCallback = base::Callback<void(bool success)>; |
+ |
using RegisterCallback = |
base::Callback<void(const std::string& /* registration_id */, |
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 registraton |
Michael van Ouwerkerk
2015/02/04 15:51:33
s/registraton/registration/
johnme
2015/02/04 17:57:41
Done.
|
+ // 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 |