[webkit-dev] FrameLoader::stopAllLoaders and sync XHR
yong.li.webkit at outlook.com
Mon Apr 22 08:45:22 PDT 2013
From what I remembered and understood, actions like FrameLoader::stopAllLoaders is not safe to be executed in a nested event loop. I would try to find a way to exit all nested event loops first and then close the page if it has to be done gracefully.
In EventLoopBlackBerry.cpp, the loop’s end flag is set when the thread’s isRunning() method returns false.
m_ended = !BlackBerry::Platform::webKitThreadMessageClient()->isRunning();
It could be something like:
m_ended = !BlackBerry::Platform::webKitThreadMessageClient()->isRunning() || ...->shouldExitNestedEventLoop();
From: Joe Mason
Sent: Monday, April 22, 2013 11:37 AM
To: webkit-dev at lists.webkit.org
Cc: Mike Lattanzio, Mike Fenton
I'm trying to debug a deadlock on exit in a BlackBerry app that uses webkit (which is pretty hard to reproduce, so I don't have a cut-down test case yet). Right now my suspicions are on this behaviour:
a synchronous XMLHttpRequest starts loading (from a script running in the main frame)
ResourceHandle::platformLoadResourceSynchronously gets called
On BlackBerry, this is implemented by creating a nested EventLoop and calling loop.cycle()
While in the nested event loop, BlackBerry::WebPage::stopLoading is called
This is implemented by calling m_mainFrame->loader()->stopAllLoaders()
As far as I can see, FrameLoader::stopAllLoaders does NOT stop any XMLHttpRequest started from this frame - it just stops the provisionalDocumentLoader and documentLoader for the frame itself, and recursively does the same for all subframes. Is that correct?
Is there a way to find and stop all synchronous requests associated with a frame? (There should be only one...)
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.
webkit-dev mailing list
webkit-dev at lists.webkit.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev