| 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_CHILD_PUSH_MESSAGING_PUSH_PROVIDER_H_ | 5 #ifndef CONTENT_CHILD_PUSH_MESSAGING_PUSH_PROVIDER_H_ |
| 6 #define CONTENT_CHILD_PUSH_MESSAGING_PUSH_PROVIDER_H_ | 6 #define CONTENT_CHILD_PUSH_MESSAGING_PUSH_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 |
| 10 #include <memory> |
| 9 #include <string> | 11 #include <string> |
| 10 #include <vector> | 12 #include <vector> |
| 11 | 13 |
| 12 #include "base/id_map.h" | 14 #include "base/id_map.h" |
| 13 #include "base/macros.h" | 15 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 15 #include "content/child/push_messaging/push_dispatcher.h" | 17 #include "content/child/push_messaging/push_dispatcher.h" |
| 16 #include "content/public/child/worker_thread.h" | 18 #include "content/public/child/worker_thread.h" |
| 17 #include "content/public/common/push_messaging_status.h" | 19 #include "content/public/common/push_messaging_status.h" |
| 18 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushError
.h" | 20 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushError
.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 43 ThreadSafeSender* thread_safe_sender, | 45 ThreadSafeSender* thread_safe_sender, |
| 44 PushDispatcher* push_dispatcher); | 46 PushDispatcher* push_dispatcher); |
| 45 | 47 |
| 46 // WorkerThread::Observer implementation. | 48 // WorkerThread::Observer implementation. |
| 47 void WillStopCurrentWorkerThread() override; | 49 void WillStopCurrentWorkerThread() override; |
| 48 | 50 |
| 49 // blink::WebPushProvider implementation. | 51 // blink::WebPushProvider implementation. |
| 50 void subscribe( | 52 void subscribe( |
| 51 blink::WebServiceWorkerRegistration* service_worker_registration, | 53 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 52 const blink::WebPushSubscriptionOptions& options, | 54 const blink::WebPushSubscriptionOptions& options, |
| 53 blink::WebPushSubscriptionCallbacks* callbacks) override; | 55 std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks) override; |
| 54 void unsubscribe( | 56 void unsubscribe( |
| 55 blink::WebServiceWorkerRegistration* service_worker_registration, | 57 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 56 blink::WebPushUnsubscribeCallbacks* callbacks) override; | 58 std::unique_ptr<blink::WebPushUnsubscribeCallbacks> callbacks) override; |
| 57 void getSubscription( | 59 void getSubscription( |
| 58 blink::WebServiceWorkerRegistration* service_worker_registration, | 60 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 59 blink::WebPushSubscriptionCallbacks* callbacks) override; | 61 std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks) override; |
| 60 void getPermissionStatus( | 62 void getPermissionStatus( |
| 61 blink::WebServiceWorkerRegistration* service_worker_registration, | 63 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 62 const blink::WebPushSubscriptionOptions& options, | 64 const blink::WebPushSubscriptionOptions& options, |
| 63 blink::WebPushPermissionStatusCallbacks* callbacks) override; | 65 std::unique_ptr<blink::WebPushPermissionStatusCallbacks> callbacks) |
| 66 override; |
| 64 | 67 |
| 65 // Called by the PushDispatcher. | 68 // Called by the PushDispatcher. |
| 66 bool OnMessageReceived(const IPC::Message& message); | 69 bool OnMessageReceived(const IPC::Message& message); |
| 67 | 70 |
| 68 private: | 71 private: |
| 69 PushProvider(ThreadSafeSender* thread_safe_sender, | 72 PushProvider(ThreadSafeSender* thread_safe_sender, |
| 70 PushDispatcher* push_dispatcher); | 73 PushDispatcher* push_dispatcher); |
| 71 | 74 |
| 72 // IPC message handlers. | 75 // IPC message handlers. |
| 73 void OnSubscribeFromWorkerSuccess(int request_id, | 76 void OnSubscribeFromWorkerSuccess(int request_id, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // the callbacks. | 112 // the callbacks. |
| 110 IDMap<blink::WebPushUnsubscribeCallbacks, IDMapOwnPointer> | 113 IDMap<blink::WebPushUnsubscribeCallbacks, IDMapOwnPointer> |
| 111 unsubscribe_callbacks_; | 114 unsubscribe_callbacks_; |
| 112 | 115 |
| 113 DISALLOW_COPY_AND_ASSIGN(PushProvider); | 116 DISALLOW_COPY_AND_ASSIGN(PushProvider); |
| 114 }; | 117 }; |
| 115 | 118 |
| 116 } // namespace content | 119 } // namespace content |
| 117 | 120 |
| 118 #endif // CONTENT_CHILD_PUSH_MESSAGING_PUSH_PROVIDER_H_ | 121 #endif // CONTENT_CHILD_PUSH_MESSAGING_PUSH_PROVIDER_H_ |
| OLD | NEW |