| 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 "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 WebNotificationManager* notificationManager = | 129 WebNotificationManager* notificationManager = |
| 130 Platform::current()->notificationManager(); | 130 Platform::current()->notificationManager(); |
| 131 DCHECK(notificationManager); | 131 DCHECK(notificationManager); |
| 132 | 132 |
| 133 notificationManager->getNotifications( | 133 notificationManager->getNotifications( |
| 134 options.tag(), registration.webRegistration(), std::move(callbacks)); | 134 options.tag(), registration.webRegistration(), std::move(callbacks)); |
| 135 return promise; | 135 return promise; |
| 136 } | 136 } |
| 137 | 137 |
| 138 void ServiceWorkerRegistrationNotifications::contextDestroyed() { | 138 void ServiceWorkerRegistrationNotifications::contextDestroyed( |
| 139 ExecutionContext*) { |
| 139 for (auto loader : m_loaders) | 140 for (auto loader : m_loaders) |
| 140 loader->stop(); | 141 loader->stop(); |
| 141 } | 142 } |
| 142 | 143 |
| 143 DEFINE_TRACE(ServiceWorkerRegistrationNotifications) { | 144 DEFINE_TRACE(ServiceWorkerRegistrationNotifications) { |
| 144 visitor->trace(m_registration); | 145 visitor->trace(m_registration); |
| 145 visitor->trace(m_loaders); | 146 visitor->trace(m_loaders); |
| 146 Supplement<ServiceWorkerRegistration>::trace(visitor); | 147 Supplement<ServiceWorkerRegistration>::trace(visitor); |
| 147 ContextLifecycleObserver::trace(visitor); | 148 ContextLifecycleObserver::trace(visitor); |
| 148 } | 149 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 Platform::current()->notificationManager(); | 191 Platform::current()->notificationManager(); |
| 191 DCHECK(notificationManager); | 192 DCHECK(notificationManager); |
| 192 | 193 |
| 193 notificationManager->showPersistent( | 194 notificationManager->showPersistent( |
| 194 WebSecurityOrigin(origin.get()), data, loader->getResources(), | 195 WebSecurityOrigin(origin.get()), data, loader->getResources(), |
| 195 m_registration->webRegistration(), std::move(callbacks)); | 196 m_registration->webRegistration(), std::move(callbacks)); |
| 196 m_loaders.remove(loader); | 197 m_loaders.remove(loader); |
| 197 } | 198 } |
| 198 | 199 |
| 199 } // namespace blink | 200 } // namespace blink |
| OLD | NEW |