Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / android / java / src / org / chromium / chrome / browser / TtsPlatformImpl.java
index d2f9e06..5c6059f 100644 (file)
@@ -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;
@@ -160,7 +161,7 @@ class TtsPlatformImpl {
      */
     @CalledByNative
     private int getVoiceCount() {
-        assert mInitialized == true;
+        assert mInitialized;
         return mVoices.size();
     }
 
@@ -169,7 +170,7 @@ class TtsPlatformImpl {
      */
     @CalledByNative
     private String getVoiceName(int voiceIndex) {
-        assert mInitialized == true;
+        assert mInitialized;
         return mVoices.get(voiceIndex).mName;
     }
 
@@ -178,7 +179,7 @@ class TtsPlatformImpl {
      */
     @CalledByNative
     private String getVoiceLanguage(int voiceIndex) {
-        assert mInitialized == true;
+        assert mInitialized;
         return mVoices.get(voiceIndex).mLanguage;
     }
 
@@ -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);