mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
bug 812594 - PushLocalFrame in AutoLocalJNIFrame::Push taking more than 100ms when called from AndroidGeckoLayerClient::ProgressiveUpdateCallback on a Samsung Galaxy Q r=kats
--HG-- extra : rebase_source : 4aba48c1c6c784f098ffa9bcc05006a054f9ab14
This commit is contained in:
parent
c728f95e75
commit
5a94057a01
@ -539,6 +539,40 @@ protected:
|
|||||||
void (* Region_set)(void* region, void* rect);
|
void (* Region_set)(void* region, void* rect);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class AutoJObject {
|
||||||
|
public:
|
||||||
|
AutoJObject(JNIEnv* aJNIEnv = NULL) : mObject(NULL)
|
||||||
|
{
|
||||||
|
mJNIEnv = aJNIEnv ? aJNIEnv : AndroidBridge::GetJNIEnv();
|
||||||
|
}
|
||||||
|
|
||||||
|
AutoJObject(JNIEnv* aJNIEnv, jobject aObject)
|
||||||
|
{
|
||||||
|
mJNIEnv = aJNIEnv ? aJNIEnv : AndroidBridge::GetJNIEnv();
|
||||||
|
mObject = aObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
~AutoJObject() {
|
||||||
|
if (mObject)
|
||||||
|
mJNIEnv->DeleteLocalRef(mObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
jobject operator=(jobject aObject)
|
||||||
|
{
|
||||||
|
if (mObject) {
|
||||||
|
mJNIEnv->DeleteLocalRef(mObject);
|
||||||
|
}
|
||||||
|
return mObject = aObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
operator jobject() {
|
||||||
|
return mObject;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
JNIEnv* mJNIEnv;
|
||||||
|
jobject mObject;
|
||||||
|
};
|
||||||
|
|
||||||
class AutoLocalJNIFrame {
|
class AutoLocalJNIFrame {
|
||||||
public:
|
public:
|
||||||
AutoLocalJNIFrame(int nEntries = 128)
|
AutoLocalJNIFrame(int nEntries = 128)
|
||||||
|
@ -861,18 +861,19 @@ AndroidGeckoLayerClient::ProgressiveUpdateCallback(bool aHasPendingNewThebesCont
|
|||||||
if (!env)
|
if (!env)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env);
|
AutoJObject progressiveUpdateDataJObj(env, env->CallObjectMethod(wrapped_obj,
|
||||||
|
jProgressiveUpdateCallbackMethod,
|
||||||
jobject progressiveUpdateDataJObj = env->CallObjectMethod(wrapped_obj,
|
aHasPendingNewThebesContent,
|
||||||
jProgressiveUpdateCallbackMethod,
|
(float)aDisplayPort.x,
|
||||||
aHasPendingNewThebesContent,
|
(float)aDisplayPort.y,
|
||||||
(float)aDisplayPort.x,
|
(float)aDisplayPort.width,
|
||||||
(float)aDisplayPort.y,
|
(float)aDisplayPort.height,
|
||||||
(float)aDisplayPort.width,
|
aDisplayResolution));
|
||||||
(float)aDisplayPort.height,
|
if (env->ExceptionCheck()) {
|
||||||
aDisplayResolution);
|
env->ExceptionDescribe();
|
||||||
if (jniFrame.CheckForException())
|
env->ExceptionClear();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
NS_ABORT_IF_FALSE(progressiveUpdateDataJObj, "No progressive update data!");
|
NS_ABORT_IF_FALSE(progressiveUpdateDataJObj, "No progressive update data!");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user