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

Unified Diff: Source/modules/serviceworkers/ServiceWorkerRegistration.cpp

Issue 512163002: ServiceWorker: Change the return value of ServiceWorkerRegistration::unregister to boolean (3/4) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 3 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/serviceworkers/ServiceWorkerRegistration.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
index 05143bed93162240915e36493db5e78a3465c3dc..9a1f92fb12bf7a7f961e2b03e26575d680322ca2 100644
--- a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -20,24 +20,6 @@
namespace blink {
-#ifdef DISABLE_SERVICEWORKER_UNREGISTER_RESOLVE_TO_BOOLEAN
-class UndefinedValue {
-public:
- typedef WebServiceWorkerRegistration WebType;
- static V8UndefinedType take(ScriptPromiseResolver* resolver, WebType* registration)
- {
- ASSERT(!registration); // Anything passed here will be leaked.
- return V8UndefinedType();
- }
- static void dispose(WebType* registration)
- {
- ASSERT(!registration); // Anything passed here will be leaked.
- }
-
-private:
- UndefinedValue();
-};
-#else
class BooleanValue {
public:
typedef bool WebType;
@@ -50,7 +32,6 @@ public:
private:
BooleanValue();
};
-#endif
static void deleteIfNoExistingOwner(WebServiceWorker* serviceWorker)
{
@@ -130,11 +111,7 @@ ScriptPromise ServiceWorkerRegistration::unregister(ScriptState* scriptState)
return promise;
}
-#ifdef DISABLE_SERVICEWORKER_UNREGISTER_RESOLVE_TO_BOOLEAN
- m_provider->unregisterServiceWorker(scopeURL, new CallbackPromiseAdapter<UndefinedValue, ServiceWorkerError>(resolver));
-#else
m_provider->unregisterServiceWorker(scopeURL, new CallbackPromiseAdapter<BooleanValue, ServiceWorkerError>(resolver));
-#endif
return promise;
}
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp ('k') | public/platform/WebServiceWorkerProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698