Bug 1078304 - Call GeckoAppShell.setLayerView early. r=snorp, a=lsblakk
authorJim Chen <nchen@mozilla.com>
Wed, 22 Oct 2014 12:51:43 -0400
changeset 234395 6261f53e018f4583edc8e087ed01f9ab766a22ff
parent 234394 bb209fcdbcdcadaec10b3270a68d002e54a49d42
child 234396 fb06fa0600ab95db48212a237c79b650cac213c5
push id4300
push userryanvm@gmail.com
push dateMon, 05 Jan 2015 21:46:20 +0000
treeherdermozilla-beta@fb06fa0600ab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, lsblakk
bugs1078304
milestone35.0
Bug 1078304 - Call GeckoAppShell.setLayerView early. r=snorp, a=lsblakk
mobile/android/base/GeckoApp.java
mobile/android/base/GeckoView.java
mobile/android/base/gfx/LayerView.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1411,17 +1411,16 @@ public abstract class GeckoApp
                 ((SurfaceView)mCameraView).getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
             }
         }
 
         if (mLayerView == null) {
             LayerView layerView = (LayerView) findViewById(R.id.layer_view);
             layerView.initializeView(EventDispatcher.getInstance());
             mLayerView = layerView;
-            GeckoAppShell.setLayerView(layerView);
             GeckoAppShell.sendEventToGecko(GeckoEvent.createObjectEvent(
                 GeckoEvent.ACTION_OBJECT_LAYER_CLIENT, layerView.getLayerClientObject()));
 
             // bind the GeckoEditable instance to the new LayerView
             GeckoAppShell.notifyIMEContext(GeckoEditableListener.IME_STATE_DISABLED, "", "", "");
         }
     }
 
--- a/mobile/android/base/GeckoView.java
+++ b/mobile/android/base/GeckoView.java
@@ -106,16 +106,19 @@ public class GeckoView extends LayerView
         TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.GeckoView);
         String url = a.getString(R.styleable.GeckoView_url);
         boolean doInit = a.getBoolean(R.styleable.GeckoView_doinit, true);
         a.recycle();
         init(context, url, doInit);
     }
 
     private void init(Context context, String url, boolean doInit) {
+        // Perform common initialization for Fennec/GeckoView.
+        GeckoAppShell.setLayerView(this);
+
         // TODO: Fennec currently takes care of its own initialization, so this
         // flag is a hack used in Fennec to prevent GeckoView initialization.
         // This should go away once Fennec also uses GeckoView for
         // initialization.
         if (!doInit)
             return;
 
         // If running outside of a GeckoActivity (eg, from a library project),
@@ -168,17 +171,16 @@ public class GeckoView extends LayerView
 
         initializeView(EventDispatcher.getInstance());
 
         if (GeckoThread.checkAndSetLaunchState(GeckoThread.LaunchState.Launching, GeckoThread.LaunchState.Launched)) {
             // This is the first launch, so finish initialization and go.
             GeckoProfile profile = GeckoProfile.get(context).forceCreate();
             BrowserDB.initialize(profile.getName());
 
-            GeckoAppShell.setLayerView(this);
             GeckoAppShell.sendEventToGecko(GeckoEvent.createObjectEvent(
                 GeckoEvent.ACTION_OBJECT_LAYER_CLIENT, getLayerClientObject()));
             GeckoThread.createAndStart();
         } else if(GeckoThread.checkLaunchState(GeckoThread.LaunchState.GeckoRunning)) {
             // If Gecko is already running, that means the Activity was
             // destroyed, so we need to re-attach Gecko to this GeckoView.
             connectToGecko();
         }
--- a/mobile/android/base/gfx/LayerView.java
+++ b/mobile/android/base/gfx/LayerView.java
@@ -316,17 +316,16 @@ public class LayerView extends FrameLayo
     }
 
     public void setIsRTL(boolean aIsRTL) {
         mLayerClient.setIsRTL(aIsRTL);
     }
 
     public void setInputConnectionHandler(InputConnectionHandler inputConnectionHandler) {
         mInputConnectionHandler = inputConnectionHandler;
-        mLayerClient.forceRedraw(null);
     }
 
     @Override
     public Handler getHandler() {
         if (mInputConnectionHandler != null)
             return mInputConnectionHandler.getHandler(super.getHandler());
         return super.getHandler();
     }