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

Unified Diff: device/geolocation/geolocation_service_impl.cc

Issue 2866003002: Use OnceCallback on Mojo interfaces in //device/geolocation (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « device/geolocation/geolocation_service_impl.h ('k') | device/geolocation/public/interfaces/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/geolocation/geolocation_service_impl.cc
diff --git a/device/geolocation/geolocation_service_impl.cc b/device/geolocation/geolocation_service_impl.cc
index 357d9cd9fcf1b2bc383f492ccef6eea16c7349c9..ebc145dc3a7790e2c1b0beab7d8d9461a820965f 100644
--- a/device/geolocation/geolocation_service_impl.cc
+++ b/device/geolocation/geolocation_service_impl.cc
@@ -118,14 +118,14 @@ void GeolocationServiceImpl::SetHighAccuracy(bool high_accuracy) {
}
void GeolocationServiceImpl::QueryNextPosition(
- const QueryNextPositionCallback& callback) {
+ QueryNextPositionCallback callback) {
if (!position_callback_.is_null()) {
DVLOG(1) << "Overlapped call to QueryNextPosition!";
OnConnectionError(); // Simulate a connection error.
return;
}
- position_callback_ = callback;
+ position_callback_ = std::move(callback);
if (has_position_to_report_)
ReportCurrentPosition();
@@ -178,8 +178,7 @@ void GeolocationServiceImpl::OnLocationUpdate(const Geoposition& position) {
}
void GeolocationServiceImpl::ReportCurrentPosition() {
- position_callback_.Run(current_position_.Clone());
- position_callback_.Reset();
+ std::move(position_callback_).Run(current_position_.Clone());
has_position_to_report_ = false;
}
« no previous file with comments | « device/geolocation/geolocation_service_impl.h ('k') | device/geolocation/public/interfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698