зеркало из https://github.com/mozilla/gecko-dev.git
bug 759146 - follow up to fix bad merge
This commit is contained in:
Родитель
378cd4054d
Коммит
94eb2b6481
|
@ -819,24 +819,6 @@ Java_org_mozilla_gecko_GeckoAppShell_notifyReadingMessageListFailed(JNIEnv* jenv
|
|||
PRUint64 mProcessId;
|
||||
};
|
||||
|
||||
NS_EXPORT jobject JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_getNextMessageFromQueue(JNIEnv* jenv, jclass, jobject queue)
|
||||
{
|
||||
static jclass jMessageQueueCls = nsnull;
|
||||
static jfieldID jMessagesField;
|
||||
static jmethodID jNextMethod;
|
||||
if (!jMessageQueueCls) {
|
||||
jMessageQueueCls = (jclass) jenv->NewGlobalRef(jenv->FindClass("android/os/MessageQueue"));
|
||||
jMessagesField = jenv->GetFieldID(jMessageQueueCls, "mMessages", "Landroid/os/Message;");
|
||||
jNextMethod = jenv->GetMethodID(jMessageQueueCls, "next", "()Landroid/os/Message;");
|
||||
}
|
||||
jobject msg = jenv->GetObjectField(queue, jMessagesField);
|
||||
// if queue.mMessages is null, queue.next() will block, which we don't want
|
||||
if (!msg)
|
||||
return msg;
|
||||
msg = jenv->CallObjectMethod(queue, jNextMethod);
|
||||
return msg;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
new NotifyReadListFailedRunnable(aError, aRequestId, aProcessId);
|
||||
|
@ -1020,5 +1002,24 @@ Java_org_mozilla_gecko_GeckoAppShell_onFullScreenPluginHidden(JNIEnv* jenv, jcla
|
|||
NS_DispatchToMainThread(runnable);
|
||||
}
|
||||
|
||||
NS_EXPORT jobject JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_getNextMessageFromQueue(JNIEnv* jenv, jclass, jobject queue)
|
||||
{
|
||||
static jclass jMessageQueueCls = nsnull;
|
||||
static jfieldID jMessagesField;
|
||||
static jmethodID jNextMethod;
|
||||
if (!jMessageQueueCls) {
|
||||
jMessageQueueCls = (jclass) jenv->NewGlobalRef(jenv->FindClass("android/os/MessageQueue"));
|
||||
jMessagesField = jenv->GetFieldID(jMessageQueueCls, "mMessages", "Landroid/os/Message;");
|
||||
jNextMethod = jenv->GetMethodID(jMessageQueueCls, "next", "()Landroid/os/Message;");
|
||||
}
|
||||
jobject msg = jenv->GetObjectField(queue, jMessagesField);
|
||||
// if queue.mMessages is null, queue.next() will block, which we don't want
|
||||
if (!msg)
|
||||
return msg;
|
||||
msg = jenv->CallObjectMethod(queue, jNextMethod);
|
||||
return msg;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче