Commit d21a7776 authored by jdduke's avatar jdduke Committed by Commit bot

[Android] Trace TTS initialization

TTS initialiation can take around ~150ms to initialize on Android. Trace
this initialization to make it clear if the task is blocking critical
updates on the browser UI thread.

BUG=406597

Review URL: https://codereview.chromium.org/558323002

Cr-Commit-Position: refs/heads/master@{#294869}
parent aaed1e21
......@@ -10,6 +10,7 @@ import android.speech.tts.UtteranceProgressListener;
import org.chromium.base.CalledByNative;
import org.chromium.base.ThreadUtils;
import org.chromium.base.TraceEvent;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -237,6 +238,8 @@ class TtsPlatformImpl {
private void initialize() {
assert mNativeTtsPlatformImplAndroid != 0;
TraceEvent.begin("TtsPlatformImpl:initialize");
// Note: Android supports multiple speech engines, but querying the
// metadata about all of them is expensive. So we deliberately only
// support the default speech engine, and expose the different
......@@ -268,6 +271,8 @@ class TtsPlatformImpl {
nativeVoicesChanged(mNativeTtsPlatformImplAndroid);
if (mPendingUtterance != null) mPendingUtterance.speak();
TraceEvent.end("TtsPlatformImpl:initialize");
}
private native void nativeVoicesChanged(long nativeTtsPlatformImplAndroid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment