Bug 735612 - Add missing synchronization around viewport manipulation. r=Cwiiis

This commit is contained in:
Kartikaya Gupta 2012-03-15 10:40:55 -04:00
Родитель deb4135b71
Коммит b93a9723c8
1 изменённых файлов: 12 добавлений и 8 удалений

Просмотреть файл

@ -232,8 +232,10 @@ public class PanZoomController
case NOTHING:
// Don't do animations here; they're distracting and can cause flashes on page
// transitions.
synchronized (mController) {
mController.setViewportMetrics(getValidViewportMetrics());
mController.notifyLayerClientOfGeometryChange();
}
break;
}
}
@ -241,6 +243,7 @@ public class PanZoomController
/** This must be called on the UI thread. */
public void pageSizeUpdated() {
if (mState == PanZoomState.NOTHING) {
synchronized (mController) {
ViewportMetrics validated = getValidViewportMetrics();
if (! (new ViewportMetrics(mController.getViewportMetrics())).fuzzyEquals(validated)) {
// page size changed such that we are now in overscroll. snap to the
@ -250,6 +253,7 @@ public class PanZoomController
}
}
}
}
/*
* Panning/scrolling