| Index: chrome/test/chromedriver/commands.cc
|
| diff --git a/chrome/test/chromedriver/commands.cc b/chrome/test/chromedriver/commands.cc
|
| index 2a9b794bd688db55810aa3b85b7d4fa11806703f..667d5e99672bc387f7c6b3d20826c3c19974233d 100644
|
| --- a/chrome/test/chromedriver/commands.cc
|
| +++ b/chrome/test/chromedriver/commands.cc
|
| @@ -10,13 +10,15 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| +#include "base/location.h"
|
| #include "base/logging.h"
|
| #include "base/memory/linked_ptr.h"
|
| #include "base/message_loop/message_loop.h"
|
| -#include "base/message_loop/message_loop_proxy.h"
|
| #include "base/run_loop.h"
|
| +#include "base/single_thread_task_runner.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "base/sys_info.h"
|
| +#include "base/thread_task_runner_handle.h"
|
| #include "base/values.h"
|
| #include "chrome/test/chromedriver/capabilities.h"
|
| #include "chrome/test/chromedriver/chrome/browser_info.h"
|
| @@ -65,7 +67,7 @@ void ExecuteCreateSession(
|
| return;
|
| }
|
|
|
| - thread->message_loop()->PostTask(
|
| + thread->task_runner()->PostTask(
|
| FROM_HERE, base::Bind(&SetThreadLocalSession, base::Passed(&session)));
|
| session_thread_map
|
| ->insert(std::make_pair(new_id, make_linked_ptr(thread.release())));
|
| @@ -126,10 +128,8 @@ void ExecuteGetSessions(const Command& session_capabilities_command,
|
| run_loop.QuitClosure(),
|
| session_list.get()));
|
| }
|
| - base::MessageLoop::current()->PostDelayedTask(
|
| - FROM_HERE,
|
| - run_loop.QuitClosure(),
|
| - base::TimeDelta::FromSeconds(10));
|
| + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
|
| + FROM_HERE, run_loop.QuitClosure(), base::TimeDelta::FromSeconds(10));
|
| base::MessageLoop::current()->SetNestableTasksAllowed(true);
|
| run_loop.Run();
|
|
|
| @@ -176,7 +176,7 @@ void ExecuteQuitAll(
|
| weak_ptr_factory.GetWeakPtr(),
|
| run_loop.QuitClosure()));
|
| }
|
| - base::MessageLoop::current()->PostDelayedTask(
|
| + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
|
| FROM_HERE, run_loop.QuitClosure(), base::TimeDelta::FromSeconds(10));
|
| // Uses a nested run loop to block this thread until all the quit
|
| // commands have executed, or the timeout expires.
|
| @@ -303,18 +303,13 @@ void ExecuteSessionCommand(
|
| Status status(return_ok_without_session ? kOk : kNoSuchSession);
|
| callback.Run(status, scoped_ptr<base::Value>(), session_id);
|
| } else {
|
| - iter->second->message_loop()
|
| - ->PostTask(FROM_HERE,
|
| - base::Bind(&ExecuteSessionCommandOnSessionThread,
|
| - command_name,
|
| - command,
|
| - return_ok_without_session,
|
| + iter->second->task_runner()->PostTask(
|
| + FROM_HERE, base::Bind(&ExecuteSessionCommandOnSessionThread,
|
| + command_name, command, return_ok_without_session,
|
| base::Passed(make_scoped_ptr(params.DeepCopy())),
|
| - base::MessageLoopProxy::current(),
|
| - callback,
|
| + base::ThreadTaskRunnerHandle::Get(), callback,
|
| base::Bind(&TerminateSessionThreadOnCommandThread,
|
| - session_thread_map,
|
| - session_id)));
|
| + session_thread_map, session_id)));
|
| }
|
| }
|
|
|
|
|