bug 759146 - follow up to fix bad merge

This commit is contained in:
Brad Lassey 2012-05-31 23:24:07 -04:00
Родитель 378cd4054d
Коммит 94eb2b6481
1 изменённых файлов: 19 добавлений и 18 удалений

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

@ -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
}