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

Unified Diff: content/renderer/speech_recognition_dispatcher.cc

Issue 2656043002: Use explicit WebString conversions in remaining content files (Closed)
Patch Set: build fix Created 3 years, 11 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: content/renderer/speech_recognition_dispatcher.cc
diff --git a/content/renderer/speech_recognition_dispatcher.cc b/content/renderer/speech_recognition_dispatcher.cc
index a9574cd8961e951b756d57010fcee76cd2aebe39..637b97b426f070d91ab56ad3672d436a1856c5d2 100644
--- a/content/renderer/speech_recognition_dispatcher.cc
+++ b/content/renderer/speech_recognition_dispatcher.cc
@@ -108,8 +108,7 @@ void SpeechRecognitionDispatcher::start(
SpeechRecognitionGrammar(grammar.src().string().utf8(),
grammar.weight()));
}
- msg_params.language =
- base::UTF16ToUTF8(base::StringPiece16(params.language()));
+ msg_params.language = params.language().utf8();
msg_params.max_hypotheses = static_cast<uint32_t>(params.maxAlternatives());
msg_params.continuous = params.continuous();
msg_params.interim_results = params.interimResults();
@@ -253,7 +252,7 @@ void SpeechRecognitionDispatcher::OnResultsRetrieved(
WebVector<WebString> transcripts(num_hypotheses);
WebVector<float> confidences(num_hypotheses);
for (size_t i = 0; i < num_hypotheses; ++i) {
- transcripts[i] = result.hypotheses[i].utterance;
+ transcripts[i] = WebString::fromUTF16(result.hypotheses[i].utterance);
confidences[i] = static_cast<float>(result.hypotheses[i].confidence);
}
webkit_result->assign(transcripts, confidences, !result.is_provisional);

Powered by Google App Engine
This is Rietveld 408576698