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

Side by Side Diff: third_party/WebKit/Source/modules/geofencing/ServiceWorkerRegistrationGeofencing.cpp

Issue 1846913009: HeapSupplements are now just Supplements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/geofencing/ServiceWorkerRegistrationGeofencing.h" 5 #include "modules/geofencing/ServiceWorkerRegistrationGeofencing.h"
6 6
7 #include "modules/geofencing/Geofencing.h" 7 #include "modules/geofencing/Geofencing.h"
8 #include "modules/serviceworkers/ServiceWorkerRegistration.h" 8 #include "modules/serviceworkers/ServiceWorkerRegistration.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 ServiceWorkerRegistrationGeofencing::ServiceWorkerRegistrationGeofencing(Service WorkerRegistration* registration) 12 ServiceWorkerRegistrationGeofencing::ServiceWorkerRegistrationGeofencing(Service WorkerRegistration* registration)
13 : m_registration(registration) 13 : m_registration(registration)
14 { 14 {
15 } 15 }
16 16
17 ServiceWorkerRegistrationGeofencing::~ServiceWorkerRegistrationGeofencing() 17 ServiceWorkerRegistrationGeofencing::~ServiceWorkerRegistrationGeofencing()
18 { 18 {
19 } 19 }
20 20
21 const char* ServiceWorkerRegistrationGeofencing::supplementName() 21 const char* ServiceWorkerRegistrationGeofencing::supplementName()
22 { 22 {
23 return "ServiceWorkerRegistrationGeofencing"; 23 return "ServiceWorkerRegistrationGeofencing";
24 } 24 }
25 25
26 ServiceWorkerRegistrationGeofencing& ServiceWorkerRegistrationGeofencing::from(S erviceWorkerRegistration& registration) 26 ServiceWorkerRegistrationGeofencing& ServiceWorkerRegistrationGeofencing::from(S erviceWorkerRegistration& registration)
27 { 27 {
28 ServiceWorkerRegistrationGeofencing* supplement = static_cast<ServiceWorkerR egistrationGeofencing*>(HeapSupplement<ServiceWorkerRegistration>::from(registra tion, supplementName())); 28 ServiceWorkerRegistrationGeofencing* supplement = static_cast<ServiceWorkerR egistrationGeofencing*>(Supplement<ServiceWorkerRegistration>::from(registration , supplementName()));
29 if (!supplement) { 29 if (!supplement) {
30 supplement = new ServiceWorkerRegistrationGeofencing(&registration); 30 supplement = new ServiceWorkerRegistrationGeofencing(&registration);
31 provideTo(registration, supplementName(), supplement); 31 provideTo(registration, supplementName(), supplement);
32 } 32 }
33 return *supplement; 33 return *supplement;
34 } 34 }
35 35
36 Geofencing* ServiceWorkerRegistrationGeofencing::geofencing(ServiceWorkerRegistr ation& registration) 36 Geofencing* ServiceWorkerRegistrationGeofencing::geofencing(ServiceWorkerRegistr ation& registration)
37 { 37 {
38 return ServiceWorkerRegistrationGeofencing::from(registration).geofencing(); 38 return ServiceWorkerRegistrationGeofencing::from(registration).geofencing();
39 } 39 }
40 40
41 Geofencing* ServiceWorkerRegistrationGeofencing::geofencing() 41 Geofencing* ServiceWorkerRegistrationGeofencing::geofencing()
42 { 42 {
43 if (!m_geofencing) 43 if (!m_geofencing)
44 m_geofencing = Geofencing::create(m_registration); 44 m_geofencing = Geofencing::create(m_registration);
45 return m_geofencing.get(); 45 return m_geofencing.get();
46 } 46 }
47 47
48 DEFINE_TRACE(ServiceWorkerRegistrationGeofencing) 48 DEFINE_TRACE(ServiceWorkerRegistrationGeofencing)
49 { 49 {
50 visitor->trace(m_registration); 50 visitor->trace(m_registration);
51 visitor->trace(m_geofencing); 51 visitor->trace(m_geofencing);
52 HeapSupplement<ServiceWorkerRegistration>::trace(visitor); 52 Supplement<ServiceWorkerRegistration>::trace(visitor);
53 } 53 }
54 54
55 } // namespace blink 55 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698