| 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 PushManager_h | 5 #ifndef PushManager_h | 
| 6 #define PushManager_h | 6 #define PushManager_h | 
| 7 | 7 | 
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" | 
| 9 #include "bindings/modules/v8/UnionTypesModules.h" |  | 
| 10 #include "modules/ModulesExport.h" |  | 
| 11 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" | 
| 12 | 10 | 
| 13 namespace blink { | 11 namespace blink { | 
| 14 | 12 | 
| 15 class ExceptionState; |  | 
| 16 class PushSubscriptionOptions; | 13 class PushSubscriptionOptions; | 
| 17 class ScriptPromise; | 14 class ScriptPromise; | 
| 18 class ScriptState; | 15 class ScriptState; | 
| 19 class ServiceWorkerRegistration; | 16 class ServiceWorkerRegistration; | 
| 20 struct WebPushSubscriptionOptions; |  | 
| 21 | 17 | 
| 22 class MODULES_EXPORT PushManager final : public GarbageCollected<PushManager>, p
    ublic ScriptWrappable { | 18 class PushManager final : public GarbageCollected<PushManager>, public ScriptWra
    ppable { | 
| 23     DEFINE_WRAPPERTYPEINFO(); | 19     DEFINE_WRAPPERTYPEINFO(); | 
| 24 public: | 20 public: | 
| 25     static PushManager* create(ServiceWorkerRegistration* registration) | 21     static PushManager* create(ServiceWorkerRegistration* registration) | 
| 26     { | 22     { | 
| 27         return new PushManager(registration); | 23         return new PushManager(registration); | 
| 28     } | 24     } | 
| 29 | 25 | 
| 30     ScriptPromise subscribe(ScriptState*, const PushSubscriptionOptions&, | 26     ScriptPromise subscribe(ScriptState*, const PushSubscriptionOptions&); | 
| 31         ExceptionState&); |  | 
| 32     ScriptPromise getSubscription(ScriptState*); | 27     ScriptPromise getSubscription(ScriptState*); | 
| 33     ScriptPromise permissionState(ScriptState*, const PushSubscriptionOptions&, | 28     ScriptPromise permissionState(ScriptState*, const PushSubscriptionOptions&); | 
| 34         ExceptionState&); |  | 
| 35 | 29 | 
| 36     DECLARE_TRACE(); | 30     DECLARE_TRACE(); | 
| 37 | 31 | 
| 38     static WebPushSubscriptionOptions toWebPushSubscriptionOptions( |  | 
| 39         const PushSubscriptionOptions&, ExceptionState&); |  | 
| 40 |  | 
| 41 private: | 32 private: | 
| 42     explicit PushManager(ServiceWorkerRegistration*); | 33     explicit PushManager(ServiceWorkerRegistration*); | 
| 43 | 34 | 
| 44     Member<ServiceWorkerRegistration> m_registration; | 35     Member<ServiceWorkerRegistration> m_registration; | 
| 45 }; | 36 }; | 
| 46 | 37 | 
| 47 } // namespace blink | 38 } // namespace blink | 
| 48 | 39 | 
| 49 #endif // PushManager_h | 40 #endif // PushManager_h | 
| OLD | NEW | 
|---|