| Index: content/browser/geolocation/mock_location_provider.cc
|
| diff --git a/content/browser/geolocation/mock_location_provider.cc b/content/browser/geolocation/mock_location_provider.cc
|
| index 2953ba1be174919df2da917b7ef262da902451ef..0bb760f06b165e1723976159f5908d472ded10a0 100644
|
| --- a/content/browser/geolocation/mock_location_provider.cc
|
| +++ b/content/browser/geolocation/mock_location_provider.cc
|
| @@ -10,10 +10,10 @@
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| #include "base/compiler_specific.h"
|
| +#include "base/location.h"
|
| #include "base/logging.h"
|
| #include "base/memory/weak_ptr.h"
|
| -#include "base/message_loop/message_loop.h"
|
| -#include "base/message_loop/message_loop_proxy.h"
|
| +#include "base/thread_task_runner_handle.h"
|
|
|
| namespace content {
|
| MockLocationProvider* MockLocationProvider::instance_ = NULL;
|
| @@ -22,7 +22,7 @@ MockLocationProvider::MockLocationProvider(MockLocationProvider** self_ref)
|
| : state_(STOPPED),
|
| is_permission_granted_(false),
|
| self_ref_(self_ref),
|
| - provider_loop_(base::MessageLoopProxy::current()) {
|
| + provider_task_runner_(base::ThreadTaskRunnerHandle::Get()) {
|
| CHECK(self_ref_);
|
| CHECK(*self_ref_ == NULL);
|
| *self_ref_ = this;
|
| @@ -34,16 +34,15 @@ MockLocationProvider::~MockLocationProvider() {
|
| }
|
|
|
| void MockLocationProvider::HandlePositionChanged(const Geoposition& position) {
|
| - if (provider_loop_->BelongsToCurrentThread()) {
|
| + if (provider_task_runner_->BelongsToCurrentThread()) {
|
| // The location arbitrator unit tests rely on this method running
|
| // synchronously.
|
| position_ = position;
|
| NotifyCallback(position_);
|
| } else {
|
| - provider_loop_->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&MockLocationProvider::HandlePositionChanged,
|
| - base::Unretained(this), position));
|
| + provider_task_runner_->PostTask(
|
| + FROM_HERE, base::Bind(&MockLocationProvider::HandlePositionChanged,
|
| + base::Unretained(this), position));
|
| }
|
| }
|
|
|
| @@ -104,11 +103,9 @@ class AutoMockLocationProvider : public MockLocationProvider {
|
| void UpdateListenersIfNeeded() {
|
| if (!listeners_updated_) {
|
| listeners_updated_ = true;
|
| - base::MessageLoop::current()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&MockLocationProvider::HandlePositionChanged,
|
| - weak_factory_.GetWeakPtr(),
|
| - position_));
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| + FROM_HERE, base::Bind(&MockLocationProvider::HandlePositionChanged,
|
| + weak_factory_.GetWeakPtr(), position_));
|
| }
|
| }
|
|
|
|
|