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

Unified Diff: content/child/push_messaging/push_provider.cc

Issue 1701313002: Partial implementation of subscription restrictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed broken file Created 4 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/child/push_messaging/push_provider.cc
diff --git a/content/child/push_messaging/push_provider.cc b/content/child/push_messaging/push_provider.cc
index f8e807def7b5d4bd2efdb117b54083bacd006298..9c3de1eb56b7d52e69b8b6967a613f3130b4abbc 100644
--- a/content/child/push_messaging/push_provider.cc
+++ b/content/child/push_messaging/push_provider.cc
@@ -75,8 +75,13 @@ void PushProvider::subscribe(
subscription_callbacks_.AddWithID(callbacks, request_id);
int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
+ PushSubscriptionOptions content_options;
+ content_options.user_visible_only = options.userVisibleOnly;
+ // If subscription restrictions aren't enabled or a key isn't provided
+ // by the client, the sender id will be read from the database.
+ content_options.sender_info = options.applicationServerKey.utf8();
Peter Beverloo 2016/02/18 11:39:43 This would be a bug already: the |sender_info| is
harkness 2016/02/22 15:40:43 I've removed the flag on the SubscriptionOptions,
thread_safe_sender_->Send(new PushMessagingHostMsg_SubscribeFromWorker(
- request_id, service_worker_registration_id, options.userVisibleOnly));
+ request_id, service_worker_registration_id, content_options));
}
void PushProvider::unsubscribe(

Powered by Google App Engine
This is Rietveld 408576698