mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 860879 - Make GeckoAppShell.processNextNativeEvent waitable; r=blassey
This commit is contained in:
parent
a5fbb68769
commit
ba21dd4081
@ -212,7 +212,7 @@ public class ActivityHandlerHelper {
|
||||
|
||||
try {
|
||||
while (null == (filePickerResult = mFilePickerResult.poll(1, TimeUnit.MILLISECONDS))) {
|
||||
GeckoAppShell.processNextNativeEvent();
|
||||
GeckoAppShell.processNextNativeEvent(false);
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Log.e(LOGTAG, "showing file picker failed: ", e);
|
||||
|
@ -212,7 +212,7 @@ public class GeckoAppShell
|
||||
sendEventToGecko(GeckoEvent.createVisitedEvent(uri));
|
||||
}
|
||||
|
||||
public static native void processNextNativeEvent();
|
||||
public static native void processNextNativeEvent(boolean mayWait);
|
||||
|
||||
public static native void notifyBatteryChange(double aLevel, boolean aCharging, double aRemainingTime);
|
||||
|
||||
|
@ -289,7 +289,7 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
|
||||
String result = null;
|
||||
try {
|
||||
while (null == (result = mPromptQueue.poll(1, TimeUnit.MILLISECONDS))) {
|
||||
GeckoAppShell.processNextNativeEvent();
|
||||
GeckoAppShell.processNextNativeEvent(false);
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
|
@ -191,16 +191,16 @@ Java_org_mozilla_gecko_GeckoAppShell_reportJavaCrash(JNIEnv * arg0, jclass arg1,
|
||||
|
||||
#ifdef JNI_STUBS
|
||||
|
||||
typedef void (*Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent_t)(JNIEnv *, jclass);
|
||||
typedef void (*Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent_t)(JNIEnv *, jclass, jboolean);
|
||||
static Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent_t f_Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent;
|
||||
extern "C" NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent(JNIEnv * arg0, jclass arg1) {
|
||||
Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent(JNIEnv * arg0, jclass arg1, jboolean arg2) {
|
||||
if (!f_Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent) {
|
||||
arg0->ThrowNew(arg0->FindClass("java/lang/UnsupportedOperationException"),
|
||||
"JNI Function called before it was loaded");
|
||||
return ;
|
||||
}
|
||||
f_Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent(arg0, arg1);
|
||||
f_Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent(arg0, arg1, arg2);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -68,11 +68,11 @@ Java_org_mozilla_gecko_GeckoAppShell_notifyGeckoOfEvent(JNIEnv *jenv, jclass jc,
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent(JNIEnv *jenv, jclass)
|
||||
Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent(JNIEnv *jenv, jclass, jboolean mayWait)
|
||||
{
|
||||
// poke the appshell
|
||||
if (nsAppShell::gAppShell)
|
||||
nsAppShell::gAppShell->ProcessNextNativeEvent(false);
|
||||
nsAppShell::gAppShell->ProcessNextNativeEvent(mayWait != JNI_FALSE);
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
|
Loading…
Reference in New Issue
Block a user