OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_NOTIFICATIONS_PLATFORM_NOTIFICATION_CONTEXT_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_CONTEXT_IMPL_H_ |
6 #define CONTENT_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_CONTEXT_IMPL_H_ | 6 #define CONTENT_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_CONTEXT_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 11 matching lines...) Expand all Loading... |
22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
23 #include "content/public/browser/platform_notification_context.h" | 23 #include "content/public/browser/platform_notification_context.h" |
24 #include "third_party/WebKit/public/platform/modules/notifications/notification_
service.mojom.h" | 24 #include "third_party/WebKit/public/platform/modules/notifications/notification_
service.mojom.h" |
25 | 25 |
26 class GURL; | 26 class GURL; |
27 | 27 |
28 namespace base { | 28 namespace base { |
29 class SequencedTaskRunner; | 29 class SequencedTaskRunner; |
30 } | 30 } |
31 | 31 |
| 32 namespace service_manager { |
| 33 struct BindSourceInfo; |
| 34 } |
| 35 |
32 namespace content { | 36 namespace content { |
33 | 37 |
34 class BlinkNotificationServiceImpl; | 38 class BlinkNotificationServiceImpl; |
35 class BrowserContext; | 39 class BrowserContext; |
36 class NotificationDatabase; | 40 class NotificationDatabase; |
37 struct NotificationDatabaseData; | 41 struct NotificationDatabaseData; |
38 class ResourceContext; | 42 class ResourceContext; |
39 class ServiceWorkerContextWrapper; | 43 class ServiceWorkerContextWrapper; |
40 | 44 |
41 // Implementation of the Web Notification storage context. The public methods | 45 // Implementation of the Web Notification storage context. The public methods |
(...skipping 14 matching lines...) Expand all Loading... |
56 | 60 |
57 // To be called on the UI thread to initialize the instance. | 61 // To be called on the UI thread to initialize the instance. |
58 void Initialize(); | 62 void Initialize(); |
59 | 63 |
60 // To be called on the UI thread when the context is being shut down. | 64 // To be called on the UI thread when the context is being shut down. |
61 void Shutdown(); | 65 void Shutdown(); |
62 | 66 |
63 // Creates a BlinkNotificationServiceImpl that is owned by this context. Must | 67 // Creates a BlinkNotificationServiceImpl that is owned by this context. Must |
64 // be called on the UI thread, although the service will be created on and | 68 // be called on the UI thread, although the service will be created on and |
65 // bound to the IO thread. | 69 // bound to the IO thread. |
66 void CreateService( | 70 void CreateService(int render_process_id, |
67 int render_process_id, | 71 const service_manager::BindSourceInfo& source_info, |
68 mojo::InterfaceRequest<blink::mojom::NotificationService> request); | 72 blink::mojom::NotificationServiceRequest request); |
69 | 73 |
70 // Removes |service| from the list of owned services, for example because the | 74 // Removes |service| from the list of owned services, for example because the |
71 // Mojo pipe disconnected. Must be called on the IO thread. | 75 // Mojo pipe disconnected. Must be called on the IO thread. |
72 void RemoveService(BlinkNotificationServiceImpl* service); | 76 void RemoveService(BlinkNotificationServiceImpl* service); |
73 | 77 |
74 // Returns the notification Id generator owned by the context. | 78 // Returns the notification Id generator owned by the context. |
75 NotificationIdGenerator* notification_id_generator() { | 79 NotificationIdGenerator* notification_id_generator() { |
76 return ¬ification_id_generator_; | 80 return ¬ification_id_generator_; |
77 } | 81 } |
78 | 82 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // The notification services are owned by the platform context, and will be | 213 // The notification services are owned by the platform context, and will be |
210 // removed when either this class is destroyed or the Mojo pipe disconnects. | 214 // removed when either this class is destroyed or the Mojo pipe disconnects. |
211 std::vector<std::unique_ptr<BlinkNotificationServiceImpl>> services_; | 215 std::vector<std::unique_ptr<BlinkNotificationServiceImpl>> services_; |
212 | 216 |
213 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationContextImpl); | 217 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationContextImpl); |
214 }; | 218 }; |
215 | 219 |
216 } // namespace content | 220 } // namespace content |
217 | 221 |
218 #endif // CONTENT_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_CONTEXT_IMPL_H_ | 222 #endif // CONTENT_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_CONTEXT_IMPL_H_ |
OLD | NEW |