Bug 794130 - Fix intermittent crash in AndroidBridge::ShouldAbortProgressiveUpdate. r=blassey

I messed up the JNI code in AndroidJavaWrappers for this function. It was
always returning false and sometimes crashing.
This commit is contained in:
Chris Lord
2012-10-05 15:41:03 +01:00
parent 95ee3ef013
commit b340e19da3
3 changed files with 28 additions and 13 deletions

View File

@@ -814,6 +814,30 @@ AndroidGeckoLayerClient::SyncViewportInfo(const nsIntRect& aDisplayPort, float a
aScaleX = aScaleY = viewTransform.GetScale(env);
}
bool
AndroidGeckoLayerClient::ShouldAbortProgressiveUpdate(bool aHasPendingNewThebesContent,
const gfx::Rect& aDisplayPort,
float aDisplayResolution)
{
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (!env)
return false;
AutoLocalJNIFrame jniFrame(env);
bool ret = env->CallBooleanMethod(wrapped_obj, jShouldAbortProgressiveUpdate,
aHasPendingNewThebesContent,
(float)aDisplayPort.x,
(float)aDisplayPort.y,
(float)aDisplayPort.width,
(float)aDisplayPort.height,
aDisplayResolution);
if (jniFrame.CheckForException())
return false;
return ret;
}
jobject ConvertToJavaViewportMetrics(JNIEnv* env, nsIAndroidViewport* metrics) {
float x, y, width, height,
pageLeft, pageTop, pageRight, pageBottom,
@@ -887,14 +911,6 @@ AndroidGeckoLayerClient::GetDisplayPort(AutoLocalJNIFrame *jniFrame, bool aPageS
(*displayPort)->AddRef();
}
bool
AndroidGeckoLayerClient::ShouldAbortProgressiveUpdate(AutoLocalJNIFrame *jniFrame, bool aHasPendingNewThebesContent, const gfx::Rect& aDisplayPort, float aDisplayResolution)
{
bool ret = jniFrame->GetEnv()->CallObjectMethod(wrapped_obj, jShouldAbortProgressiveUpdate, aHasPendingNewThebesContent, (float)aDisplayPort.x, (float)aDisplayPort.y, (float)aDisplayPort.width, (float)aDisplayPort.height, aDisplayResolution);
if (jniFrame->CheckForException()) return false;
return ret;
}
jobject
AndroidGeckoSurfaceView::GetSoftwareDrawBitmap(AutoLocalJNIFrame *jniFrame)
{