| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_CHILD_GEOFENCING_GEOFENCING_DISPATCHER_H_ | 5 #ifndef CONTENT_CHILD_GEOFENCING_GEOFENCING_DISPATCHER_H_ |
| 6 #define CONTENT_CHILD_GEOFENCING_GEOFENCING_DISPATCHER_H_ | 6 #define CONTENT_CHILD_GEOFENCING_GEOFENCING_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 class GeofencingDispatcher : public WorkerTaskRunner::Observer { | 27 class GeofencingDispatcher : public WorkerTaskRunner::Observer { |
| 28 public: | 28 public: |
| 29 explicit GeofencingDispatcher(ThreadSafeSender* sender); | 29 explicit GeofencingDispatcher(ThreadSafeSender* sender); |
| 30 ~GeofencingDispatcher() override; | 30 ~GeofencingDispatcher() override; |
| 31 | 31 |
| 32 bool Send(IPC::Message* msg); | 32 bool Send(IPC::Message* msg); |
| 33 void OnMessageReceived(const IPC::Message& msg); | 33 void OnMessageReceived(const IPC::Message& msg); |
| 34 | 34 |
| 35 // Corresponding to WebGeofencingProvider methods. | 35 // Corresponding to WebGeofencingProvider methods. |
| 36 void RegisterRegion(const blink::WebString& region_id, | 36 void RegisterRegion( |
| 37 const blink::WebCircularGeofencingRegion& region, | 37 const blink::WebString& region_id, |
| 38 blink::WebGeofencingCallbacks* callbacks); | 38 const blink::WebCircularGeofencingRegion& region, |
| 39 void UnregisterRegion(const blink::WebString& region_id, | 39 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 40 blink::WebGeofencingCallbacks* callbacks); | 40 blink::WebGeofencingCallbacks* callbacks); |
| 41 void GetRegisteredRegions(blink::WebGeofencingRegionsCallbacks* callbacks); | 41 void UnregisterRegion( |
| 42 const blink::WebString& region_id, |
| 43 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 44 blink::WebGeofencingCallbacks* callbacks); |
| 45 void GetRegisteredRegions( |
| 46 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 47 blink::WebGeofencingRegionsCallbacks* callbacks); |
| 42 | 48 |
| 43 // |thread_safe_sender| needs to be passed in because if the call leads to | 49 // |thread_safe_sender| needs to be passed in because if the call leads to |
| 44 // construction it will be needed. | 50 // construction it will be needed. |
| 45 static GeofencingDispatcher* GetOrCreateThreadSpecificInstance( | 51 static GeofencingDispatcher* GetOrCreateThreadSpecificInstance( |
| 46 ThreadSafeSender* thread_safe_sender); | 52 ThreadSafeSender* thread_safe_sender); |
| 47 | 53 |
| 48 // Unlike GetOrCreateThreadSpecificInstance() this doesn't create a new | 54 // Unlike GetOrCreateThreadSpecificInstance() this doesn't create a new |
| 49 // instance if thread-local instance doesn't exist. | 55 // instance if thread-local instance doesn't exist. |
| 50 static GeofencingDispatcher* GetThreadSpecificInstance(); | 56 static GeofencingDispatcher* GetThreadSpecificInstance(); |
| 51 | 57 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 72 region_unregistration_requests_; | 78 region_unregistration_requests_; |
| 73 IDMap<blink::WebGeofencingRegionsCallbacks, IDMapOwnPointer> | 79 IDMap<blink::WebGeofencingRegionsCallbacks, IDMapOwnPointer> |
| 74 get_registered_regions_requests_; | 80 get_registered_regions_requests_; |
| 75 | 81 |
| 76 DISALLOW_COPY_AND_ASSIGN(GeofencingDispatcher); | 82 DISALLOW_COPY_AND_ASSIGN(GeofencingDispatcher); |
| 77 }; | 83 }; |
| 78 | 84 |
| 79 } // namespace content | 85 } // namespace content |
| 80 | 86 |
| 81 #endif // CONTENT_CHILD_GEOFENCING_GEOFENCING_DISPATCHER_H_ | 87 #endif // CONTENT_CHILD_GEOFENCING_GEOFENCING_DISPATCHER_H_ |
| OLD | NEW |