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

Unified Diff: third_party/WebKit/Source/modules/background_sync/ServiceWorkerRegistrationSync.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/background_sync/ServiceWorkerRegistrationSync.cpp
diff --git a/third_party/WebKit/Source/modules/background_sync/ServiceWorkerRegistrationSync.cpp b/third_party/WebKit/Source/modules/background_sync/ServiceWorkerRegistrationSync.cpp
index 1e5292773eb6b909db1c8720c6ac83d67aaec246..a3ceba1c7caf79a15bf746097400ded8bcc44960 100644
--- a/third_party/WebKit/Source/modules/background_sync/ServiceWorkerRegistrationSync.cpp
+++ b/third_party/WebKit/Source/modules/background_sync/ServiceWorkerRegistrationSync.cpp
@@ -10,8 +10,8 @@
namespace blink {
ServiceWorkerRegistrationSync::ServiceWorkerRegistrationSync(
- ServiceWorkerRegistration* registration)
- : m_registration(registration) {}
+ ServiceWorkerRegistration& registration)
+ : Supplement<ServiceWorkerRegistration>(registration) {}
ServiceWorkerRegistrationSync::~ServiceWorkerRegistrationSync() {}
@@ -26,7 +26,7 @@ ServiceWorkerRegistrationSync& ServiceWorkerRegistrationSync::from(
Supplement<ServiceWorkerRegistration>::from(registration,
supplementName()));
if (!supplement) {
- supplement = new ServiceWorkerRegistrationSync(&registration);
+ supplement = new ServiceWorkerRegistrationSync(registration);
provideTo(registration, supplementName(), supplement);
}
return *supplement;
@@ -39,12 +39,11 @@ SyncManager* ServiceWorkerRegistrationSync::sync(
SyncManager* ServiceWorkerRegistrationSync::sync() {
if (!m_syncManager)
- m_syncManager = SyncManager::create(m_registration);
+ m_syncManager = SyncManager::create(supplementable());
return m_syncManager.get();
}
DEFINE_TRACE(ServiceWorkerRegistrationSync) {
- visitor->trace(m_registration);
visitor->trace(m_syncManager);
Supplement<ServiceWorkerRegistration>::trace(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698