| Index: content/browser/device_orientation/provider_impl.cc
|
| diff --git a/content/browser/device_orientation/provider_impl.cc b/content/browser/device_orientation/provider_impl.cc
|
| index 433e806cb7784b8b9e652ad9c2aecdc53b3d4a35..7e9f4d007a5bbca77681ba38e508df9b63e37cdd 100644
|
| --- a/content/browser/device_orientation/provider_impl.cc
|
| +++ b/content/browser/device_orientation/provider_impl.cc
|
| @@ -6,9 +6,9 @@
|
| #include <set>
|
| #include <vector>
|
|
|
| +#include "base/bind.h"
|
| #include "base/logging.h"
|
| #include "base/message_loop.h"
|
| -#include "base/task.h"
|
| #include "base/threading/thread.h"
|
| #include "base/threading/thread_restrictions.h"
|
| #include "content/browser/device_orientation/orientation.h"
|
| @@ -98,11 +98,11 @@ void ProviderImpl::DoInitializePollingThread(
|
| void ProviderImpl::ScheduleInitializePollingThread() {
|
| DCHECK(MessageLoop::current() == creator_loop_);
|
|
|
| - Task* task = NewRunnableMethod(this,
|
| - &ProviderImpl::DoInitializePollingThread,
|
| - factories_);
|
| MessageLoop* polling_loop = polling_thread_->message_loop();
|
| - polling_loop->PostTask(FROM_HERE, task);
|
| + polling_loop->PostTask(FROM_HERE,
|
| + base::Bind(&ProviderImpl::DoInitializePollingThread,
|
| + this,
|
| + factories_));
|
| }
|
|
|
| void ProviderImpl::DoNotify(const Orientation& orientation) {
|
| @@ -124,8 +124,8 @@ void ProviderImpl::DoNotify(const Orientation& orientation) {
|
| void ProviderImpl::ScheduleDoNotify(const Orientation& orientation) {
|
| DCHECK(MessageLoop::current() == polling_thread_->message_loop());
|
|
|
| - Task* task = NewRunnableMethod(this, &ProviderImpl::DoNotify, orientation);
|
| - creator_loop_->PostTask(FROM_HERE, task);
|
| + creator_loop_->PostTask(
|
| + FROM_HERE, base::Bind(&ProviderImpl::DoNotify, this, orientation));
|
| }
|
|
|
| void ProviderImpl::DoPoll() {
|
| @@ -150,9 +150,11 @@ void ProviderImpl::DoPoll() {
|
| void ProviderImpl::ScheduleDoPoll() {
|
| DCHECK(MessageLoop::current() == polling_thread_->message_loop());
|
|
|
| - Task* task = do_poll_method_factory_.NewRunnableMethod(&ProviderImpl::DoPoll);
|
| MessageLoop* polling_loop = polling_thread_->message_loop();
|
| - polling_loop->PostDelayedTask(FROM_HERE, task, SamplingIntervalMs());
|
| + polling_loop->PostDelayedTask(
|
| + FROM_HERE,
|
| + base::Bind(&ProviderImpl::DoPoll, do_poll_method_factory_.GetWeakPtr()),
|
| + SamplingIntervalMs());
|
| }
|
|
|
| namespace {
|
|
|