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

Unified Diff: content/browser/geofencing/geofencing_manager.h

Issue 629393002: Chromium side of geofencing event dispatching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@geofencing_serviceworker
Patch Set: rebase Created 6 years, 2 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: content/browser/geofencing/geofencing_manager.h
diff --git a/content/browser/geofencing/geofencing_manager.h b/content/browser/geofencing/geofencing_manager.h
index cae5edd3be778c975885070211c0fec0ed68e377..aec658a95372ee14fa8d011312d4f9c0f9230cfe 100644
--- a/content/browser/geofencing/geofencing_manager.h
+++ b/content/browser/geofencing/geofencing_manager.h
@@ -11,9 +11,12 @@
#include "base/callback_forward.h"
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "content/browser/service_worker/service_worker_storage.h"
#include "content/common/content_export.h"
#include "content/common/geofencing_status.h"
+#include "content/common/service_worker/service_worker_status_code.h"
template <typename T>
struct DefaultSingletonTraits;
@@ -27,6 +30,8 @@ namespace content {
class BrowserContext;
class GeofencingProvider;
+class ServiceWorkerContextWrapper;
+class ServiceWorkerRegistration;
// This is the main API to the geofencing subsystem. The application will hold
// a single instance of this class.
@@ -92,6 +97,10 @@ class CONTENT_EXPORT GeofencingManager {
const GURL& service_worker_origin,
std::map<std::string, blink::WebCircularGeofencingRegion>* regions);
+ // To be called by GeofencingProvider
+ void RegionEntered(int provider_id);
+ void RegionExited(int provider_id);
+
void SetProviderForTests(scoped_ptr<GeofencingProvider> provider);
protected:
@@ -126,6 +135,12 @@ class CONTENT_EXPORT GeofencingManager {
// Clears a registration.
void ClearRegistration(const RegistrationKey& key);
+ // Finds a registration given the ID it is registered with by the provider.
+ Registration* FindRegistrationByProviderId(int provider_id);
+
+ void DispatchGeofencingEvent(blink::WebGeofencingEventType event_type,
+ int provider_id);
+
// List of all currently registered geofences.
// TODO(mek): Better way of storing these that allows more efficient lookup
// and deletion.

Powered by Google App Engine
This is Rietveld 408576698