Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2563)

Unified Diff: Source/modules/push_messaging/PushSubscriptionCallbacks.cpp

Issue 1304723002: [PushMessaging] Use appopriate type parameters for WebCallbacks (1/3). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/push_messaging/PushSubscriptionCallbacks.cpp
diff --git a/Source/modules/push_messaging/PushSubscriptionCallbacks.cpp b/Source/modules/push_messaging/PushSubscriptionCallbacks.cpp
index afc108d2784d1c523c76170e49383798e5ec22c2..34e7da322bb7dda267393ed123e423e2c7dd677f 100644
--- a/Source/modules/push_messaging/PushSubscriptionCallbacks.cpp
+++ b/Source/modules/push_messaging/PushSubscriptionCallbacks.cpp
@@ -9,6 +9,7 @@
#include "modules/push_messaging/PushError.h"
#include "modules/push_messaging/PushSubscription.h"
#include "modules/serviceworkers/ServiceWorkerRegistration.h"
+#include "public/platform/modules/push_messaging/WebPushSubscription.h"
namespace blink {
@@ -24,24 +25,19 @@ PushSubscriptionCallbacks::~PushSubscriptionCallbacks()
{
}
-void PushSubscriptionCallbacks::onSuccess(WebPushSubscription* webPushSubscription)
+void PushSubscriptionCallbacks::onSuccess(WebPassOwnPtr<WebPushSubscription> webPushSubscription)
{
if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped())
return;
- if (!webPushSubscription) {
- m_resolver->resolve(v8::Null(m_resolver->scriptState()->isolate()));
- return;
- }
- m_resolver->resolve(PushSubscription::take(m_resolver.get(), webPushSubscription, m_serviceWorkerRegistration));
+ m_resolver->resolve(PushSubscription::take(m_resolver.get(), webPushSubscription.release(), m_serviceWorkerRegistration));
}
-void PushSubscriptionCallbacks::onError(WebPushError* error)
+void PushSubscriptionCallbacks::onError(const WebPushError& error)
{
- OwnPtr<WebPushError> ownError = adoptPtr(error);
if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped())
return;
- m_resolver->reject(PushError::take(m_resolver.get(), *ownError));
+ m_resolver->reject(PushError::take(m_resolver.get(), error));
}
} // namespace blink
« no previous file with comments | « Source/modules/push_messaging/PushSubscriptionCallbacks.h ('k') | public/platform/modules/push_messaging/WebPushClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698