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

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

Issue 1210283005: Introduce the PushSubscription.curve25519dh attribute (2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android fix 2 Created 5 years, 5 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/child/push_messaging/push_provider.h ('k') | content/common/push_messaging_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 927da07baa35fd30984f680cc51c482e0198c973..515c3fe5cf0f487fec5a8b414c7564b260f06ba9 100644
--- a/content/child/push_messaging/push_provider.cc
+++ b/content/child/push_messaging/push_provider.cc
@@ -26,7 +26,7 @@ int CurrentWorkerId() {
// Returns the id of the given |service_worker_registration|, which
// is only available on the implementation of the interface.
-int64 GetServiceWorkerRegistrationId(
+int64_t GetServiceWorkerRegistrationId(
blink::WebServiceWorkerRegistration* service_worker_registration) {
return static_cast<WebServiceWorkerRegistrationImpl*>(
service_worker_registration)->registration_id();
@@ -73,7 +73,7 @@ void PushProvider::subscribe(
DCHECK(callbacks);
int request_id = push_dispatcher_->GenerateRequestId(CurrentWorkerId());
subscription_callbacks_.AddWithID(callbacks, request_id);
- int64 service_worker_registration_id =
+ int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
thread_safe_sender_->Send(new PushMessagingHostMsg_SubscribeFromWorker(
request_id, service_worker_registration_id, options.userVisibleOnly));
@@ -88,7 +88,7 @@ void PushProvider::unsubscribe(
int request_id = push_dispatcher_->GenerateRequestId(CurrentWorkerId());
unsubscribe_callbacks_.AddWithID(callbacks, request_id);
- int64 service_worker_registration_id =
+ int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
thread_safe_sender_->Send(new PushMessagingHostMsg_Unsubscribe(
request_id, service_worker_registration_id));
@@ -101,7 +101,7 @@ void PushProvider::getSubscription(
DCHECK(callbacks);
int request_id = push_dispatcher_->GenerateRequestId(CurrentWorkerId());
subscription_callbacks_.AddWithID(callbacks, request_id);
- int64 service_worker_registration_id =
+ int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
thread_safe_sender_->Send(new PushMessagingHostMsg_GetRegistration(
request_id, service_worker_registration_id));
@@ -115,7 +115,7 @@ void PushProvider::getPermissionStatus(
DCHECK(callbacks);
int request_id = push_dispatcher_->GenerateRequestId(CurrentWorkerId());
permission_status_callbacks_.AddWithID(callbacks, request_id);
- int64 service_worker_registration_id =
+ int64_t service_worker_registration_id =
GetServiceWorkerRegistrationId(service_worker_registration);
thread_safe_sender_->Send(new PushMessagingHostMsg_GetPermissionStatus(
request_id, service_worker_registration_id, options.userVisibleOnly));
@@ -148,14 +148,15 @@ bool PushProvider::OnMessageReceived(const IPC::Message& message) {
void PushProvider::OnSubscribeFromWorkerSuccess(
int request_id,
- const GURL& endpoint) {
+ const GURL& endpoint,
+ const std::vector<uint8_t>& curve25519dh) {
blink::WebPushSubscriptionCallbacks* callbacks =
subscription_callbacks_.Lookup(request_id);
if (!callbacks)
return;
scoped_ptr<blink::WebPushSubscription> subscription(
- new blink::WebPushSubscription(endpoint));
+ new blink::WebPushSubscription(endpoint, curve25519dh));
callbacks->onSuccess(subscription.release());
subscription_callbacks_.Remove(request_id);
@@ -205,14 +206,15 @@ void PushProvider::OnUnsubscribeError(
void PushProvider::OnGetRegistrationSuccess(
int request_id,
- const GURL& endpoint) {
+ const GURL& endpoint,
+ const std::vector<uint8_t>& curve25519dh) {
blink::WebPushSubscriptionCallbacks* callbacks =
subscription_callbacks_.Lookup(request_id);
if (!callbacks)
return;
scoped_ptr<blink::WebPushSubscription> subscription(
- new blink::WebPushSubscription(endpoint));
+ new blink::WebPushSubscription(endpoint, curve25519dh));
callbacks->onSuccess(subscription.release());
subscription_callbacks_.Remove(request_id);
« no previous file with comments | « content/child/push_messaging/push_provider.h ('k') | content/common/push_messaging_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698