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 "config.h" | 5 #include "config.h" |
6 #include "modules/push_messaging/PushRegistration.h" | 6 #include "modules/push_messaging/PushRegistration.h" |
7 | 7 |
| 8 #include "wtf/OwnPtr.h" |
| 9 |
8 namespace blink { | 10 namespace blink { |
9 | 11 |
| 12 PushRegistration* PushRegistration::from(ScriptPromiseResolver*, WebType* regist
rationRaw) |
| 13 { |
| 14 OwnPtr<WebType> registration = adoptPtr(registrationRaw); |
| 15 return new PushRegistration(registration->endpoint, registration->registrati
onId); |
| 16 } |
| 17 |
| 18 void PushRegistration::dispose(WebType* registrationRaw) |
| 19 { |
| 20 delete registrationRaw; |
| 21 } |
| 22 |
10 PushRegistration::PushRegistration(const String& pushEndpoint, const String& pus
hRegistrationId) | 23 PushRegistration::PushRegistration(const String& pushEndpoint, const String& pus
hRegistrationId) |
11 : m_pushEndpoint(pushEndpoint) | 24 : m_pushEndpoint(pushEndpoint) |
12 , m_pushRegistrationId(pushRegistrationId) | 25 , m_pushRegistrationId(pushRegistrationId) |
13 { | 26 { |
14 ScriptWrappable::init(this); | 27 ScriptWrappable::init(this); |
15 } | 28 } |
16 | 29 |
17 PushRegistration::~PushRegistration() | 30 PushRegistration::~PushRegistration() |
18 { | 31 { |
19 } | 32 } |
20 | 33 |
21 } // namespace blink | 34 } // namespace blink |
OLD | NEW |