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/push_messaging/PushSubscription.h" | 5 #include "modules/push_messaging/PushSubscription.h" |
6 | 6 |
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
9 #include "bindings/core/v8/V8ObjectBuilder.h" | 9 #include "bindings/core/v8/V8ObjectBuilder.h" |
10 #include "modules/push_messaging/PushError.h" | 10 #include "modules/push_messaging/PushError.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 PushSubscription::~PushSubscription() | 42 PushSubscription::~PushSubscription() |
43 { | 43 { |
44 } | 44 } |
45 | 45 |
46 KURL PushSubscription::endpoint() const | 46 KURL PushSubscription::endpoint() const |
47 { | 47 { |
48 return m_endpoint; | 48 return m_endpoint; |
49 } | 49 } |
50 | 50 |
51 DOMArrayBuffer* PushSubscription::getKey(const AtomicString& name) const | 51 PassRefPtr<DOMArrayBuffer> PushSubscription::getKey(const AtomicString& name) co
nst |
52 { | 52 { |
53 if (name == "p256dh") | 53 if (name == "p256dh") |
54 return m_p256dh; | 54 return m_p256dh; |
55 if (name == "auth") | 55 if (name == "auth") |
56 return m_auth; | 56 return m_auth; |
57 | 57 |
58 return nullptr; | 58 return nullptr; |
59 } | 59 } |
60 | 60 |
61 ScriptPromise PushSubscription::unsubscribe(ScriptState* scriptState) | 61 ScriptPromise PushSubscription::unsubscribe(ScriptState* scriptState) |
(...skipping 21 matching lines...) Expand all Loading... |
83 keys.add("auth", WTF::base64URLEncode(static_cast<const char*>(m_auth->d
ata()), m_auth->byteLength())); | 83 keys.add("auth", WTF::base64URLEncode(static_cast<const char*>(m_auth->d
ata()), m_auth->byteLength())); |
84 | 84 |
85 result.add("keys", keys); | 85 result.add("keys", keys); |
86 } | 86 } |
87 | 87 |
88 return result.scriptValue(); | 88 return result.scriptValue(); |
89 } | 89 } |
90 | 90 |
91 DEFINE_TRACE(PushSubscription) | 91 DEFINE_TRACE(PushSubscription) |
92 { | 92 { |
93 visitor->trace(m_p256dh); | |
94 visitor->trace(m_auth); | |
95 visitor->trace(m_serviceWorkerRegistration); | 93 visitor->trace(m_serviceWorkerRegistration); |
96 } | 94 } |
97 | 95 |
98 } // namespace blink | 96 } // namespace blink |
OLD | NEW |