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 PushSubscription_h | 5 #ifndef PushSubscription_h |
6 #define PushSubscription_h | 6 #define PushSubscription_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 DEFINE_WRAPPERTYPEINFO(); | 25 DEFINE_WRAPPERTYPEINFO(); |
26 public: | 26 public: |
27 static PushSubscription* take(ScriptPromiseResolver*, PassOwnPtr<WebPushSubs
cription>, ServiceWorkerRegistration*); | 27 static PushSubscription* take(ScriptPromiseResolver*, PassOwnPtr<WebPushSubs
cription>, ServiceWorkerRegistration*); |
28 static void dispose(WebPushSubscription* subscriptionRaw); | 28 static void dispose(WebPushSubscription* subscriptionRaw); |
29 | 29 |
30 virtual ~PushSubscription(); | 30 virtual ~PushSubscription(); |
31 | 31 |
32 KURL endpoint() const; | 32 KURL endpoint() const; |
33 PassRefPtr<DOMArrayBuffer> curve25519dh() const; | 33 PassRefPtr<DOMArrayBuffer> curve25519dh() const; |
34 | 34 |
| 35 PassRefPtr<DOMArrayBuffer> getKey(const AtomicString& name) const; |
35 ScriptPromise unsubscribe(ScriptState*); | 36 ScriptPromise unsubscribe(ScriptState*); |
36 | 37 |
37 ScriptValue toJSONForBinding(ScriptState*); | 38 ScriptValue toJSONForBinding(ScriptState*); |
38 | 39 |
39 DECLARE_TRACE(); | 40 DECLARE_TRACE(); |
40 | 41 |
41 private: | 42 private: |
42 PushSubscription(const WebPushSubscription&, ServiceWorkerRegistration*); | 43 PushSubscription(const WebPushSubscription&, ServiceWorkerRegistration*); |
43 | 44 |
44 KURL m_endpoint; | 45 KURL m_endpoint; |
45 RefPtr<DOMArrayBuffer> m_curve25519dh; | 46 RefPtr<DOMArrayBuffer> m_curve25519dh; |
46 | 47 |
47 Member<ServiceWorkerRegistration> m_serviceWorkerRegistration; | 48 Member<ServiceWorkerRegistration> m_serviceWorkerRegistration; |
48 }; | 49 }; |
49 | 50 |
50 } // namespace blink | 51 } // namespace blink |
51 | 52 |
52 #endif // PushSubscription_h | 53 #endif // PushSubscription_h |
OLD | NEW |