Chromium Code Reviews| Index: chrome/browser/geolocation/core_location_data_provider_mac.mm |
| diff --git a/chrome/browser/geolocation/core_location_data_provider_mac.mm b/chrome/browser/geolocation/core_location_data_provider_mac.mm |
| index b20230e9ba8332e7d9759c593b8de8216d97a514..417c91b4143f0591b232f8084cb1a776814d1b86 100644 |
| --- a/chrome/browser/geolocation/core_location_data_provider_mac.mm |
| +++ b/chrome/browser/geolocation/core_location_data_provider_mac.mm |
| @@ -11,6 +11,7 @@ |
| #include "chrome/browser/geolocation/core_location_data_provider_mac.h" |
| #include "chrome/browser/geolocation/core_location_provider_mac.h" |
| +#include "chrome/browser/geolocation/geolocation_provider.h" |
| #include "base/logging.h" |
| #include "base/time.h" |
| @@ -183,9 +184,9 @@ enum { |
| @end |
| CoreLocationDataProviderMac::CoreLocationDataProviderMac() { |
| - if(!BrowserThread::GetCurrentThreadIdentifier(&origin_thread_id_)) |
| + if(MessageLoop::current() != GeolocationProvider::GetInstance()->message_loop()) |
|
bulach
2011/01/06 12:44:59
nit:space after if, and >80cols
if (MessageLoop::
|
| NOTREACHED() << |
| - "CoreLocation data provider must be created in a valid BrowserThread."; |
| + "CoreLocation data provider must be created on the Geolocation thread."; |
|
bulach
2011/01/06 12:44:59
nit: >80cols.
|
| provider_ = NULL; |
| wrapper_.reset([[CoreLocationWrapperMac alloc] initWithDataProvider:this]); |
| } |
| @@ -194,7 +195,7 @@ CoreLocationDataProviderMac::~CoreLocationDataProviderMac() { |
| } |
| // Returns true if the CoreLocation wrapper can load the framework and |
| -// location services are enabled. The pointer argument will only be accessed |
| +// location services are enabled. The pointer toargument will only be accessed |
|
bulach
2011/01/06 12:44:59
s/to//
|
| // in the origin thread. |
| bool CoreLocationDataProviderMac:: |
| StartUpdating(CoreLocationProviderMac* provider) { |
| @@ -216,7 +217,7 @@ void CoreLocationDataProviderMac::StopUpdating() { |
| } |
| void CoreLocationDataProviderMac::UpdatePosition(Geoposition *position) { |
| - BrowserThread::PostTask(origin_thread_id_, FROM_HERE, |
| + GeolocationProvider::GetInstance()->message_loop()->PostTask(FROM_HERE, |
| NewRunnableMethod(this, |
| &CoreLocationDataProviderMac::PositionUpdated, |
| *position)); |
| @@ -235,7 +236,7 @@ void CoreLocationDataProviderMac::StopUpdatingTask() { |
| } |
| void CoreLocationDataProviderMac::PositionUpdated(Geoposition position) { |
| - DCHECK(BrowserThread::CurrentlyOn(origin_thread_id_)); |
| + DCHECK(MessageLoop::current() == GeolocationProvider::GetInstance()->message_loop()); |
|
bulach
2011/01/06 12:44:59
nit: >80cols
|
| if(provider_) |
| provider_->SetPosition(&position); |
| } |