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

Unified Diff: Source/modules/push_messaging/PushRegistration.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/PushRegistration.cpp
diff --git a/Source/modules/push_messaging/PushRegistration.cpp b/Source/modules/push_messaging/PushRegistration.cpp
deleted file mode 100644
index 7c85f95454eda63221717c44189bebf1c499ec90..0000000000000000000000000000000000000000
--- a/Source/modules/push_messaging/PushRegistration.cpp
+++ /dev/null
@@ -1,59 +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/PushRegistration.h"
-
-#include "bindings/core/v8/CallbackPromiseAdapter.h"
-#include "bindings/core/v8/ScriptPromiseResolver.h"
-#include "modules/push_messaging/PushError.h"
-#include "modules/serviceworkers/ServiceWorkerRegistration.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebPushProvider.h"
-#include "public/platform/WebPushRegistration.h"
-#include "wtf/OwnPtr.h"
-
-namespace blink {
-
-PushRegistration* PushRegistration::take(ScriptPromiseResolver*, WebPushRegistration* pushRegistration, ServiceWorkerRegistration* serviceWorkerRegistration)
-{
- OwnPtr<WebPushRegistration> registration = adoptPtr(pushRegistration);
- return new PushRegistration(registration->endpoint, registration->registrationId, serviceWorkerRegistration);
-}
-
-void PushRegistration::dispose(WebPushRegistration* pushRegistration)
-{
- if (pushRegistration)
- delete pushRegistration;
-}
-
-PushRegistration::PushRegistration(const String& endpoint, const String& registrationId, ServiceWorkerRegistration* serviceWorkerRegistration)
- : m_endpoint(endpoint)
- , m_registrationId(registrationId)
- , m_serviceWorkerRegistration(serviceWorkerRegistration)
-{
-}
-
-PushRegistration::~PushRegistration()
-{
-}
-
-ScriptPromise PushRegistration::unregister(ScriptState* scriptState)
-{
- RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
- ScriptPromise promise = resolver->promise();
-
- WebPushProvider* webPushProvider = Platform::current()->pushProvider();
- ASSERT(webPushProvider);
-
- webPushProvider->unregister(m_serviceWorkerRegistration->webRegistration(), new CallbackPromiseAdapter<bool, PushError>(resolver));
- return promise;
-}
-
-void PushRegistration::trace(Visitor* visitor)
-{
- visitor->trace(m_serviceWorkerRegistration);
-}
-
-} // namespace blink
« no previous file with comments | « Source/modules/push_messaging/PushRegistration.h ('k') | Source/modules/push_messaging/PushRegistration.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698