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 #include "modules/notifications/ServiceWorkerRegistrationNotifications.h" | 5 #include "modules/notifications/ServiceWorkerRegistrationNotifications.h" |
6 | 6 |
| 7 #include <memory> |
| 8 #include <utility> |
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 9 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
8 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 11 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "core/dom/ExecutionContext.h" | 12 #include "core/dom/ExecutionContext.h" |
11 #include "modules/notifications/GetNotificationOptions.h" | 13 #include "modules/notifications/GetNotificationOptions.h" |
12 #include "modules/notifications/Notification.h" | 14 #include "modules/notifications/Notification.h" |
13 #include "modules/notifications/NotificationData.h" | 15 #include "modules/notifications/NotificationData.h" |
14 #include "modules/notifications/NotificationManager.h" | 16 #include "modules/notifications/NotificationManager.h" |
15 #include "modules/notifications/NotificationOptions.h" | 17 #include "modules/notifications/NotificationOptions.h" |
16 #include "modules/notifications/NotificationResourcesLoader.h" | 18 #include "modules/notifications/NotificationResourcesLoader.h" |
17 #include "modules/serviceworkers/ServiceWorkerRegistration.h" | 19 #include "modules/serviceworkers/ServiceWorkerRegistration.h" |
18 #include "platform/Histogram.h" | 20 #include "platform/Histogram.h" |
19 #include "platform/heap/Handle.h" | 21 #include "platform/heap/Handle.h" |
20 #include "public/platform/Platform.h" | 22 #include "public/platform/Platform.h" |
21 #include "public/platform/WebSecurityOrigin.h" | 23 #include "public/platform/WebSecurityOrigin.h" |
22 #include "public/platform/modules/notifications/WebNotificationData.h" | 24 #include "public/platform/modules/notifications/WebNotificationData.h" |
23 #include "wtf/Assertions.h" | 25 #include "wtf/Assertions.h" |
24 #include "wtf/PtrUtil.h" | 26 #include "wtf/PtrUtil.h" |
25 #include "wtf/RefPtr.h" | 27 #include "wtf/RefPtr.h" |
26 #include <memory> | |
27 #include <utility> | |
28 | 28 |
29 namespace blink { | 29 namespace blink { |
30 namespace { | 30 namespace { |
31 | 31 |
32 // Allows using a CallbackPromiseAdapter with a WebVector to resolve the | 32 // Allows using a CallbackPromiseAdapter with a WebVector to resolve the |
33 // getNotifications() promise with a HeapVector owning Notifications. | 33 // getNotifications() promise with a HeapVector owning Notifications. |
34 class NotificationArray { | 34 class NotificationArray { |
35 public: | 35 public: |
36 using WebType = const WebVector<WebPersistentNotificationInfo>&; | 36 using WebType = const WebVector<WebPersistentNotificationInfo>&; |
37 | 37 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 Platform::current()->notificationManager(); | 191 Platform::current()->notificationManager(); |
192 DCHECK(notificationManager); | 192 DCHECK(notificationManager); |
193 | 193 |
194 notificationManager->showPersistent( | 194 notificationManager->showPersistent( |
195 WebSecurityOrigin(origin.get()), data, loader->getResources(), | 195 WebSecurityOrigin(origin.get()), data, loader->getResources(), |
196 m_registration->webRegistration(), std::move(callbacks)); | 196 m_registration->webRegistration(), std::move(callbacks)); |
197 m_loaders.erase(loader); | 197 m_loaders.erase(loader); |
198 } | 198 } |
199 | 199 |
200 } // namespace blink | 200 } // namespace blink |
OLD | NEW |