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

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

Issue 476043002: ServiceWorker: Make '.ready' return a promise to be resolved with ServiceWorkerRegistration (1/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase on 478693005 (Ship Oilpan for serviceworkers/) 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 a87b1ae8e78be8c62eadbefc71be06251c36cbee..db855b7bf0e3f601f14dc7f476e8370d5ec6c1b4 100644
--- a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -76,11 +76,16 @@ void ServiceWorkerRegistration::setActive(WebServiceWorker* serviceWorker)
m_active = ServiceWorker::from(executionContext(), serviceWorker);
}
-ServiceWorkerRegistration* ServiceWorkerRegistration::take(ScriptPromiseResolver* resolver, WebType* registration)
+ServiceWorkerRegistration* ServiceWorkerRegistration::from(ExecutionContext* executionContext, WebType* registration)
{
if (!registration)
return 0;
- return getOrCreate(resolver->scriptState()->executionContext(), registration);
+ return getOrCreate(executionContext, registration);
+}
+
+ServiceWorkerRegistration* ServiceWorkerRegistration::take(ScriptPromiseResolver* resolver, WebType* registration)
+{
+ return from(resolver->scriptState()->executionContext(), registration);
}
void ServiceWorkerRegistration::dispose(WebType* registration)
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerRegistration.h ('k') | public/platform/WebServiceWorkerProviderClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698