webkit feedback calls on failure

Johan Vos johan.vos at gluonhq.com
Tue Sep 4 13:31:15 UTC 2018


The WebEngine already allows to get information about the progress of the
underlying webkit via the onError() handler and the getLoadWorker() status
updates.

However, there are a number of cases where things go wrong in webkit, yet
the status of the loadWorker is SUCCEEDED and no WebErrorEvent is generated.

A simple case is where a small html page loads a large image. In this case,
URLLoader will call twkDidFinishLoading() which is a native call, which in
turn will invoke ImageDecoderJava.cpp::setData

This call will invoke
WCImageDecoderImpl.addImageData (back in the java layer), but when that
throws a throwable (which it does, an OOME in resizeDataArray), it will
ignore it by calling CheckAndClearException (in ImageDecoderJava.cpp) and
the information about the exception is lost (that
is, env->ExceptionDescribe() is called which will print thread + exception,
but that's it).

Hence, at this moment it seems impossible to detect a failure when large
images are loaded. While the status of the loadWorker will move to
SUCCEEDED, the image won't be shown.

There are a number of ways to improve this, so if it is agreed that this
can be an enhancement, I'll file an issue for it.

- Johan


More information about the openjfx-dev mailing list