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

Unified Diff: chrome/browser/speech/extension_api/tts_extension_apitest.cc

Issue 1143343005: chrome/browser: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. 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
Index: chrome/browser/speech/extension_api/tts_extension_apitest.cc
diff --git a/chrome/browser/speech/extension_api/tts_extension_apitest.cc b/chrome/browser/speech/extension_api/tts_extension_apitest.cc
index 41780d0b8069c62936d7bd720b52597e646983f1..bd0adfc91fe9053c48427bb9e6150466e2867e5f 100644
--- a/chrome/browser/speech/extension_api/tts_extension_apitest.cc
+++ b/chrome/browser/speech/extension_api/tts_extension_apitest.cc
@@ -6,8 +6,10 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/location.h"
#include "base/memory/weak_ptr.h"
-#include "base/message_loop/message_loop.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "chrome/browser/extensions/component_loader.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_service.h"
@@ -88,11 +90,11 @@ class MockTtsPlatformImpl : public TtsPlatformImpl {
}
void SendEndEventOnSavedUtteranceId() {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE, base::Bind(
- &MockTtsPlatformImpl::SendEvent,
- ptr_factory_.GetWeakPtr(),
- false, g_saved_utterance_id, TTS_EVENT_END, 0, std::string()),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&MockTtsPlatformImpl::SendEvent, ptr_factory_.GetWeakPtr(),
+ false, g_saved_utterance_id, TTS_EVENT_END, 0,
+ std::string()),
base::TimeDelta());
}
@@ -101,12 +103,10 @@ class MockTtsPlatformImpl : public TtsPlatformImpl {
const std::string& lang,
const VoiceData& voice,
const UtteranceContinuousParameters& params) {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE, base::Bind(
- &MockTtsPlatformImpl::SendEvent,
- ptr_factory_.GetWeakPtr(),
- false, utterance_id, TTS_EVENT_END, utterance.size(),
- std::string()),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&MockTtsPlatformImpl::SendEvent,
+ ptr_factory_.GetWeakPtr(), false, utterance_id,
+ TTS_EVENT_END, utterance.size(), std::string()),
base::TimeDelta());
}
@@ -116,11 +116,10 @@ class MockTtsPlatformImpl : public TtsPlatformImpl {
const std::string& lang,
const VoiceData& voice,
const UtteranceContinuousParameters& params) {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE, base::Bind(
- &MockTtsPlatformImpl::SendEvent,
- ptr_factory_.GetWeakPtr(),
- true, utterance_id, TTS_EVENT_END, utterance.size(), std::string()),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&MockTtsPlatformImpl::SendEvent,
+ ptr_factory_.GetWeakPtr(), true, utterance_id,
+ TTS_EVENT_END, utterance.size(), std::string()),
base::TimeDelta());
}
@@ -131,12 +130,11 @@ class MockTtsPlatformImpl : public TtsPlatformImpl {
const UtteranceContinuousParameters& params) {
for (int i = 0; i < static_cast<int>(utterance.size()); i++) {
if (i == 0 || utterance[i - 1] == ' ') {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE, base::Bind(
- &MockTtsPlatformImpl::SendEvent,
- ptr_factory_.GetWeakPtr(),
- false, utterance_id, TTS_EVENT_WORD, i,
- std::string()),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&MockTtsPlatformImpl::SendEvent,
+ ptr_factory_.GetWeakPtr(), false, utterance_id,
+ TTS_EVENT_WORD, i, std::string()),
base::TimeDelta());
}
}
@@ -149,11 +147,10 @@ class MockTtsPlatformImpl : public TtsPlatformImpl {
const std::string& message) {
TtsController* controller = TtsController::GetInstance();
if (wait_for_non_empty_queue && controller->QueueSize() == 0) {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE, base::Bind(
- &MockTtsPlatformImpl::SendEvent,
- ptr_factory_.GetWeakPtr(),
- true, utterance_id, event_type, char_index, message),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&MockTtsPlatformImpl::SendEvent, ptr_factory_.GetWeakPtr(),
+ true, utterance_id, event_type, char_index, message),
base::TimeDelta::FromMilliseconds(100));
return;
}
« no previous file with comments | « chrome/browser/signin/fake_profile_oauth2_token_service.cc ('k') | chrome/browser/spellchecker/feedback_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698