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

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

Issue 883743002: Push API: Grace - allow one in ten pushes to show no notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@userdata
Patch Set: Fix typo (invesed needed but not shown logic) 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
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/push_messaging_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2edd63fbef4bf43a19bb813be94fdff7745105ae 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
+ // 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
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/push_messaging_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698