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

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

Issue 841333002: Push API: rename registration to subscription. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use https in the spec link. Created 5 years, 11 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/PushRegistrationCallbacks.cpp
diff --git a/Source/modules/push_messaging/PushRegistrationCallbacks.cpp b/Source/modules/push_messaging/PushRegistrationCallbacks.cpp
deleted file mode 100644
index 976080761b3c32f28989125db648eebf11b32705..0000000000000000000000000000000000000000
--- a/Source/modules/push_messaging/PushRegistrationCallbacks.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "modules/push_messaging/PushRegistrationCallbacks.h"
-
-#include "bindings/core/v8/ScriptPromiseResolver.h"
-#include "modules/push_messaging/PushError.h"
-#include "modules/push_messaging/PushRegistration.h"
-#include "modules/serviceworkers/ServiceWorkerRegistration.h"
-
-namespace blink {
-
-PushRegistrationCallbacks::PushRegistrationCallbacks(PassRefPtrWillBeRawPtr<ScriptPromiseResolver> resolver, ServiceWorkerRegistration* registration)
- : m_resolver(resolver)
- , m_serviceWorkerRegistration(registration)
-{
- ASSERT(m_resolver);
- ASSERT(m_serviceWorkerRegistration);
-}
-
-PushRegistrationCallbacks::~PushRegistrationCallbacks()
-{
-}
-
-void PushRegistrationCallbacks::onSuccess(WebPushRegistration* webPushRegistration)
-{
- if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) {
- PushRegistration::dispose(webPushRegistration);
- return;
- }
-
- if (!webPushRegistration) {
- m_resolver->resolve(v8::Null(m_resolver->scriptState()->isolate()));
- return;
- }
- m_resolver->resolve(PushRegistration::take(m_resolver.get(), webPushRegistration, m_serviceWorkerRegistration));
-}
-
-void PushRegistrationCallbacks::onError(WebPushError* error)
-{
- if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) {
- PushError::dispose(error);
- return;
- }
- m_resolver->reject(PushError::take(m_resolver.get(), error));
-}
-
-} // namespace blink
« no previous file with comments | « Source/modules/push_messaging/PushRegistrationCallbacks.h ('k') | Source/modules/push_messaging/PushSubscription.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698