Index: content/browser/geolocation/location_api_adapter_android.cc |
diff --git a/content/browser/geolocation/location_api_adapter_android.cc b/content/browser/geolocation/location_api_adapter_android.cc |
index a78cae228cfbb7cb64f3eb851212cfc2240c2d02..84cfd101fd335bc9acc8e09e034c75b5986d1e9a 100644 |
--- a/content/browser/geolocation/location_api_adapter_android.cc |
+++ b/content/browser/geolocation/location_api_adapter_android.cc |
@@ -8,7 +8,6 @@ |
#include "base/android/jni_string.h" |
#include "base/bind.h" |
#include "base/location.h" |
-#include "base/thread_task_runner_handle.h" |
#include "content/browser/geolocation/location_provider_android.h" |
#include "jni/LocationProviderAdapter_jni.h" |
@@ -42,7 +41,7 @@ AndroidLocationApiAdapter::AndroidLocationApiAdapter() |
AndroidLocationApiAdapter::~AndroidLocationApiAdapter() { |
CHECK(!location_provider_); |
- CHECK(!task_runner_.get()); |
+ CHECK(!message_loop_.get()); |
CHECK(java_location_provider_android_object_.is_null()); |
} |
@@ -55,14 +54,14 @@ bool AndroidLocationApiAdapter::Start( |
CreateJavaObject(env); |
{ |
base::AutoLock lock(lock_); |
- CHECK(!task_runner_.get()); |
- task_runner_ = base::ThreadTaskRunnerHandle::Get(); |
+ CHECK(!message_loop_.get()); |
+ message_loop_ = base::MessageLoopProxy::current(); |
} |
} |
// At this point we should have all our pre-conditions ready, and they'd only |
// change in Stop() which must be called on the same thread as here. |
CHECK(location_provider_); |
- CHECK(task_runner_.get()); |
+ CHECK(message_loop_.get()); |
CHECK(!java_location_provider_android_object_.is_null()); |
// We'll start receiving notifications from java in the main thread looper |
// until Stop() is called. |
@@ -72,14 +71,14 @@ bool AndroidLocationApiAdapter::Start( |
void AndroidLocationApiAdapter::Stop() { |
if (!location_provider_) { |
- CHECK(!task_runner_.get()); |
+ CHECK(!message_loop_.get()); |
CHECK(java_location_provider_android_object_.is_null()); |
return; |
} |
{ |
base::AutoLock lock(lock_); |
- task_runner_ = NULL; |
+ message_loop_ = NULL; |
} |
location_provider_ = NULL; |
@@ -95,7 +94,7 @@ void AndroidLocationApiAdapter::NotifyProviderNewGeoposition( |
const Geoposition& geoposition) { |
// Called on the geolocation thread, safe to access location_provider_ here. |
if (GetInstance()->location_provider_) { |
- CHECK(GetInstance()->task_runner_->BelongsToCurrentThread()); |
+ CHECK(GetInstance()->message_loop_->BelongsToCurrentThread()); |
GetInstance()->location_provider_->NotifyNewGeoposition(geoposition); |
} |
} |
@@ -153,12 +152,13 @@ void AndroidLocationApiAdapter::CreateJavaObject(JNIEnv* env) { |
void AndroidLocationApiAdapter::OnNewGeopositionInternal( |
const Geoposition& geoposition) { |
base::AutoLock lock(lock_); |
- if (!task_runner_.get()) |
+ if (!message_loop_.get()) |
return; |
- task_runner_->PostTask( |
+ message_loop_->PostTask( |
FROM_HERE, |
- base::Bind(&AndroidLocationApiAdapter::NotifyProviderNewGeoposition, |
- geoposition)); |
+ base::Bind( |
+ &AndroidLocationApiAdapter::NotifyProviderNewGeoposition, |
+ geoposition)); |
} |
} // namespace content |