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

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

Issue 914693002: Push API: Fix unsubscribing from GCM on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove obsolete PushEventNoPermission test 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 33d47e69fb11238aa9c5790e49d01330b7c782b9..f382cf19db9ff3d76b2a58e8b38ea155fa422703 100644
--- a/content/public/browser/push_messaging_service.h
+++ b/content/public/browser/push_messaging_service.h
@@ -22,17 +22,17 @@ class ServiceWorkerContext;
// 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)>;
+ using StringCallback = base::Callback<void(const std::string& data,
+ bool success,
+ bool not_found)>;
+
+ using ResultCallback = base::Callback<void(bool success)>;
+
virtual ~PushMessagingService() {}
// Returns the absolute URL exposed by the push server where the webapp server
@@ -63,6 +63,7 @@ class CONTENT_EXPORT PushMessagingService {
// the push service.
virtual void Unregister(const GURL& requesting_origin,
int64 service_worker_registration_id,
+ const std::string& sender_id,
bool retry_on_failure,
const UnregisterCallback& callback) = 0;
@@ -81,7 +82,7 @@ class CONTENT_EXPORT PushMessagingService {
static void GetNotificationsShownByLastFewPushes(
ServiceWorkerContext* service_worker_context,
int64 service_worker_registration_id,
- const GetNotificationsShownCallback& callback);
+ const StringCallback& callback);
static void SetNotificationsShownByLastFewPushes(
ServiceWorkerContext* service_worker_context,
int64 service_worker_registration_id,
@@ -89,6 +90,11 @@ class CONTENT_EXPORT PushMessagingService {
const std::string& notifications_shown,
const ResultCallback& callback);
+ static void GetSenderId(BrowserContext* browser_context,
+ const GURL& origin,
+ int64 service_worker_registration_id,
+ const StringCallback& 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,
« no previous file with comments | « content/browser/push_messaging/push_messaging_message_filter.cc ('k') | content/public/browser/push_messaging_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698