Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Unified Diff: chrome/test/chromedriver/commands.cc

Issue 1167163002: chrome: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some missing message_loop.h includes. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/chromedriver/chrome/adb_impl.h ('k') | chrome/test/chromedriver/commands_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)));
}
}
« no previous file with comments | « chrome/test/chromedriver/chrome/adb_impl.h ('k') | chrome/test/chromedriver/commands_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698