Bug 1329438 - Wait until Gecko is ready to open URI; r=snorp a=gchang
authorJim Chen <nchen@mozilla.com>
Wed, 08 Feb 2017 19:50:32 -0500
changeset 376117 447a9c40939c591b7bda5ca763a69f1f32ac87d6
parent 376116 46116604aa0b07bffac9c4c27e19f27805e56883
child 376118 dde4995469df1c12a38015558652d1c2d4774f1a
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, gchang
bugs1329438
milestone53.0a2
Bug 1329438 - Wait until Gecko is ready to open URI; r=snorp a=gchang Right now we wait until PROFILE_READY state, but we may not have a browser DOM window until RUNNING state, so wait until then.
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java
@@ -238,21 +238,20 @@ public class GeckoView extends LayerView
     @WrapForJNI public static final int LOAD_NEW_TAB = 1;
     @WrapForJNI public static final int LOAD_SWITCH_TAB = 2;
 
     public void loadUri(String uri, int flags) {
         if (window == null) {
             throw new IllegalStateException("Not attached to window");
         }
 
-        if (GeckoThread.isStateAtLeast(GeckoThread.State.PROFILE_READY)) {
+        if (GeckoThread.isRunning()) {
             window.loadUri(uri, flags);
         }  else {
-            GeckoThread.queueNativeCallUntil(GeckoThread.State.PROFILE_READY,
-                    window, "loadUri", String.class, uri, flags);
+            GeckoThread.queueNativeCall(window, "loadUri", String.class, uri, flags);
         }
     }
 
     /* package */ void setInputConnectionListener(final InputConnectionListener icl) {
         mInputConnectionListener = icl;
     }
 
     @Override