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.
6 #include "modules/geofencing/WorkerNavigatorGeofencing.h"
8 #include "core/workers/WorkerNavigator.h"
9 #include "modules/geofencing/Geofencing.h"
13 WorkerNavigatorGeofencing::WorkerNavigatorGeofencing()
17 WorkerNavigatorGeofencing::~WorkerNavigatorGeofencing()
21 const char* WorkerNavigatorGeofencing::supplementName()
23 return "WorkerNavigatorGeofencing";
26 WorkerNavigatorGeofencing& WorkerNavigatorGeofencing::from(WorkerNavigator& navigator)
28 WorkerNavigatorGeofencing* supplement = static_cast<WorkerNavigatorGeofencing*>(WillBeHeapSupplement<WorkerNavigator>::from(navigator, supplementName()));
30 supplement = new WorkerNavigatorGeofencing();
31 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
36 Geofencing* WorkerNavigatorGeofencing::geofencing(WorkerNavigator& navigator)
38 return WorkerNavigatorGeofencing::from(navigator).geofencing();
41 Geofencing* WorkerNavigatorGeofencing::geofencing()
44 m_geofencing = Geofencing::create();
45 return m_geofencing.get();
48 void WorkerNavigatorGeofencing::trace(Visitor* visitor)
50 visitor->trace(m_geofencing);
51 WillBeHeapSupplement<WorkerNavigator>::trace(visitor);