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

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

Issue 515083002: ServiceWorker: Change the return value of ServiceWorkerRegistration::unregister to boolean (1/4) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Apply 3-sided patch format Created 6 years, 4 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 f67669ca0e77c8ae39493c02ce92e7b2ea58dd8d..a7439ec3647a4cf1b76747eea4b4fa9b92c66d1a 100644
--- a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -37,6 +37,21 @@ private:
UndefinedValue();
};
+class BooleanValue {
+public:
+ typedef bool WebType;
+ static bool take(ScriptPromiseResolver* resolver, WebType* boolean)
+ {
+ return boolean;
nhiroki 2014/08/28 10:13:21 *boolean ?
shimazu 2014/08/29 07:07:07 Done.
+ }
+ static void dispose(WebType* boolean)
+ {
+ }
+
+private:
+ BooleanValue();
+};
+
static void deleteIfNoExistingOwner(WebServiceWorker* serviceWorker)
{
if (serviceWorker && !serviceWorker->proxy())
@@ -115,7 +130,11 @@ ScriptPromise ServiceWorkerRegistration::unregister(ScriptState* scriptState)
return promise;
}
+#ifdef SERVICEWORKER_UNREGISTER_DISABLE_NEW_FEATURE
m_provider->unregisterServiceWorker(scopeURL, new CallbackPromiseAdapter<UndefinedValue, ServiceWorkerError>(resolver));
+#else
+ m_provider->unregisterServiceWorker(scopeURL, new CallbackPromiseAdapter<BooleanValue, ServiceWorkerError>(resolver));
+#endif
return promise;
}

Powered by Google App Engine
This is Rietveld 408576698