| 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 CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_MANAGER_H_ | 6 #define CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 struct RegisterData; | 55 struct RegisterData; |
| 56 class Core; | 56 class Core; |
| 57 | 57 |
| 58 friend class BrowserThread; | 58 friend class BrowserThread; |
| 59 friend class base::DeleteHelper<PushMessagingManager>; | 59 friend class base::DeleteHelper<PushMessagingManager>; |
| 60 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; | 60 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; |
| 61 | 61 |
| 62 ~PushMessagingManager() override; | 62 ~PushMessagingManager() override; |
| 63 | 63 |
| 64 void DidCheckForExistingRegistration( | 64 void DidCheckForExistingRegistration( |
| 65 const SubscribeCallback& callback, | |
| 66 const RegisterData& data, | 65 const RegisterData& data, |
| 67 const std::vector<std::string>& push_registration_id, | 66 const std::vector<std::string>& push_registration_id, |
| 68 ServiceWorkerStatusCode service_worker_status); | 67 ServiceWorkerStatusCode service_worker_status); |
| 69 | 68 |
| 70 void DidGetEncryptionKeys(const SubscribeCallback& callback, | 69 void DidGetEncryptionKeys(const RegisterData& data, |
| 71 const RegisterData& data, | |
| 72 const std::string& push_registration_id, | 70 const std::string& push_registration_id, |
| 73 bool success, | 71 bool success, |
| 74 const std::vector<uint8_t>& p256dh, | 72 const std::vector<uint8_t>& p256dh, |
| 75 const std::vector<uint8_t>& auth); | 73 const std::vector<uint8_t>& auth); |
| 76 | 74 |
| 77 void DidGetSenderIdFromStorage(const SubscribeCallback& callback, | 75 void DidGetSenderIdFromStorage(const RegisterData& data, |
| 78 const RegisterData& data, | |
| 79 const std::vector<std::string>& sender_id, | 76 const std::vector<std::string>& sender_id, |
| 80 ServiceWorkerStatusCode service_worker_status); | 77 ServiceWorkerStatusCode service_worker_status); |
| 81 | 78 |
| 82 // Called via PostTask from UI thread. | 79 // Called via PostTask from UI thread. |
| 83 void PersistRegistrationOnIO(const SubscribeCallback& callback, | 80 void PersistRegistrationOnIO(const RegisterData& data, |
| 84 const RegisterData& data, | |
| 85 const std::string& push_registration_id, | 81 const std::string& push_registration_id, |
| 86 const std::vector<uint8_t>& p256dh, | 82 const std::vector<uint8_t>& p256dh, |
| 87 const std::vector<uint8_t>& auth); | 83 const std::vector<uint8_t>& auth); |
| 88 | 84 |
| 89 void DidPersistRegistrationOnIO( | 85 void DidPersistRegistrationOnIO( |
| 90 const SubscribeCallback& callback, | |
| 91 const RegisterData& data, | 86 const RegisterData& data, |
| 92 const std::string& push_registration_id, | 87 const std::string& push_registration_id, |
| 93 const std::vector<uint8_t>& p256dh, | 88 const std::vector<uint8_t>& p256dh, |
| 94 const std::vector<uint8_t>& auth, | 89 const std::vector<uint8_t>& auth, |
| 95 ServiceWorkerStatusCode service_worker_status); | 90 ServiceWorkerStatusCode service_worker_status); |
| 96 | 91 |
| 97 // Called both from IO thread, and via PostTask from UI thread. | 92 // Called both from IO thread, and via PostTask from UI thread. |
| 98 void SendSubscriptionError(const SubscribeCallback& callback, | 93 void SendSubscriptionError(const RegisterData& data, |
| 99 const RegisterData& data, | |
| 100 PushRegistrationStatus status); | 94 PushRegistrationStatus status); |
| 101 // Called both from IO thread, and via PostTask from UI thread. | 95 // Called both from IO thread, and via PostTask from UI thread. |
| 102 void SendSubscriptionSuccess(const SubscribeCallback& callback, | 96 void SendSubscriptionSuccess(const RegisterData& data, |
| 103 const RegisterData& data, | |
| 104 PushRegistrationStatus status, | 97 PushRegistrationStatus status, |
| 105 const std::string& push_subscription_id, | 98 const std::string& push_subscription_id, |
| 106 const std::vector<uint8_t>& p256dh, | 99 const std::vector<uint8_t>& p256dh, |
| 107 const std::vector<uint8_t>& auth); | 100 const std::vector<uint8_t>& auth); |
| 108 | 101 |
| 109 void UnsubscribeHavingGottenSenderId( | 102 void UnsubscribeHavingGottenSenderId( |
| 110 const UnsubscribeCallback& callback, | 103 const UnsubscribeCallback& callback, |
| 111 int64_t service_worker_registration_id, | 104 int64_t service_worker_registration_id, |
| 112 const GURL& requesting_origin, | 105 const GURL& requesting_origin, |
| 113 const std::vector<std::string>& sender_id, | 106 const std::vector<std::string>& sender_id, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 mojo::BindingSet<mojom::PushMessaging> bindings_; | 144 mojo::BindingSet<mojom::PushMessaging> bindings_; |
| 152 | 145 |
| 153 base::WeakPtrFactory<PushMessagingManager> weak_factory_io_to_io_; | 146 base::WeakPtrFactory<PushMessagingManager> weak_factory_io_to_io_; |
| 154 | 147 |
| 155 DISALLOW_COPY_AND_ASSIGN(PushMessagingManager); | 148 DISALLOW_COPY_AND_ASSIGN(PushMessagingManager); |
| 156 }; | 149 }; |
| 157 | 150 |
| 158 } // namespace content | 151 } // namespace content |
| 159 | 152 |
| 160 #endif // CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_MANAGER_H_ | 153 #endif // CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_MANAGER_H_ |
| OLD | NEW |