Loading the following content, and reloading it again causes a crash: <html> <body onunload="alert('goodbye');"> test </body> </html> The reason is that the QNetworkReply::finished signal is processed before the QNetworkReply::readyRead signal. A patch will be added shortly.
When you finish the patch (I have already look at a preliminary one) please add a test. You could add the code snipped as a WebCore/manual-test/qt test, but instead of writing "test" write something along the lines of: "Reload me twice ensuring that this didn't result in a crash. Test added due to bug <a 'href="https://bugs.webkit.org/show_bug.cgi?id=26556'>@25556</a>"
Created attachment 31565 [details] Process getting out of deferred mode asynchronously With this patch, processing of getting out of deferred mode is processed asynchronously. In the attached test case, onunload causes a JavaScript alert to show up, and the newly received data is not processed until getting out of deferred mode. We should not process the next signal in the queue, before finishing processing of the current one.
Comment on attachment 31565 [details] Process getting out of deferred mode asynchronously Okay, looks sensible. Maybe we should rename m_should* to something like m_handle*Later?
Landed in 44934. I did not change the argument names because I did not want to mess-up the commit :-) We should revisit the naming again.