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

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: 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..490af83f26837fea4df17c537c3efb4c1ea12f20 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);
+ ContentPushSubscriptionOptions 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();
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