Chromium Code Reviews| Index: chrome/browser/push_messaging/push_messaging_service_impl.h | 
| diff --git a/chrome/browser/push_messaging/push_messaging_service_impl.h b/chrome/browser/push_messaging/push_messaging_service_impl.h | 
| index 1c6370e34ba8790e3b686294dab13c88b7210d21..179ad112262292f177b148161f2b09a302dd2605 100644 | 
| --- a/chrome/browser/push_messaging/push_messaging_service_impl.h | 
| +++ b/chrome/browser/push_messaging/push_messaging_service_impl.h | 
| @@ -64,25 +64,27 @@ class PushMessagingServiceImpl : public content::PushMessagingService, | 
| // content::PushMessagingService implementation: | 
| GURL GetPushEndpoint() override; | 
| - void RegisterFromDocument( | 
| + void SubscribeFromDocument( | 
| const GURL& requesting_origin, | 
| int64 service_worker_registration_id, | 
| const std::string& sender_id, | 
| int renderer_id, | 
| int render_frame_id, | 
| bool user_visible, | 
| - const content::PushMessagingService::RegisterCallback& callback) override; | 
| - void RegisterFromWorker( | 
| + const content::PushMessagingService::SubscribeCallback& callback) | 
| + override; | 
| 
 
johnme
2015/05/07 13:31:25
Nit: Same indent as previous line.
 
 | 
| + void SubscribeFromWorker( | 
| const GURL& requesting_origin, | 
| int64 service_worker_registration_id, | 
| const std::string& sender_id, | 
| bool user_visible, | 
| - const content::PushMessagingService::RegisterCallback& callback) override; | 
| - void Unregister( | 
| + const content::PushMessagingService::SubscribeCallback& callback) | 
| + override; | 
| 
 
johnme
2015/05/07 13:31:25
Nit: Same indent as previous line.
 
 | 
| + void Unsubscribe( | 
| const GURL& requesting_origin, | 
| int64 service_worker_registration_id, | 
| const std::string& sender_id, | 
| - const content::PushMessagingService::UnregisterCallback&) override; | 
| + const content::PushMessagingService::UnsubscribeCallback&) override; | 
| blink::WebPushPermissionStatus GetPermissionStatus( | 
| const GURL& requesting_origin, | 
| const GURL& embedding_origin, | 
| @@ -102,9 +104,9 @@ class PushMessagingServiceImpl : public content::PushMessagingService, | 
| const base::Closure& callback); | 
| private: | 
| - // A registration is pending until it has succeeded or failed. | 
| - void IncreasePushRegistrationCount(int add, bool is_pending); | 
| - void DecreasePushRegistrationCount(int subtract, bool was_pending); | 
| + // A subscription is pending until it has succeeded or failed. | 
| + void IncreasePushSubscriptionCount(int add, bool is_pending); | 
| + void DecreasePushSubscriptionCount(int subtract, bool was_pending); | 
| // OnMessage methods --------------------------------------------------------- | 
| @@ -163,41 +165,41 @@ class PushMessagingServiceImpl : public content::PushMessagingService, | 
| bool success, | 
| int64_t persistent_notification_id); | 
| - // Register methods ---------------------------------------------------------- | 
| + // Subscription methods ------------------------------------------------------ | 
| 
 
johnme
2015/05/07 13:31:25
Nit: "Subscribe methods" for consistency
 
 | 
| - void RegisterEnd( | 
| - const content::PushMessagingService::RegisterCallback& callback, | 
| - const std::string& registration_id, | 
| - content::PushRegistrationStatus status); | 
| + void SubscribeEnd( | 
| + const content::PushMessagingService::SubscribeCallback& callback, | 
| + const std::string& subscription_id, | 
| + content::PushSubscriptionStatus status); | 
| - void DidRegister( | 
| + void DidSubscribe( | 
| const PushMessagingApplicationId& application_id, | 
| - const content::PushMessagingService::RegisterCallback& callback, | 
| - const std::string& registration_id, | 
| + const content::PushMessagingService::SubscribeCallback& callback, | 
| + const std::string& subscription_id, | 
| gcm::GCMClient::Result result); | 
| void DidRequestPermission( | 
| const PushMessagingApplicationId& application_id, | 
| const std::string& sender_id, | 
| - const content::PushMessagingService::RegisterCallback& callback, | 
| + const content::PushMessagingService::SubscribeCallback& callback, | 
| ContentSetting content_setting); | 
| - // Unregister methods -------------------------------------------------------- | 
| + // Unsubscribe methods ------------------------------------------------------- | 
| - void Unregister(const std::string& app_id_guid, | 
| - const std::string& sender_id, | 
| - const content::PushMessagingService::UnregisterCallback&); | 
| + void Unsubscribe(const std::string& app_id_guid, | 
| + const std::string& sender_id, | 
| + const content::PushMessagingService::UnsubscribeCallback&); | 
| - void DidUnregister(bool was_registered, | 
| - const content::PushMessagingService::UnregisterCallback&, | 
| - gcm::GCMClient::Result result); | 
| + void DidUnsubscribe(bool was_subscribed, | 
| + const content::PushMessagingService::UnsubscribeCallback&, | 
| + gcm::GCMClient::Result result); | 
| // OnContentSettingChanged methods ------------------------------------------- | 
| - void UnregisterBecausePermissionRevoked(const PushMessagingApplicationId& id, | 
| - const base::Closure& closure, | 
| - const std::string& sender_id, | 
| - bool success, bool not_found); | 
| + void UnsubscribeBecausePermissionRevoked(const PushMessagingApplicationId& id, | 
| + const base::Closure& closure, | 
| + const std::string& sender_id, | 
| + bool success, bool not_found); | 
| // Helper methods ------------------------------------------------------------ | 
| @@ -208,8 +210,8 @@ class PushMessagingServiceImpl : public content::PushMessagingService, | 
| Profile* profile_; | 
| - int push_registration_count_; | 
| - int pending_push_registration_count_; | 
| + int push_subscription_count_; | 
| + int pending_push_subscription_count_; | 
| base::Closure message_callback_for_testing_; | 
| base::Closure content_setting_changed_callback_for_testing_; |