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

Unified Diff: chrome/browser/geolocation/core_location_provider_mac.mm

Issue 6037016: Fix incorrect assertion following the move of Geolocation provider in to its own thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 12 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: chrome/browser/geolocation/core_location_provider_mac.mm
diff --git a/chrome/browser/geolocation/core_location_provider_mac.mm b/chrome/browser/geolocation/core_location_provider_mac.mm
index deb92c90d7130c6b50b8170e03123939b06b6823..dcef05d9842a36832fed8c7abd2d9ee971769665 100644
--- a/chrome/browser/geolocation/core_location_provider_mac.mm
+++ b/chrome/browser/geolocation/core_location_provider_mac.mm
@@ -9,7 +9,8 @@
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
-CoreLocationProviderMac::CoreLocationProviderMac() {
+CoreLocationProviderMac::CoreLocationProviderMac()
+ : is_updating_(false) {
data_provider_ = new CoreLocationDataProviderMac();
data_provider_->AddRef();
}
@@ -20,12 +21,18 @@ CoreLocationProviderMac::~CoreLocationProviderMac() {
}
bool CoreLocationProviderMac::StartProvider(bool high_accuracy) {
- data_provider_->StartUpdating(this);
+ // StartProvider maybe called multiple times (e.g. to update the high_accuracy hint)
bulach 2011/01/06 12:44:59 >80cols
+ // TODO(jknotten): Support high_accuracy hint in underlying data provider.
+ if (is_updating_)
+ return true;
+
+ is_updating_ = data_provider_->StartUpdating(this);
return true;
}
void CoreLocationProviderMac::StopProvider() {
data_provider_->StopUpdating();
+ is_updating_ = false;
}
void CoreLocationProviderMac::GetPosition(Geoposition* position) {
@@ -43,7 +50,7 @@ void CoreLocationProviderMac::SetPosition(Geoposition* position) {
}
LocationProviderBase* NewSystemLocationProvider() {
- if(CommandLine::ForCurrentProcess()
+ if (CommandLine::ForCurrentProcess()
bulach 2011/01/06 12:44:59 I think a more natural break would be: if (Command
->HasSwitch(switches::kExperimentalLocationFeatures)) {
return new CoreLocationProviderMac;
}

Powered by Google App Engine
This is Rietveld 408576698