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

Unified Diff: third_party/WebKit/Source/modules/background_sync/SyncCallbacks.cpp

Issue 2481393002: [background-sync] Remove WebSyncError and SyncCallbacks (Closed)
Patch Set: Remove stray SyncError declaration Created 4 years, 1 month 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: third_party/WebKit/Source/modules/background_sync/SyncCallbacks.cpp
diff --git a/third_party/WebKit/Source/modules/background_sync/SyncCallbacks.cpp b/third_party/WebKit/Source/modules/background_sync/SyncCallbacks.cpp
deleted file mode 100644
index 3920c3aa23f9cc63b39a32a8b3c36f3510c38c6c..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/modules/background_sync/SyncCallbacks.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2015 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 "modules/background_sync/SyncCallbacks.h"
-
-#include "bindings/core/v8/ScriptPromiseResolver.h"
-#include "modules/background_sync/SyncError.h"
-#include "modules/serviceworkers/ServiceWorkerRegistration.h"
-#include "wtf/PtrUtil.h"
-#include <memory>
-
-namespace blink {
-
-SyncRegistrationCallbacks::SyncRegistrationCallbacks(
- ScriptPromiseResolver* resolver,
- ServiceWorkerRegistration* serviceWorkerRegistration)
- : m_resolver(resolver),
- m_serviceWorkerRegistration(serviceWorkerRegistration) {
- ASSERT(m_resolver);
- ASSERT(m_serviceWorkerRegistration);
-}
-
-SyncRegistrationCallbacks::~SyncRegistrationCallbacks() {}
-
-void SyncRegistrationCallbacks::onSuccess(
- mojom::blink::SyncRegistrationPtr syncRegistration) {
- if (!m_resolver->getExecutionContext() ||
- m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) {
- return;
- }
-
- if (!syncRegistration) {
- m_resolver->resolve(v8::Null(m_resolver->getScriptState()->isolate()));
- return;
- }
- m_resolver->resolve();
-}
-
-void SyncRegistrationCallbacks::onError(const WebSyncError& error) {
- if (!m_resolver->getExecutionContext() ||
- m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) {
- return;
- }
- m_resolver->reject(SyncError::take(m_resolver.get(), error));
-}
-
-SyncGetRegistrationsCallbacks::SyncGetRegistrationsCallbacks(
- ScriptPromiseResolver* resolver,
- ServiceWorkerRegistration* serviceWorkerRegistration)
- : m_resolver(resolver),
- m_serviceWorkerRegistration(serviceWorkerRegistration) {
- ASSERT(m_resolver);
- ASSERT(m_serviceWorkerRegistration);
-}
-
-SyncGetRegistrationsCallbacks::~SyncGetRegistrationsCallbacks() {}
-
-void SyncGetRegistrationsCallbacks::onSuccess(
- const WebVector<mojom::blink::SyncRegistration*>& syncRegistrations) {
- if (!m_resolver->getExecutionContext() ||
- m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) {
- return;
- }
- Vector<String> tags;
- for (const mojom::blink::SyncRegistration* r : syncRegistrations) {
- tags.append(r->tag);
- }
- m_resolver->resolve(tags);
-}
-
-void SyncGetRegistrationsCallbacks::onError(const WebSyncError& error) {
- if (!m_resolver->getExecutionContext() ||
- m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) {
- return;
- }
- m_resolver->reject(SyncError::take(m_resolver.get(), error));
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698