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

Side by Side Diff: content/browser/geolocation/location_arbitrator_impl.cc

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: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/browser/geolocation/location_arbitrator_impl.h" 5 #include "content/browser/geolocation/location_arbitrator_impl.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 DCHECK(new_position.Validate() || 134 DCHECK(new_position.Validate() ||
135 new_position.error_code != Geoposition::ERROR_CODE_NONE); 135 new_position.error_code != Geoposition::ERROR_CODE_NONE);
136 if (!IsNewPositionBetter(position_, new_position, 136 if (!IsNewPositionBetter(position_, new_position,
137 provider == position_provider_)) 137 provider == position_provider_))
138 return; 138 return;
139 position_provider_ = provider; 139 position_provider_ = provider;
140 position_ = new_position; 140 position_ = new_position;
141 arbitrator_update_callback_.Run(position_); 141 arbitrator_update_callback_.Run(position_);
142 } 142 }
143 143
144 AccessTokenStore* LocationArbitratorImpl::NewAccessTokenStore() { 144 scoped_refptr<AccessTokenStore> LocationArbitratorImpl::NewAccessTokenStore() {
145 return delegate_->CreateAccessTokenStore(); 145 return delegate_->CreateAccessTokenStore();
146 } 146 }
147 147
148 AccessTokenStore* LocationArbitratorImpl::GetAccessTokenStore() { 148 AccessTokenStore* LocationArbitratorImpl::GetAccessTokenStore() {
149 if (!access_token_store_.get()) 149 if (!access_token_store_.get())
150 access_token_store_ = NewAccessTokenStore(); 150 access_token_store_ = NewAccessTokenStore();
151 return access_token_store_.get(); 151 return access_token_store_.get();
Wez 2016/07/12 21:55:47 Update this to if (!access_token_store_) ...
mcasas 2016/07/15 22:45:53 Done.
152 } 152 }
153 153
154 std::unique_ptr<LocationProvider> 154 std::unique_ptr<LocationProvider>
155 LocationArbitratorImpl::NewNetworkLocationProvider( 155 LocationArbitratorImpl::NewNetworkLocationProvider(
156 AccessTokenStore* access_token_store, 156 AccessTokenStore* access_token_store,
157 net::URLRequestContextGetter* context, 157 net::URLRequestContextGetter* context,
158 const GURL& url, 158 const GURL& url,
159 const base::string16& access_token) { 159 const base::string16& access_token) {
160 #if defined(OS_ANDROID) 160 #if defined(OS_ANDROID)
161 // Android uses its own SystemLocationProvider. 161 // Android uses its own SystemLocationProvider.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 203 }
204 } 204 }
205 return false; 205 return false;
206 } 206 }
207 207
208 bool LocationArbitratorImpl::HasPermissionBeenGranted() const { 208 bool LocationArbitratorImpl::HasPermissionBeenGranted() const {
209 return is_permission_granted_; 209 return is_permission_granted_;
210 } 210 }
211 211
212 } // namespace content 212 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698