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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentAppServiceWorkerRegistration.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/payments/PaymentAppServiceWorkerRegistration.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentAppServiceWorkerRegistration.cpp b/third_party/WebKit/Source/modules/payments/PaymentAppServiceWorkerRegistration.cpp
index 292b7117034f9a38801f846f9015b36629f79e1b..2fe0adb62f20ff278f3cd9f28378f78374c91a50 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentAppServiceWorkerRegistration.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentAppServiceWorkerRegistration.cpp
@@ -22,7 +22,7 @@ PaymentAppServiceWorkerRegistration& PaymentAppServiceWorkerRegistration::from(
supplementName()));
if (!supplement) {
- supplement = new PaymentAppServiceWorkerRegistration(&registration);
+ supplement = new PaymentAppServiceWorkerRegistration(registration);
provideTo(registration, supplementName(), supplement);
}
@@ -40,20 +40,19 @@ PaymentAppManager* PaymentAppServiceWorkerRegistration::paymentAppManager(
PaymentAppManager* PaymentAppServiceWorkerRegistration::paymentAppManager(
ScriptState* scriptState) {
if (!m_paymentAppManager) {
- m_paymentAppManager = PaymentAppManager::create(m_registration);
+ m_paymentAppManager = PaymentAppManager::create(supplementable());
}
return m_paymentAppManager.get();
}
DEFINE_TRACE(PaymentAppServiceWorkerRegistration) {
- visitor->trace(m_registration);
visitor->trace(m_paymentAppManager);
Supplement<ServiceWorkerRegistration>::trace(visitor);
}
PaymentAppServiceWorkerRegistration::PaymentAppServiceWorkerRegistration(
- ServiceWorkerRegistration* registration)
- : m_registration(registration) {}
+ ServiceWorkerRegistration& registration)
+ : Supplement<ServiceWorkerRegistration>(registration) {}
// static
const char* PaymentAppServiceWorkerRegistration::supplementName() {

Powered by Google App Engine
This is Rietveld 408576698