Index: third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.h |
diff --git a/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.h b/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.h |
index a256622ffedf78766fa6638ace2bd0fad783e880..391e789ecd7d822442dd059a7c261623a1597d2f 100644 |
--- a/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.h |
+++ b/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.h |
@@ -6,20 +6,54 @@ |
#define ServiceWorkerRegistrationNotifications_h |
#include "bindings/core/v8/ScriptPromise.h" |
+#include "core/dom/ContextLifecycleObserver.h" |
+#include "platform/Supplementable.h" |
+#include "platform/heap/GarbageCollected.h" |
+#include "platform/heap/Handle.h" |
+#include "platform/heap/HeapAllocator.h" |
+#include "platform/heap/Visitor.h" |
+#include "public/platform/modules/notifications/WebNotificationManager.h" |
+#include "wtf/Noncopyable.h" |
+#include "wtf/OwnPtr.h" |
+#include "wtf/PassOwnPtr.h" |
+#include "wtf/PassRefPtr.h" |
namespace blink { |
+class ExecutionContext; |
class ExceptionState; |
class GetNotificationOptions; |
class NotificationOptions; |
+class NotificationResourcesLoader; |
class ScriptState; |
+class SecurityOrigin; |
class ServiceWorkerRegistration; |
+struct WebNotificationData; |
-class ServiceWorkerRegistrationNotifications { |
- STATIC_ONLY(ServiceWorkerRegistrationNotifications); |
+class ServiceWorkerRegistrationNotifications final : public GarbageCollectedFinalized<ServiceWorkerRegistrationNotifications>, public Supplement<ServiceWorkerRegistration>, public ContextLifecycleObserver { |
+ USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistrationNotifications); |
+ WTF_MAKE_NONCOPYABLE(ServiceWorkerRegistrationNotifications); |
public: |
+ ~ServiceWorkerRegistrationNotifications(); |
static ScriptPromise showNotification(ScriptState*, ServiceWorkerRegistration&, const String& title, const NotificationOptions&, ExceptionState&); |
static ScriptPromise getNotifications(ScriptState*, ServiceWorkerRegistration&, const GetNotificationOptions&); |
+ |
+ // ContextLifecycleObserver interface. |
+ void contextDestroyed() override; |
+ |
+ DECLARE_VIRTUAL_TRACE(); |
+ |
+private: |
+ ServiceWorkerRegistrationNotifications(ExecutionContext*, ServiceWorkerRegistration*); |
+ |
+ static const char* supplementName(); |
+ static ServiceWorkerRegistrationNotifications& from(ExecutionContext*, ServiceWorkerRegistration&); |
+ |
+ void prepareShow(const WebNotificationData&, PassOwnPtr<WebNotificationShowCallbacks>); |
+ void didLoadResources(PassRefPtr<SecurityOrigin>, const WebNotificationData&, PassOwnPtr<WebNotificationShowCallbacks>, NotificationResourcesLoader*); |
+ |
+ Member<ServiceWorkerRegistration> m_registration; |
+ HeapHashSet<Member<NotificationResourcesLoader>> m_loaders; |
}; |
} // namespace blink |