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

Unified Diff: third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp

Issue 2651613002: Use a new Supplement constructor for ServiceWorkerRegistration supplements (Closed)
Patch Set: temp Created 3 years, 10 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: third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp
diff --git a/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp b/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp
index a868e620c069557d02a1306a46b99bb5371b932b..31d53e500da8d83f018adec042de00cdf0c002f3 100644
--- a/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp
+++ b/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp
@@ -55,10 +55,10 @@ class NotificationArray {
} // namespace
ServiceWorkerRegistrationNotifications::ServiceWorkerRegistrationNotifications(
- ExecutionContext* executionContext,
- ServiceWorkerRegistration* registration)
- : ContextLifecycleObserver(executionContext),
- m_registration(registration) {}
+ ServiceWorkerRegistration& registration,
+ ExecutionContext* executionContext)
+ : Supplement<ServiceWorkerRegistration>(registration),
+ ContextLifecycleObserver(executionContext) {}
ScriptPromise ServiceWorkerRegistrationNotifications::showNotification(
ScriptState* scriptState,
@@ -142,7 +142,6 @@ void ServiceWorkerRegistrationNotifications::contextDestroyed(
}
DEFINE_TRACE(ServiceWorkerRegistrationNotifications) {
- visitor->trace(m_registration);
visitor->trace(m_loaders);
Supplement<ServiceWorkerRegistration>::trace(visitor);
ContextLifecycleObserver::trace(visitor);
@@ -161,8 +160,8 @@ ServiceWorkerRegistrationNotifications::from(
Supplement<ServiceWorkerRegistration>::from(registration,
supplementName()));
if (!supplement) {
- supplement = new ServiceWorkerRegistrationNotifications(executionContext,
- &registration);
+ supplement = new ServiceWorkerRegistrationNotifications(registration,
+ executionContext);
provideTo(registration, supplementName(), supplement);
}
return *supplement;
@@ -193,7 +192,7 @@ void ServiceWorkerRegistrationNotifications::didLoadResources(
notificationManager->showPersistent(
WebSecurityOrigin(origin.get()), data, loader->getResources(),
- m_registration->webRegistration(), std::move(callbacks));
+ supplementable()->webRegistration(), std::move(callbacks));
m_loaders.remove(loader);
}

Powered by Google App Engine
This is Rietveld 408576698