Chromium Code Reviews| Index: blimp/engine/feature/geolocation/blimp_location_provider.h |
| diff --git a/blimp/engine/feature/geolocation/blimp_location_provider.h b/blimp/engine/feature/geolocation/blimp_location_provider.h |
| index 39372da41c5dda1edc1d186653844ac6a5bce41c..6d37a5229705644cdf757e70225ee9747a7d657f 100644 |
| --- a/blimp/engine/feature/geolocation/blimp_location_provider.h |
| +++ b/blimp/engine/feature/geolocation/blimp_location_provider.h |
| @@ -14,9 +14,12 @@ namespace blimp { |
| namespace engine { |
| // Location provider for Blimp using the device's provider over the network. |
| +// All calls made from BlimpLocationProvider involving |delegate_| must be |
| +// posted using |delegate_task_runner_|. |
|
Wez
2016/09/13 20:19:07
nit: This is part of the Delegate contract, so you
CJ
2016/09/13 23:34:02
Done.
|
| class BlimpLocationProvider : public device::LocationProvider { |
| public: |
| // A delegate that implements a subset of LocationProvider's functions. |
| + // All methods will be executed on |delegate_task_runner_|. |
| class Delegate { |
| public: |
| using GeopositionReceivedCallback = |
| @@ -31,7 +34,9 @@ class BlimpLocationProvider : public device::LocationProvider { |
| const GeopositionReceivedCallback& callback) = 0; |
| }; |
| - explicit BlimpLocationProvider(base::WeakPtr<Delegate> delegate); |
| + BlimpLocationProvider( |
| + base::WeakPtr<Delegate> delegate, |
| + scoped_refptr<base::SingleThreadTaskRunner> delegate_task_runner); |
|
Wez
2016/09/13 20:19:07
nit: Strictly a SequencedTaskRunner is sufficient
CJ
2016/09/13 23:34:02
Are you saying remove the scoped_refptr part?
Wez
2016/09/16 00:40:16
So, I'm saying you should accept a scoped_refptr<S
CJ
2016/09/16 22:55:53
Done.
|
| ~BlimpLocationProvider() override; |
| // device::LocationProvider implementation. |
| @@ -46,6 +51,8 @@ class BlimpLocationProvider : public device::LocationProvider { |
| // This delegate handles a subset of the LocationProvider functionality. |
| base::WeakPtr<Delegate> delegate_; |
| + scoped_refptr<base::SingleThreadTaskRunner> delegate_task_runner_; |
| + |
| device::Geoposition cached_position_; |
| // True if a successful StartProvider call has occured. |