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

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

Issue 2697793004: Push API: Validate storage before returning cached subscriptions (Closed)
Patch Set: Fix include Created 3 years, 9 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/common/push_messaging_param_traits.cc ('k') | content/public/common/push_messaging_status.h » ('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 248b76d23156743a5ce0180d86d6fef47afb9844..41cbd4d4639b6add058518fc4e11cf97714b8fe5 100644
--- a/content/public/browser/push_messaging_service.h
+++ b/content/public/browser/push_messaging_service.h
@@ -30,12 +30,10 @@ class CONTENT_EXPORT PushMessagingService {
const std::vector<uint8_t>& auth,
PushRegistrationStatus status)>;
using UnregisterCallback = base::Callback<void(PushUnregistrationStatus)>;
-
- using EncryptionInfoCallback = base::Callback<void(
- bool success,
- const std::vector<uint8_t>& p256dh,
- const std::vector<uint8_t>& auth)>;
-
+ using SubscriptionInfoCallback =
+ base::Callback<void(bool is_valid,
+ const std::vector<uint8_t>& p256dh,
+ const std::vector<uint8_t>& auth)>;
using StringCallback = base::Callback<void(const std::string& data,
bool success,
bool not_found)>;
@@ -65,19 +63,24 @@ class CONTENT_EXPORT PushMessagingService {
const PushSubscriptionOptions& options,
const RegisterCallback& callback) = 0;
- // Retrieves the encryption information associated with the subscription
- // associated to |origin| and |service_worker_registration_id|. |sender_id| is
- // also required since an InstanceID might have multiple tokens associated
- // with different senders, though in practice Push doesn't yet use that.
- virtual void GetEncryptionInfo(const GURL& origin,
- int64_t service_worker_registration_id,
- const std::string& sender_id,
- const EncryptionInfoCallback& callback) = 0;
-
- // Unsubscribe the given |sender_id| from the push messaging service. The
- // subscription will be synchronously deactivated locally, and asynchronously
- // sent to the push service, with automatic retry.
- virtual void Unsubscribe(const GURL& requesting_origin,
+ // Retrieves the subscription associated with |origin| and
+ // |service_worker_registration_id|, validates that the provided
+ // |subscription_id| matches the stored one, then passes the encryption
+ // information to the callback. |sender_id| is also required since an
+ // InstanceID might have multiple tokens associated with different senders,
+ // though in practice Push doesn't yet use that.
+ virtual void GetSubscriptionInfo(
+ const GURL& origin,
+ int64_t service_worker_registration_id,
+ const std::string& sender_id,
+ const std::string& subscription_id,
+ const SubscriptionInfoCallback& callback) = 0;
+
+ // Unsubscribe the given |sender_id| from the push messaging service. Locally
+ // deactivates the subscription, then runs |callback|, then asynchronously
+ // attempts to unsubscribe with the push service.
+ virtual void Unsubscribe(PushUnregistrationReason reason,
+ const GURL& requesting_origin,
int64_t service_worker_registration_id,
const std::string& sender_id,
const UnregisterCallback& callback) = 0;
« no previous file with comments | « content/common/push_messaging_param_traits.cc ('k') | content/public/common/push_messaging_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698