WebCore:
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Mar 2008 00:57:26 +0000 (00:57 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Mar 2008 00:57:26 +0000 (00:57 +0000)
commit6aad6e086dad57d99ffb439a2ddd32a99c65ce38
treebc746c5646f105b543dc29feefc0fb300fe407aa
parentf0e46100cfee7739753471f8f9069197d414b139
WebCore:

        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: https://svn.webkit.org/repository/webkit/trunk@30778 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/loader/DocumentLoader.h
WebCore/loader/mac/DocumentLoaderMac.cpp [new file with mode: 0644]
WebCore/page/Page.h
WebCore/page/mac/PageMac.cpp [new file with mode: 0644]
WebCore/platform/cf/SchedulePair.cpp [new file with mode: 0644]
WebCore/platform/cf/SchedulePair.h [new file with mode: 0644]
WebCore/platform/mac/SchedulePairMac.mm [new file with mode: 0644]
WebCore/platform/network/ResourceHandle.h
WebCore/platform/network/ResourceHandleInternal.h
WebCore/platform/network/mac/FormDataStreamMac.mm
WebCore/platform/network/mac/ResourceHandleMac.mm
WebKit/mac/ChangeLog
WebKit/mac/Misc/WebKitVersionChecks.h
WebKit/mac/WebView/WebView.mm
WebKit/mac/WebView/WebViewPrivate.h