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

Unified Diff: content/browser/geolocation/location_arbitrator_impl.h

Issue 2129313002: Geolocation cleanup: corrects uses of content::AccessTokenStore* and net::URLRequestContextGetter* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed StartTestStepFromClientThread() Created 4 years, 5 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/geolocation/location_arbitrator_impl.h
diff --git a/content/browser/geolocation/location_arbitrator_impl.h b/content/browser/geolocation/location_arbitrator_impl.h
index a3ccf168e88062675265a111889a37e6e391d23f..15902b6528ff1f54f5bdd488f7b62845ffaa894e 100644
--- a/content/browser/geolocation/location_arbitrator_impl.h
+++ b/content/browser/geolocation/location_arbitrator_impl.h
@@ -56,14 +56,12 @@ class CONTENT_EXPORT LocationArbitratorImpl : public LocationArbitrator {
bool HasPermissionBeenGranted() const override;
protected:
- AccessTokenStore* GetAccessTokenStore();
-
// These functions are useful for injection of dependencies in derived
// testing classes.
- virtual AccessTokenStore* NewAccessTokenStore();
+ virtual scoped_refptr<AccessTokenStore> NewAccessTokenStore();
virtual std::unique_ptr<LocationProvider> NewNetworkLocationProvider(
- AccessTokenStore* access_token_store,
- net::URLRequestContextGetter* context,
+ const scoped_refptr<AccessTokenStore>& access_token_store,
+ const scoped_refptr<net::URLRequestContextGetter>& context,
const GURL& url,
const base::string16& access_token);
virtual std::unique_ptr<LocationProvider> NewSystemLocationProvider();
@@ -72,6 +70,8 @@ class CONTENT_EXPORT LocationArbitratorImpl : public LocationArbitrator {
private:
friend class TestingLocationArbitrator;
+ scoped_refptr<AccessTokenStore> GetAccessTokenStore();
+
// Provider will either be added to |providers_| or
// deleted on error (e.g. it fails to start).
void RegisterProvider(std::unique_ptr<LocationProvider> provider);
@@ -79,7 +79,7 @@ class CONTENT_EXPORT LocationArbitratorImpl : public LocationArbitrator {
void RegisterSystemProvider();
void OnAccessTokenStoresLoaded(
AccessTokenStore::AccessTokenMap access_token_map,
- net::URLRequestContextGetter* context_getter);
+ const scoped_refptr<net::URLRequestContextGetter>& context_getter);
void DoStartProviders();
// Gets called when a provider has a new position.
@@ -101,8 +101,9 @@ class CONTENT_EXPORT LocationArbitratorImpl : public LocationArbitrator {
// The CancelableCallback will prevent OnAccessTokenStoresLoaded from being
// called multiple times by calling Reset() at the time of binding.
- base::CancelableCallback<void(AccessTokenStore::AccessTokenMap,
- net::URLRequestContextGetter*)>
+ base::CancelableCallback<void(
+ AccessTokenStore::AccessTokenMap,
+ const scoped_refptr<net::URLRequestContextGetter>&)>
token_store_callback_;
std::vector<std::unique_ptr<LocationProvider>> providers_;
bool enable_high_accuracy_;
@@ -120,7 +121,7 @@ class CONTENT_EXPORT LocationArbitratorImpl : public LocationArbitrator {
// Factory functions for the various types of location provider to abstract
// over the platform-dependent implementations.
-LocationProvider* NewSystemLocationProvider();
+std::unique_ptr<LocationProvider> NewSystemLocationProvider();
} // namespace content
« no previous file with comments | « content/browser/geolocation/fake_access_token_store.cc ('k') | content/browser/geolocation/location_arbitrator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698