OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "config.h" | |
6 #include "modules/geofencing/WorkerNavigatorGeofencing.h" | |
7 | |
8 #include "core/workers/WorkerNavigator.h" | |
9 #include "modules/geofencing/Geofencing.h" | |
10 | |
11 namespace blink { | |
12 | |
13 WorkerNavigatorGeofencing::WorkerNavigatorGeofencing() | |
14 { | |
15 } | |
16 | |
17 WorkerNavigatorGeofencing::~WorkerNavigatorGeofencing() | |
18 { | |
19 } | |
20 | |
21 const char* WorkerNavigatorGeofencing::supplementName() | |
22 { | |
23 return "WorkerNavigatorGeofencing"; | |
24 } | |
25 | |
26 WorkerNavigatorGeofencing& WorkerNavigatorGeofencing::from(WorkerNavigator& navi gator) | |
27 { | |
28 WorkerNavigatorGeofencing* supplement = static_cast<WorkerNavigatorGeofencin g*>(WillBeHeapSupplement<WorkerNavigator>::from(navigator, supplementName())); | |
29 if (!supplement) { | |
30 supplement = new WorkerNavigatorGeofencing(); | |
31 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement)); | |
32 } | |
33 return *supplement; | |
34 } | |
35 | |
36 Geofencing* WorkerNavigatorGeofencing::geofencing(WorkerNavigator& navigator) | |
37 { | |
38 return WorkerNavigatorGeofencing::from(navigator).geofencing(); | |
esprehn
2014/08/19 01:15:59
reference?
Marijn Kruisselbrink
2014/08/19 18:55:14
Doesn't the generated bindings code expect this to
| |
39 } | |
40 | |
41 Geofencing* WorkerNavigatorGeofencing::geofencing() | |
42 { | |
43 if (!m_geofencing) | |
44 m_geofencing = Geofencing::create(); | |
45 return m_geofencing.get(); | |
esprehn
2014/08/19 01:15:59
Return a reference?
Marijn Kruisselbrink
2014/08/19 18:55:14
Doesn't the generated bindings code expect the sta
| |
46 } | |
47 | |
48 void WorkerNavigatorGeofencing::trace(Visitor* visitor) | |
49 { | |
50 visitor->trace(m_geofencing); | |
51 WillBeHeapSupplement<WorkerNavigator>::trace(visitor); | |
52 } | |
53 | |
54 } // namespace blink | |
OLD | NEW |