SUGGESTED FIX
runMessagePump should actually handle messages as the name suggested.
To maximize backward compatibility, and to reduce the round trips between native->Java in case multiple invokeLater requests are involved, we queue up all invokeLater requests in Java code, and wake up the main thread to handle the one invokeLater request to handle the queued Runnables. Similar implementation is already in place for NPAPI plugin.
|
EVALUATION
The problem is caused by a waiting timeout of 20ms in the Java_sun_plugin2_main_server_WindowsHelper_runMessagePump0() native method. The IE main thread is doing a LiveConnect call to Java and waiting for the result to return. During which operation, Java->JS calls are post to main thread to be processed via invokeLater.
As the main thread is blocked waiting for the result, the Java->JS call will only be processed after 20ms timeout.
|