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

Unified Diff: Source/modules/geolocation/Geolocation.cpp

Issue 375353002: Add the first very basic bits of a geofencing API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 6 years, 5 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/geolocation/Geolocation.cpp
diff --git a/Source/modules/geolocation/Geolocation.cpp b/Source/modules/geolocation/Geolocation.cpp
index 99035aa0297e45d985b8d1567330db5789db6ab1..57437ed10d06c6130250e17a617eddbfe482cd52 100644
--- a/Source/modules/geolocation/Geolocation.cpp
+++ b/Source/modules/geolocation/Geolocation.cpp
@@ -28,8 +28,12 @@
#include "config.h"
#include "modules/geolocation/Geolocation.h"
+#include "bindings/core/v8/ScriptPromiseResolver.h"
+#include "bindings/core/v8/ScriptState.h"
+#include "core/dom/DOMError.h"
#include "core/dom/Document.h"
#include "modules/geolocation/Coordinates.h"
+#include "modules/geolocation/GeofencingRegion.h"
#include "modules/geolocation/GeolocationController.h"
#include "modules/geolocation/GeolocationError.h"
#include "modules/geolocation/GeolocationPosition.h"
@@ -681,4 +685,34 @@ void Geolocation::handlePendingPermissionNotifiers()
}
}
+ScriptPromise Geolocation::registerRegion(ScriptState* scriptState, GeofencingRegion* region)
+{
+ RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
+ ScriptPromise promise = resolver->promise();
+
+ resolver->reject(DOMError::create(NotSupportedError));
+
+ return promise;
Peter Beverloo 2014/07/10 13:17:28 Could just use the ScriptPromise class here (dito
Marijn Kruisselbrink 2014/07/10 15:11:01 Done. Although I'll probably have to change this b
+}
+
+ScriptPromise Geolocation::deregisterRegion(ScriptState* scriptState, const String& regionId)
+{
+ RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
+ ScriptPromise promise = resolver->promise();
+
+ resolver->reject(DOMError::create(NotSupportedError));
+
+ return promise;
+}
+
+ScriptPromise Geolocation::getRegisteredRegions(ScriptState* scriptState)
+{
+ RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
+ ScriptPromise promise = resolver->promise();
+
+ resolver->reject(DOMError::create(NotSupportedError));
+
+ return promise;
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698