| 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..f8ea1140d59a4668c21d472fd5b1878d518ff23d 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.
|
| @@ -41,6 +46,10 @@ class GeofencingProvider;
|
| // TODO(mek): Implement some kind of persistence of registrations.
|
| // TODO(mek): Limit the number of geofences that are registered with the
|
| // underlying GeofencingProvider.
|
| +// TODO(mek): Unregister a geofence when the ServiceWorkerRegistration it
|
| +// belongs to goes away.
|
| +// TODO(mek): If not included in the above, make sure a BrowserContext going
|
| +// away is also dealt with appropriately.
|
| class CONTENT_EXPORT GeofencingManager {
|
| public:
|
| typedef base::Callback<void(GeofencingStatus)> StatusCallback;
|
| @@ -92,6 +101,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 +139,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.
|
|
|