Bug 715836 - Ensure the UI is only modified from the UI thread. r=pcwalton
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 13 Jan 2012 07:03:22 -0500
changeset 84413 157c86d30692cd09b572cf03628e1439f9544963
parent 84412 317592537ff6226d89d776d62135ff6263ea494f
child 84414 d13c738c54ce627f0091580a5825f037c9652a83
push id21848
push usermak77@bonardo.net
push dateSat, 14 Jan 2012 09:02:20 +0000
treeherdermozilla-central@27a7f197c6fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspcwalton
bugs715836
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 715836 - Ensure the UI is only modified from the UI thread. r=pcwalton
mobile/android/base/gfx/LayerController.java
--- a/mobile/android/base/gfx/LayerController.java
+++ b/mobile/android/base/gfx/LayerController.java
@@ -207,17 +207,23 @@ public class LayerController {
      * Sets the entire viewport metrics at once. This function does not notify the layer client or
      * the pan/zoom controller, so you will need to call notifyLayerClientOfGeometryChange() or
      * notifyPanZoomControllerOfGeometryChange() after calling this. You must hold the monitor
      * while calling this.
      */
     public void setViewportMetrics(ViewportMetrics viewport) {
         mViewportMetrics = new ViewportMetrics(viewport);
         Log.d(LOGTAG, "setViewportMetrics: " + mViewportMetrics);
-        GeckoApp.mAppContext.repositionPluginViews(false);
+        // this function may or may not be called on the UI thread,
+        // but repositionPluginViews must only be called on the UI thread.
+        GeckoApp.mAppContext.runOnUiThread(new Runnable() {
+            public void run() {
+                GeckoApp.mAppContext.repositionPluginViews(false);
+            }
+        });
         mView.requestRender();
     }
 
     /**
      * Scales the viewport, keeping the given focus point in the same place before and after the
      * scale operation. You must hold the monitor while calling this.
      */
     public void scaleWithFocus(float zoomFactor, PointF focus) {