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

Unified Diff: device/geolocation/geolocation_provider_impl.h

Issue 2226143002: Gets rid of the LocationArbitrator interface, in preference for LocationProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates LocationProviderBase derived classes. Created 4 years, 4 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: device/geolocation/geolocation_provider_impl.h
diff --git a/device/geolocation/geolocation_provider_impl.h b/device/geolocation/geolocation_provider_impl.h
index e092b8b27ee299cc57da0848d66330c10eb1edc7..8b65f3713b3432fc0baa2e2e28a107c5185f7d00 100644
--- a/device/geolocation/geolocation_provider_impl.h
+++ b/device/geolocation/geolocation_provider_impl.h
@@ -16,6 +16,7 @@
#include "device/geolocation/geolocation_export.h"
#include "device/geolocation/geolocation_provider.h"
#include "device/geolocation/geoposition.h"
+#include "device/geolocation/location_provider.h"
namespace base {
template <typename Type>
@@ -24,7 +25,6 @@ class SingleThreadTaskRunner;
}
namespace device {
-class LocationArbitrator;
class DEVICE_GEOLOCATION_EXPORT GeolocationProviderImpl
: public NON_EXPORTED_BASE(GeolocationProvider),
@@ -50,14 +50,16 @@ class DEVICE_GEOLOCATION_EXPORT GeolocationProviderImpl
return user_did_opt_into_location_services_;
}
+ // Useful for injecting mock geolocation arbitrator in tests.
Wez 2016/08/12 00:33:44 nit: This comment is not super helpful - caller ca
CJ 2016/08/12 20:22:46 Done.
+ void SetArbitratorForTesting(LocationProvider* arbitrator);
Wez 2016/08/12 00:33:44 Use unique_ptr<> here, so that it's clear that the
CJ 2016/08/12 20:22:46 Done.
+
protected:
Wez 2016/08/12 00:33:44 You can merge this with the private section, below
CJ 2016/08/12 20:22:46 Done.
friend struct base::DefaultSingletonTraits<GeolocationProviderImpl>;
GeolocationProviderImpl();
~GeolocationProviderImpl() override;
- // Useful for injecting mock geolocation arbitrator in tests.
- // TODO(mvanouwerkerk): Use something like SetArbitratorForTesting instead.
- virtual std::unique_ptr<LocationArbitrator> CreateArbitrator();
+ // Only to be used on the geolocation thread.
+ std::unique_ptr<LocationProvider> arbitrator_;
Wez 2016/08/12 00:33:44 Move this down to sit alongisde the other data mem
CJ 2016/08/12 20:22:46 Done.
private:
bool OnGeolocationThread() const;
@@ -93,9 +95,6 @@ class DEVICE_GEOLOCATION_EXPORT GeolocationProviderImpl
// True only in testing, where we want to use a custom position.
bool ignore_location_updates_;
- // Only to be used on the geolocation thread.
- std::unique_ptr<LocationArbitrator> arbitrator_;
-
// Used to PostTask()s from the geolocation thread to creation thread.
const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;

Powered by Google App Engine
This is Rietveld 408576698