-
timothy@apple.com authored
Reviewed by Darin Adler. <rdar://problem/5720160> Browser windows "do nothing" while modal dialog or menu is up due to run loop modes (or while scrolling) Adds a new SchedulePair object that holds a runloop and the mode to use. A HashSet of SchedulePairs is tracked by Page so it can be used for resource loading and, in the future, maybe SharedTimerMac. * WebCore.base.exp: Add new exports for WebKit. * WebCore.xcodeproj/project.pbxproj: Add new files. * loader/mac/DocumentLoaderMac.cpp: Added. (WebCore::scheduleAll): Call schedule all the ResourceLoader handles. (WebCore::unscheduleAll): Call unschedule all the ResourceLoader handles. (WebCore::DocumentLoader::schedule): Schedule all the ResourceLoaders owned by the DocumentLoader. (WebCore::DocumentLoader::unschedule): Unschedule all the ResourceLoaders owned by the DocumentLoader. * loader/DocumentLoader.h: * page/Page.h: (WebCore::Page::scheduledRunLoopPairs): Return m_scheduledRunLoopPairs. * page/mac/PageMac.cpp: (WebCore::Page::addSchedulePair): Add a SchedulePair to m_scheduledRunLoopPairs. (WebCore::Page::removeSchedulePair): Removes a SchedulePair from m_scheduledRunLoopPairs. * platform/cf/SchedulePair.cpp: Added. * platform/cf/SchedulePair.h: Added. * platform/mac/SchedulePairMac.mm: Added. * platform/network/ResourceHandle.h: * platform/network/mac/FormDataStreamMac.mm: (WebCore::advanceCurrentStream): Use the new SchedulePair. (WebCore::formCreate): Ditto. (WebCore::formFinalize): Ditto. (WebCore::formSchedule): Ditto. (WebCore::formUnschedule): Ditto. * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::start): Schedule the connection with all the SchedulePairs that Page holds. If Page has no SchedulePairs, schedule with the current runloop, and pick the mode based on ResourceHandle::loadsDuringCommonRunLoopModes. (WebCore::ResourceHandle::schedule): (WebCore::ResourceHandle::unschedule): WebKit/mac: Reviewed by Darin Adler. <rdar://problem/5720160> Browser windows "do nothing" while modal dialog or menu is up due to run loop modes (or while scrolling) Add new API that lets a WebView be scheduled with multiple runloops and modes. This lets loading continue when in a nested runloop or in a different mode. * Misc/WebKitVersionChecks.h: Add a new version define: WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Schedule in the main runloop and with the default runloop mode if we are linked on an earlier WebKit version, use common modes otherwise. (-[WebView scheduleInRunLoop:forMode:]): New API, that calls through to Page. (-[WebView unscheduleFromRunLoop:forMode:]): Ditto. * WebView/WebViewPrivate.h: Add the new pending API methods. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30778 268f45cc-cd09-0410-ab3c-d52691b4dbfc
d919f802