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

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: fix win build 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..2c8038eb4969bf72c97af4f54456fce111e32806 100644
--- a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -95,11 +95,16 @@ void ServiceWorkerRegistration::setActive(WebServiceWorker* serviceWorker)
m_active = ServiceWorker::from(executionContext(), serviceWorker);
}
-PassRefPtrWillBeRawPtr<ServiceWorkerRegistration> ServiceWorkerRegistration::take(ScriptPromiseResolver* resolver, WebType* registration)
+PassRefPtrWillBeRawPtr<ServiceWorkerRegistration> ServiceWorkerRegistration::from(ExecutionContext* executionContext, WebType* registration)
{
if (!registration)
return nullptr;
- return getOrCreate(resolver->scriptState()->executionContext(), registration);
+ return getOrCreate(executionContext, registration);
+}
+
+PassRefPtrWillBeRawPtr<ServiceWorkerRegistration> ServiceWorkerRegistration::take(ScriptPromiseResolver* resolver, WebType* registration)
+{
+ return from(resolver->scriptState()->executionContext(), registration);
}
void ServiceWorkerRegistration::dispose(WebType* registration)

Powered by Google App Engine
This is Rietveld 408576698