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

Unified Diff: blimp/client/core/geolocation/geolocation_feature.cc

Issue 2331513002: Checks to see if the position is valid before OnLocationUpdate call. (Closed)
Patch Set: Fixes up tests. Created 4 years, 3 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 | « no previous file | blimp/client/core/geolocation/geolocation_feature_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/core/geolocation/geolocation_feature.cc
diff --git a/blimp/client/core/geolocation/geolocation_feature.cc b/blimp/client/core/geolocation/geolocation_feature.cc
index 201a9a0eca4a9037471cda4692ad8a023a8ed837..eee30a65349f059a29015ae84f535e9aca4e2d73 100644
--- a/blimp/client/core/geolocation/geolocation_feature.cc
+++ b/blimp/client/core/geolocation/geolocation_feature.cc
@@ -143,11 +143,11 @@ void GeolocationFeature::SendGeolocationErrorMessage(
void GeolocationFeature::OnSendComplete(int result) {
am_sending_message_ = false;
- if (need_to_send_message_) {
- need_to_send_message_ = false;
- OnLocationUpdate(location_provider_.get(),
- location_provider_->GetPosition());
+ device::Geoposition new_position = location_provider_->GetPosition();
+ if (need_to_send_message_ && new_position.Validate()) {
Wez 2016/09/13 20:26:08 Hmmm, actually isn't Validate() a proxy for whethe
CJ 2016/09/13 22:45:22 It has to be this way because even if the Location
Wez 2016/09/16 01:20:27 But will we see an OnSendComplete() in that case?
CJ 2016/09/16 18:27:12 There's that race case. A Stop message gets receiv
+ OnLocationUpdate(location_provider_.get(), new_position);
}
+ need_to_send_message_ = false;
}
} // namespace client
« no previous file with comments | « no previous file | blimp/client/core/geolocation/geolocation_feature_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698