| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ |
| 6 #define CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ | 6 #define CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void SubscribeFromDocument(const GURL& requesting_origin, | 76 void SubscribeFromDocument(const GURL& requesting_origin, |
| 77 int64_t service_worker_registration_id, | 77 int64_t service_worker_registration_id, |
| 78 int renderer_id, | 78 int renderer_id, |
| 79 int render_frame_id, | 79 int render_frame_id, |
| 80 const content::PushSubscriptionOptions& options, | 80 const content::PushSubscriptionOptions& options, |
| 81 const RegisterCallback& callback) override; | 81 const RegisterCallback& callback) override; |
| 82 void SubscribeFromWorker(const GURL& requesting_origin, | 82 void SubscribeFromWorker(const GURL& requesting_origin, |
| 83 int64_t service_worker_registration_id, | 83 int64_t service_worker_registration_id, |
| 84 const content::PushSubscriptionOptions& options, | 84 const content::PushSubscriptionOptions& options, |
| 85 const RegisterCallback& callback) override; | 85 const RegisterCallback& callback) override; |
| 86 void GetEncryptionInfo(const GURL& origin, | 86 void GetSubscriptionInfo(const GURL& origin, |
| 87 int64_t service_worker_registration_id, | 87 int64_t service_worker_registration_id, |
| 88 const std::string& sender_id, | 88 const std::string& sender_id, |
| 89 const EncryptionInfoCallback& callback) override; | 89 const std::string& subscription_id, |
| 90 void Unsubscribe(const GURL& requesting_origin, | 90 const SubscriptionInfoCallback& callback) override; |
| 91 void Unsubscribe(content::PushUnregistrationReason reason, |
| 92 const GURL& requesting_origin, |
| 91 int64_t service_worker_registration_id, | 93 int64_t service_worker_registration_id, |
| 92 const std::string& sender_id, | 94 const std::string& sender_id, |
| 93 const UnregisterCallback&) override; | 95 const UnregisterCallback&) override; |
| 94 blink::WebPushPermissionStatus GetPermissionStatus( | 96 blink::WebPushPermissionStatus GetPermissionStatus( |
| 95 const GURL& origin, | 97 const GURL& origin, |
| 96 bool user_visible) override; | 98 bool user_visible) override; |
| 97 bool SupportNonVisibleMessages() override; | 99 bool SupportNonVisibleMessages() override; |
| 98 void DidDeleteServiceWorkerRegistration( | 100 void DidDeleteServiceWorkerRegistration( |
| 99 const GURL& origin, | 101 const GURL& origin, |
| 100 int64_t service_worker_registration_id) override; | 102 int64_t service_worker_registration_id) override; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 const std::string& subscription_id, | 165 const std::string& subscription_id, |
| 164 instance_id::InstanceID::Result result); | 166 instance_id::InstanceID::Result result); |
| 165 | 167 |
| 166 void DidSubscribeWithEncryptionInfo( | 168 void DidSubscribeWithEncryptionInfo( |
| 167 const PushMessagingAppIdentifier& app_identifier, | 169 const PushMessagingAppIdentifier& app_identifier, |
| 168 const RegisterCallback& callback, | 170 const RegisterCallback& callback, |
| 169 const std::string& subscription_id, | 171 const std::string& subscription_id, |
| 170 const std::string& p256dh, | 172 const std::string& p256dh, |
| 171 const std::string& auth_secret); | 173 const std::string& auth_secret); |
| 172 | 174 |
| 173 // GetEncryptionInfo method -------------------------------------------------- | 175 // GetSubscriptionInfo methods ----------------------------------------------- |
| 174 | 176 |
| 175 void DidGetEncryptionInfo(const EncryptionInfoCallback& callback, | 177 void DidValidateSubscription(const std::string& app_id, |
| 178 const std::string& sender_id, |
| 179 const SubscriptionInfoCallback& callback, |
| 180 bool is_valid); |
| 181 |
| 182 void DidGetEncryptionInfo(const SubscriptionInfoCallback& callback, |
| 176 const std::string& p256dh, | 183 const std::string& p256dh, |
| 177 const std::string& auth_secret) const; | 184 const std::string& auth_secret) const; |
| 178 | 185 |
| 179 // Unsubscribe methods ------------------------------------------------------- | 186 // Unsubscribe methods ------------------------------------------------------- |
| 180 | 187 |
| 181 // |origin|, |service_worker_registration_id| and |app_id| should be provided | 188 // |origin|, |service_worker_registration_id| and |app_id| should be provided |
| 182 // whenever they can be obtained. It's valid for |origin| to be empty and | 189 // whenever they can be obtained. It's valid for |origin| to be empty and |
| 183 // |service_worker_registration_id| to be kInvalidServiceWorkerRegistrationId, | 190 // |service_worker_registration_id| to be kInvalidServiceWorkerRegistrationId, |
| 184 // or for app_id to be empty, but not both at once. | 191 // or for app_id to be empty, but not both at once. |
| 185 void UnsubscribeInternal(content::PushUnregistrationReason reason, | 192 void UnsubscribeInternal(content::PushUnregistrationReason reason, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 // we can finish processing them without being interrupted. | 278 // we can finish processing them without being interrupted. |
| 272 std::unique_ptr<ScopedKeepAlive> in_flight_keep_alive_; | 279 std::unique_ptr<ScopedKeepAlive> in_flight_keep_alive_; |
| 273 #endif | 280 #endif |
| 274 | 281 |
| 275 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; | 282 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; |
| 276 | 283 |
| 277 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); | 284 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); |
| 278 }; | 285 }; |
| 279 | 286 |
| 280 #endif // CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ | 287 #endif // CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ |
| OLD | NEW |