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

Unified Diff: Source/modules/serviceworkers/ServiceWorkerContainer.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/ServiceWorkerContainer.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
index a34f7748184e6c31e2d037b800df954a000843ca..d2ce8c6af97146b56ccf7319dfd1094ee47faa68 100644
--- a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
@@ -124,24 +124,6 @@ ScriptPromise ServiceWorkerContainer::registerServiceWorker(ScriptState* scriptS
return promise;
}
-#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;
@@ -154,7 +136,6 @@ public:
private:
BooleanValue();
};
-#endif
ScriptPromise ServiceWorkerContainer::unregisterServiceWorker(ScriptState* scriptState, const String& pattern)
{
@@ -182,11 +163,7 @@ ScriptPromise ServiceWorkerContainer::unregisterServiceWorker(ScriptState* scrip
resolver->reject(DOMException::create(SecurityError, "The scope must match the current origin."));
return promise;
}
-#ifdef DISABLE_SERVICEWORKER_UNREGISTER_RESOLVE_TO_BOOLEAN
- m_provider->unregisterServiceWorker(patternURL, new CallbackPromiseAdapter<UndefinedValue, ServiceWorkerError>(resolver));
-#else
m_provider->unregisterServiceWorker(patternURL, new CallbackPromiseAdapter<BooleanValue, ServiceWorkerError>(resolver));
-#endif
return promise;
}
« no previous file with comments | « LayoutTests/http/tests/serviceworker/unregister.html ('k') | Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698