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

Unified Diff: Source/modules/geofencing/WorkerNavigatorGeofencing.cpp

Issue 464073002: Pass through geofencing API calls to the content layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix test expectations Created 6 years, 3 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: Source/modules/geofencing/WorkerNavigatorGeofencing.cpp
diff --git a/Source/modules/geofencing/WorkerNavigatorGeofencing.cpp b/Source/modules/geofencing/WorkerNavigatorGeofencing.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5b3928cd58aeec8a1690f1f8f5ec1b7a6c32e356
--- /dev/null
+++ b/Source/modules/geofencing/WorkerNavigatorGeofencing.cpp
@@ -0,0 +1,54 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "modules/geofencing/WorkerNavigatorGeofencing.h"
+
+#include "core/workers/WorkerNavigator.h"
+#include "modules/geofencing/Geofencing.h"
+
+namespace blink {
+
+WorkerNavigatorGeofencing::WorkerNavigatorGeofencing()
+{
+}
+
+WorkerNavigatorGeofencing::~WorkerNavigatorGeofencing()
+{
+}
+
+const char* WorkerNavigatorGeofencing::supplementName()
+{
+ return "WorkerNavigatorGeofencing";
+}
+
+WorkerNavigatorGeofencing& WorkerNavigatorGeofencing::from(WorkerNavigator& navigator)
+{
+ WorkerNavigatorGeofencing* supplement = static_cast<WorkerNavigatorGeofencing*>(WillBeHeapSupplement<WorkerNavigator>::from(navigator, supplementName()));
+ if (!supplement) {
+ supplement = new WorkerNavigatorGeofencing();
+ provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
+ }
+ return *supplement;
+}
+
+Geofencing* WorkerNavigatorGeofencing::geofencing(WorkerNavigator& navigator)
+{
+ return WorkerNavigatorGeofencing::from(navigator).geofencing();
+}
+
+Geofencing* WorkerNavigatorGeofencing::geofencing()
+{
+ if (!m_geofencing)
+ m_geofencing = Geofencing::create();
+ return m_geofencing.get();
+}
+
+void WorkerNavigatorGeofencing::trace(Visitor* visitor)
+{
+ visitor->trace(m_geofencing);
+ WillBeHeapSupplement<WorkerNavigator>::trace(visitor);
+}
+
+} // namespace blink
« no previous file with comments | « Source/modules/geofencing/WorkerNavigatorGeofencing.h ('k') | Source/modules/geofencing/WorkerNavigatorGeofencing.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698