| 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/PushSubscriptionCallbacks.h" | 6 #include "modules/push_messaging/PushSubscriptionCallbacks.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "modules/push_messaging/PushError.h" | 9 #include "modules/push_messaging/PushError.h" |
| 10 #include "modules/push_messaging/PushSubscription.h" | 10 #include "modules/push_messaging/PushSubscription.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 return; | 34 return; |
| 35 } | 35 } |
| 36 m_resolver->resolve(PushSubscription::take(m_resolver.get(), webPushSubscrip
tion, m_serviceWorkerRegistration)); | 36 m_resolver->resolve(PushSubscription::take(m_resolver.get(), webPushSubscrip
tion, m_serviceWorkerRegistration)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void PushSubscriptionCallbacks::onError(WebPushError* error) | 39 void PushSubscriptionCallbacks::onError(WebPushError* error) |
| 40 { | 40 { |
| 41 OwnPtr<WebPushError> ownError = adoptPtr(error); | 41 OwnPtr<WebPushError> ownError = adoptPtr(error); |
| 42 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ
eDOMObjectsAreStopped()) | 42 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ
eDOMObjectsAreStopped()) |
| 43 return; | 43 return; |
| 44 m_resolver->reject(PushError::take(m_resolver.get(), ownError.release())); | 44 m_resolver->reject(PushError::take(m_resolver.get(), *ownError)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace blink | 47 } // namespace blink |
| OLD | NEW |