<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[30778] trunk</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/30778">30778</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2008-03-04 16:57:26 -0800 (Tue, 04 Mar 2008)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebCore:

        Reviewed by Darin Adler.

        &lt;rdar://problem/5720160&gt; Browser windows &quot;do nothing&quot; 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.

        &lt;rdar://problem/5720160&gt; Browser windows &quot;do nothing&quot; 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.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreWebCorebaseexp">trunk/WebCore/WebCore.base.exp</a></li>
<li><a href="#trunkWebCoreWebCorexcodeprojprojectpbxproj">trunk/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkWebCoreloaderDocumentLoaderh">trunk/WebCore/loader/DocumentLoader.h</a></li>
<li><a href="#trunkWebCorepagePageh">trunk/WebCore/page/Page.h</a></li>
<li><a href="#trunkWebCoreplatformnetworkResourceHandleh">trunk/WebCore/platform/network/ResourceHandle.h</a></li>
<li><a href="#trunkWebCoreplatformnetworkResourceHandleInternalh">trunk/WebCore/platform/network/ResourceHandleInternal.h</a></li>
<li><a href="#trunkWebCoreplatformnetworkmacFormDataStreamMacmm">trunk/WebCore/platform/network/mac/FormDataStreamMac.mm</a></li>
<li><a href="#trunkWebCoreplatformnetworkmacResourceHandleMacmm">trunk/WebCore/platform/network/mac/ResourceHandleMac.mm</a></li>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacMiscWebKitVersionChecksh">trunk/WebKit/mac/Misc/WebKitVersionChecks.h</a></li>
<li><a href="#trunkWebKitmacWebViewWebViewmm">trunk/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkWebKitmacWebViewWebViewPrivateh">trunk/WebKit/mac/WebView/WebViewPrivate.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkWebCoreloadermacDocumentLoaderMaccpp">trunk/WebCore/loader/mac/DocumentLoaderMac.cpp</a></li>
<li><a href="#trunkWebCorepagemacPageMaccpp">trunk/WebCore/page/mac/PageMac.cpp</a></li>
<li><a href="#trunkWebCoreplatformcfSchedulePaircpp">trunk/WebCore/platform/cf/SchedulePair.cpp</a></li>
<li><a href="#trunkWebCoreplatformcfSchedulePairh">trunk/WebCore/platform/cf/SchedulePair.h</a></li>
<li><a href="#trunkWebCoreplatformmacSchedulePairMacmm">trunk/WebCore/platform/mac/SchedulePairMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebCore/ChangeLog        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2008-03-04  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Reviewed by Darin Adler.
+
+        &lt;rdar://problem/5720160&gt; Browser windows &quot;do nothing&quot; 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):
+
</ins><span class="cx"> 2008-03-04  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Adler.
</span></span></pre></div>
<a id="trunkWebCoreWebCorebaseexp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.base.exp (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.base.exp        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebCore/WebCore.base.exp        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -239,6 +239,7 @@
</span><span class="cx"> __ZN7WebCore12IconDatabase4openERKNS_6StringE
</span><span class="cx"> __ZN7WebCore12IconDatabase5closeEv
</span><span class="cx"> __ZN7WebCore12IconDatabase9setClientEPNS_18IconDatabaseClientE
</span><ins>+__ZN7WebCore12SchedulePairC1EP9NSRunLoopPK10__CFString
</ins><span class="cx"> __ZN7WebCore12SharedBuffer10wrapNSDataEP6NSData
</span><span class="cx"> __ZN7WebCore12SharedBuffer12createNSDataEv
</span><span class="cx"> __ZN7WebCore12TextEncodingC1ERKNS_6StringE
</span><span class="lines">@@ -371,8 +372,10 @@
</span><span class="cx"> __ZN7WebCore4Node17stopIgnoringLeaksEv
</span><span class="cx"> __ZN7WebCore4Node18startIgnoringLeaksEv
</span><span class="cx"> __ZN7WebCore4Page12setGroupNameERKNS_6StringE
</span><ins>+__ZN7WebCore4Page15addSchedulePairEN3WTF10PassRefPtrINS_12SchedulePairEEE
</ins><span class="cx"> __ZN7WebCore4Page15backForwardListEv
</span><span class="cx"> __ZN7WebCore4Page16setDefersLoadingEb
</span><ins>+__ZN7WebCore4Page18removeSchedulePairEN3WTF10PassRefPtrINS_12SchedulePairEEE
</ins><span class="cx"> __ZN7WebCore4Page23clearUndoRedoOperationsEv
</span><span class="cx"> __ZN7WebCore4Page37setInLowQualityImageInterpolationModeEb
</span><span class="cx"> __ZN7WebCore4Page6goBackEv
</span></span></pre></div>
<a id="trunkWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.xcodeproj/project.pbxproj (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.xcodeproj/project.pbxproj        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebCore/WebCore.xcodeproj/project.pbxproj        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -276,6 +276,8 @@
</span><span class="cx">                 1C11CCC80AA6093700DADB20 /* DOMHTMLElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85DF2EEB0AA387CB00AD64C5 /* DOMHTMLElement.h */; };
</span><span class="cx">                 1C14E76B0AD8C81C00B6158B /* deleteButtonPressed.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 1C14E7690AD8C81C00B6158B /* deleteButtonPressed.tiff */; };
</span><span class="cx">                 1C14E76C0AD8C81C00B6158B /* deleteButton.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 1C14E76A0AD8C81C00B6158B /* deleteButton.tiff */; };
</span><ins>+                1C26497A0D7E248A00BD10F2 /* DocumentLoaderMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C2649790D7E248A00BD10F2 /* DocumentLoaderMac.cpp */; };
+                1C26497C0D7E24EC00BD10F2 /* PageMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C26497B0D7E24EC00BD10F2 /* PageMac.cpp */; };
</ins><span class="cx">                 1C4C8F020AD85D87009475CE /* DeleteButtonController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4C8F000AD85D87009475CE /* DeleteButtonController.h */; };
</span><span class="cx">                 1C4C8F660AD8655D009475CE /* DeleteButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4C8F640AD8655D009475CE /* DeleteButton.h */; };
</span><span class="cx">                 1C6B7C9A0CEFC9D00076DE61 /* InspectorLocalizedStrings.js in Resources */ = {isa = PBXBuildFile; fileRef = 1C6B7C980CEFC9BE0076DE61 /* InspectorLocalizedStrings.js */; };
</span><span class="lines">@@ -286,8 +288,11 @@
</span><span class="cx">                 1CB4214B0AF2B2CA0085AD91 /* DOMElementInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85E711490AC5D5340053270F /* DOMElementInternal.h */; };
</span><span class="cx">                 1CB4214C0AF2B2CA0085AD91 /* DOMHTMLElementInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85E711580AC5D5340053270F /* DOMHTMLElementInternal.h */; };
</span><span class="cx">                 1CB4214D0AF2B2CA0085AD91 /* DOMRangeInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 8538F05A0AD722F1006A81D1 /* DOMRangeInternal.h */; };
</span><ins>+                1CE24F970D7CAF0E007E04C2 /* SchedulePairMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1CE24F960D7CAF0E007E04C2 /* SchedulePairMac.mm */; };
</ins><span class="cx">                 1CE83AC30ADAFFD7009354F6 /* DeleteButtonController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C4C8EFF0AD85D87009475CE /* DeleteButtonController.cpp */; };
</span><span class="cx">                 1CE83AC40ADAFFD8009354F6 /* DeleteButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C4C8F630AD8655D009475CE /* DeleteButton.cpp */; };
</span><ins>+                1CEFC9B90D78DC8C007D2579 /* SchedulePair.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CEFC9B70D78DC8C007D2579 /* SchedulePair.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                1CEFC9BA0D78DC8C007D2579 /* SchedulePair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CEFC9B80D78DC8C007D2579 /* SchedulePair.cpp */; };
</ins><span class="cx">                 1CFAE3230A6D6A3F0032593D /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CFAE3220A6D6A3F0032593D /* libobjc.dylib */; };
</span><span class="cx">                 1CFCEE960AACC40100348750 /* DOMHTMLBodyElementPrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 1CFCEE8D0AACC3CD00348750 /* DOMHTMLBodyElementPrivate.h */; };
</span><span class="cx">                 1CFCEE970AACC40100348750 /* DOMHTMLButtonElementPrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 1CFCEE8E0AACC3CD00348750 /* DOMHTMLButtonElementPrivate.h */; };
</span><span class="lines">@@ -4541,6 +4546,8 @@
</span><span class="cx">                 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLResultSetRowList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C14E7690AD8C81C00B6158B /* deleteButtonPressed.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = deleteButtonPressed.tiff; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C14E76A0AD8C81C00B6158B /* deleteButton.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = deleteButton.tiff; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1C2649790D7E248A00BD10F2 /* DocumentLoaderMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentLoaderMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1C26497B0D7E24EC00BD10F2 /* PageMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1C4C8EFF0AD85D87009475CE /* DeleteButtonController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeleteButtonController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 1C4C8F000AD85D87009475CE /* DeleteButtonController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeleteButtonController.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 1C4C8F630AD8655D009475CE /* DeleteButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeleteButton.cpp; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="lines">@@ -4554,6 +4561,9 @@
</span><span class="cx">                 1CDD45E40BA9C84600F90147 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1CDD45E50BA9C84600F90147 /* WebCore.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebCore.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1CDD45E60BA9C84600F90147 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1CE24F960D7CAF0E007E04C2 /* SchedulePairMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SchedulePairMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1CEFC9B70D78DC8C007D2579 /* SchedulePair.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchedulePair.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1CEFC9B80D78DC8C007D2579 /* SchedulePair.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SchedulePair.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1CFAE3220A6D6A3F0032593D /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = &quot;compiled.mach-o.dylib&quot;; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = &quot;&lt;absolute&gt;&quot;; };
</span><span class="cx">                 1CFCEE7F0AACC3B300348750 /* DOMHTMLAnchorElementPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLAnchorElementPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1CFCEE880AACC3C000348750 /* DOMHTMLAreaElementPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLAreaElementPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -8095,6 +8105,8 @@
</span><span class="cx">                 1AE42F670AA4B8CB00C8612D /* cf */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                1CEFC9B70D78DC8C007D2579 /* SchedulePair.h */,
+                                1CEFC9B80D78DC8C007D2579 /* SchedulePair.cpp */,
</ins><span class="cx">                                 1A98956A0AA78F80005EF5EF /* KURLCFNet.cpp */,
</span><span class="cx">                                 5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */,
</span><span class="cx">                         );
</span><span class="lines">@@ -8346,6 +8358,7 @@
</span><span class="cx">                                 BC7B2AF90450824100A8000F /* PlatformScrollBarMac.mm */,
</span><span class="cx">                                 A82398A709B3ACF500B60641 /* PlugInInfoStoreMac.mm */,
</span><span class="cx">                                 0668E18E0ADD9640004128E0 /* PopupMenuMac.mm */,
</span><ins>+                                1CE24F960D7CAF0E007E04C2 /* SchedulePairMac.mm */,
</ins><span class="cx">                                 BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */,
</span><span class="cx">                                 9353676A09AED88B00D35CD6 /* ScrollViewMac.mm */,
</span><span class="cx">                                 AB71709F0B31193B0017123E /* SearchPopupMenuMac.mm */,
</span><span class="lines">@@ -9720,6 +9733,7 @@
</span><span class="cx">                 93A1EAA20A5634D8006960A0 /* mac */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                1C2649790D7E248A00BD10F2 /* DocumentLoaderMac.cpp */,
</ins><span class="cx">                                 656D371A0ADBA5DE00A4554D /* LoaderNSURLExtras.h */,
</span><span class="cx">                                 656D371B0ADBA5DE00A4554D /* LoaderNSURLExtras.m */,
</span><span class="cx">                                 51AA3F6E0BD5AA9E00892971 /* ResourceLoaderMac.mm */,
</span><span class="lines">@@ -9742,6 +9756,7 @@
</span><span class="cx">                                 93C09A7E0B064EEF005ABD4D /* EventHandlerMac.mm */,
</span><span class="cx">                                 A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */,
</span><span class="cx">                                 65BF023C0974819000C43196 /* FrameMac.mm */,
</span><ins>+                                1C26497B0D7E24EC00BD10F2 /* PageMac.cpp */,
</ins><span class="cx">                                 654EC60F097778F500DAB52C /* WebCoreFrameBridge.h */,
</span><span class="cx">                                 654EC610097778F500DAB52C /* WebCoreFrameBridge.mm */,
</span><span class="cx">                                 F587854C02DE375901EA4122 /* WebCoreFrameView.h */,
</span><span class="lines">@@ -14226,6 +14241,7 @@
</span><span class="cx">                                 A779791A0D6B9D0C003851B9 /* ImageData.h in Headers */,
</span><span class="cx">                                 A77979270D6B9E64003851B9 /* JSCanvasPixelArray.h in Headers */,
</span><span class="cx">                                 A77979290D6B9E64003851B9 /* JSImageData.h in Headers */,
</span><ins>+                                1CEFC9B90D78DC8C007D2579 /* SchedulePair.h in Headers */,
</ins><span class="cx">                                 1AF326480D78B5530068F0C4 /* WebCoreAXObject.h in Headers */,
</span><span class="cx">                                 1AF3264A0D78B5530068F0C4 /* WebCoreScriptDebugger.h in Headers */,
</span><span class="cx">                                 1AF326780D78B9440068F0C4 /* AXObjectCache.h in Headers */,
</span><span class="lines">@@ -15824,13 +15840,17 @@
</span><span class="cx">                                 A77979260D6B9E64003851B9 /* JSCanvasPixelArray.cpp in Sources */,
</span><span class="cx">                                 A77979280D6B9E64003851B9 /* JSImageData.cpp in Sources */,
</span><span class="cx">                                 A766F3530D6BDE3500ABDDB3 /* JSCanvasPixelArrayCustom.cpp in Sources */,
</span><ins>+                                1CEFC9BA0D78DC8C007D2579 /* SchedulePair.cpp in Sources */,
</ins><span class="cx">                                 1AF326460D78B5530068F0C4 /* AXObjectCacheMac.mm in Sources */,
</span><span class="cx">                                 1AF326470D78B5530068F0C4 /* GlobalHistoryMac.mm in Sources */,
</span><span class="cx">                                 1AF326490D78B5530068F0C4 /* WebCoreAXObject.mm in Sources */,
</span><span class="cx">                                 1AF3264B0D78B5530068F0C4 /* WebCoreScriptDebugger.mm in Sources */,
</span><ins>+                                1CE24F970D7CAF0E007E04C2 /* SchedulePairMac.mm in Sources */,
</ins><span class="cx">                                 BCA83E4F0D7CE1E9003421A8 /* JSClipboard.cpp in Sources */,
</span><span class="cx">                                 BCA83E520D7CE205003421A8 /* JSClipboardCustom.cpp in Sources */,
</span><span class="cx">                                 BC6C49F30D7DBA0500FFA558 /* JSImageConstructor.cpp in Sources */,
</span><ins>+                                1C26497A0D7E248A00BD10F2 /* DocumentLoaderMac.cpp in Sources */,
+                                1C26497C0D7E24EC00BD10F2 /* PageMac.cpp in Sources */,
</ins><span class="cx">                                 BC3452430D7E00EA0016574A /* JSRGBColor.cpp in Sources */,
</span><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span></span></pre></div>
<a id="trunkWebCoreloaderDocumentLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/loader/DocumentLoader.h (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/loader/DocumentLoader.h        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebCore/loader/DocumentLoader.h        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx">     class KURL;
</span><span class="cx">     class MainResourceLoader;
</span><span class="cx">     class ResourceLoader;
</span><ins>+    class SchedulePair;
</ins><span class="cx">     class SharedBuffer;
</span><span class="cx">     class SubstituteData;
</span><span class="cx"> 
</span><span class="lines">@@ -114,6 +115,11 @@
</span><span class="cx">         void setTitle(const String&amp;);
</span><span class="cx">         String overrideEncoding() const;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
+        void schedule(SchedulePair*);
+        void unschedule(SchedulePair*);
+#endif
+
</ins><span class="cx">         void addResponse(const ResourceResponse&amp;);
</span><span class="cx">         const ResponseVector&amp; responses() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCoreloadermacDocumentLoaderMaccpp"></a>
<div class="addfile"><h4>Added: trunk/WebCore/loader/mac/DocumentLoaderMac.cpp (0 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/loader/mac/DocumentLoaderMac.cpp                                (rev 0)
+++ trunk/WebCore/loader/mac/DocumentLoaderMac.cpp        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;DocumentLoader.h&quot;
+#include &quot;MainResourceLoader.h&quot;
+#include &quot;ResourceHandle.h&quot;
+#include &quot;ResourceLoader.h&quot;
+
+namespace WebCore {
+
+static void scheduleAll(const ResourceLoaderSet&amp; loaders, SchedulePair* pair)
+{
+    const ResourceLoaderSet copy = loaders;
+    ResourceLoaderSet::const_iterator end = copy.end();
+    for (ResourceLoaderSet::const_iterator it = copy.begin(); it != end; ++it)
+        if (ResourceHandle* handle = (*it)-&gt;handle())
+            handle-&gt;schedule(pair);
+}
+
+static void unscheduleAll(const ResourceLoaderSet&amp; loaders, SchedulePair* pair)
+{
+    const ResourceLoaderSet copy = loaders;
+    ResourceLoaderSet::const_iterator end = copy.end();
+    for (ResourceLoaderSet::const_iterator it = copy.begin(); it != end; ++it)
+        if (ResourceHandle* handle = (*it)-&gt;handle())
+            handle-&gt;unschedule(pair);
+}
+
+void DocumentLoader::schedule(SchedulePair* pair)
+{
+    if (m_mainResourceLoader &amp;&amp; m_mainResourceLoader-&gt;handle())
+        m_mainResourceLoader-&gt;handle()-&gt;schedule(pair);
+    scheduleAll(m_subresourceLoaders, pair);
+    scheduleAll(m_plugInStreamLoaders, pair);
+    scheduleAll(m_multipartSubresourceLoaders, pair);
+}
+
+void DocumentLoader::unschedule(SchedulePair* pair)
+{
+    if (m_mainResourceLoader &amp;&amp; m_mainResourceLoader-&gt;handle())
+        m_mainResourceLoader-&gt;handle()-&gt;unschedule(pair);
+    unscheduleAll(m_subresourceLoaders, pair);
+    unscheduleAll(m_plugInStreamLoaders, pair);
+    unscheduleAll(m_multipartSubresourceLoaders, pair);
+}
+
+} // namespace
</ins></span></pre></div>
<a id="trunkWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/Page.h (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/Page.h        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebCore/page/Page.h        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -26,6 +26,9 @@
</span><span class="cx"> #include &quot;ContextMenuController.h&quot;
</span><span class="cx"> #include &quot;FrameLoaderTypes.h&quot;
</span><span class="cx"> #include &quot;PlatformString.h&quot;
</span><ins>+#if PLATFORM(MAC)
+#include &quot;SchedulePair.h&quot;
+#endif
</ins><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/OwnPtr.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -117,6 +120,14 @@
</span><span class="cx">         unsigned int markAllMatchesForText(const String&amp;, TextCaseSensitivity, bool shouldHighlight, unsigned);
</span><span class="cx">         void unmarkAllTextMatches();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
+        void addSchedulePair(PassRefPtr&lt;SchedulePair&gt;);
+        void removeSchedulePair(PassRefPtr&lt;SchedulePair&gt;);
+        SchedulePairHashSet* scheduledRunLoopPairs() { return m_scheduledRunLoopPairs.get(); }
+
+        OwnPtr&lt;SchedulePairHashSet&gt; m_scheduledRunLoopPairs;
+#endif
+
</ins><span class="cx">         const Selection&amp; selection() const;
</span><span class="cx"> 
</span><span class="cx">         void setDefersLoading(bool);
</span></span></pre></div>
<a id="trunkWebCorepagemacPageMaccpp"></a>
<div class="addfile"><h4>Added: trunk/WebCore/page/mac/PageMac.cpp (0 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/mac/PageMac.cpp                                (rev 0)
+++ trunk/WebCore/page/mac/PageMac.cpp        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;DocumentLoader.h&quot;
+#include &quot;Frame.h&quot;
+#include &quot;FrameLoader.h&quot;
+#include &quot;FrameTree.h&quot;
+#include &quot;Page.h&quot;
+
+namespace WebCore {
+
+void Page::addSchedulePair(PassRefPtr&lt;SchedulePair&gt; prpPair)
+{
+    RefPtr&lt;SchedulePair&gt; pair = prpPair;
+
+    if (!m_scheduledRunLoopPairs)
+        m_scheduledRunLoopPairs.set(new SchedulePairHashSet);
+    m_scheduledRunLoopPairs-&gt;add(pair);
+
+    for (Frame* frame = m_mainFrame.get(); frame; frame = frame-&gt;tree()-&gt;traverseNext()) {
+        if (DocumentLoader* documentLoader = frame-&gt;loader()-&gt;documentLoader())
+            documentLoader-&gt;schedule(pair.get());
+        if (DocumentLoader* documentLoader = frame-&gt;loader()-&gt;provisionalDocumentLoader())
+            documentLoader-&gt;schedule(pair.get());
+    }
+
+    // FIXME: make SharedTimerMac use these SchedulePairs.
+}
+
+void Page::removeSchedulePair(PassRefPtr&lt;SchedulePair&gt; prpPair)
+{
+    ASSERT(m_scheduledRunLoopPairs);
+    if (!m_scheduledRunLoopPairs)
+        return;
+
+    RefPtr&lt;SchedulePair&gt; pair = prpPair;
+    m_scheduledRunLoopPairs-&gt;remove(pair);
+
+    for (Frame* frame = m_mainFrame.get(); frame; frame = frame-&gt;tree()-&gt;traverseNext()) {
+        if (DocumentLoader* documentLoader = frame-&gt;loader()-&gt;documentLoader())
+            documentLoader-&gt;unschedule(pair.get());
+        if (DocumentLoader* documentLoader = frame-&gt;loader()-&gt;provisionalDocumentLoader())
+            documentLoader-&gt;unschedule(pair.get());
+    }
+}
+
+} // namespace
</ins></span></pre></div>
<a id="trunkWebCoreplatformcfSchedulePaircpp"></a>
<div class="addfile"><h4>Added: trunk/WebCore/platform/cf/SchedulePair.cpp (0 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/cf/SchedulePair.cpp                                (rev 0)
+++ trunk/WebCore/platform/cf/SchedulePair.cpp        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;SchedulePair.h&quot;
+
+namespace WebCore {
+
+SchedulePair::SchedulePair(CFRunLoopRef runLoop, CFStringRef mode)
+    : m_runLoop(runLoop)
+{
+    if (mode)
+        m_mode.adoptCF(CFStringCreateCopy(0, mode));
+}
+
+bool SchedulePair::operator==(const SchedulePair&amp; other) const
+{
+    if (runLoop() != other.runLoop())
+        return false;
+    CFStringRef thisMode = mode();
+    CFStringRef otherMode = other.mode();
+    if (!thisMode || !otherMode)
+        return thisMode == otherMode;
+    return CFEqual(thisMode, otherMode);
+}
+
+} // namespace
</ins></span></pre></div>
<a id="trunkWebCoreplatformcfSchedulePairh"></a>
<div class="addfile"><h4>Added: trunk/WebCore/platform/cf/SchedulePair.h (0 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/cf/SchedulePair.h                                (rev 0)
+++ trunk/WebCore/platform/cf/SchedulePair.h        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -0,0 +1,105 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SchedulePair_h
+#define SchedulePair_h
+
+#include &quot;PlatformString.h&quot;
+
+#include &lt;wtf/HashSet.h&gt;
+#include &lt;wtf/HashTraits.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+
+#if PLATFORM(MAC)
+#ifdef __OBJC__
+@class NSRunLoop;
+#else
+class NSRunLoop;
+#endif
+#endif
+
+namespace WebCore {
+
+class SchedulePair : public RefCounted&lt;SchedulePair&gt; {
+public:
+    static PassRefPtr&lt;SchedulePair&gt; create(CFRunLoopRef runLoop, CFStringRef mode) { return adoptRef(new SchedulePair(runLoop, mode)); }
+
+#if PLATFORM(MAC)
+    static PassRefPtr&lt;SchedulePair&gt; create(NSRunLoop* runLoop, CFStringRef mode) { return adoptRef(new SchedulePair(runLoop, mode)); }
+    NSRunLoop* nsRunLoop() const { return m_nsRunLoop.get(); }
+#endif
+
+    CFRunLoopRef runLoop() const { return m_runLoop.get(); }
+    CFStringRef mode() const { return m_mode.get(); }
+
+    bool operator==(const SchedulePair&amp; other) const;
+
+private:
+    SchedulePair(CFRunLoopRef, CFStringRef);
+
+#if PLATFORM(MAC)
+    SchedulePair(NSRunLoop*, CFStringRef);
+    RetainPtr&lt;NSRunLoop*&gt; m_nsRunLoop;
+#endif
+
+    RetainPtr&lt;CFRunLoopRef&gt; m_runLoop;
+    RetainPtr&lt;CFStringRef&gt; m_mode;
+};
+
+struct SchedulePairHash {
+    static unsigned hash(const RefPtr&lt;SchedulePair&gt;&amp; pair)
+    {
+        uintptr_t hashCodes[2] = { reinterpret_cast&lt;uintptr_t&gt;(pair-&gt;runLoop()), pair-&gt;mode() ? CFHash(pair-&gt;mode()) : 0 };
+        return StringImpl::computeHash(reinterpret_cast&lt;UChar*&gt;(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+    }
+
+    static bool equal(const RefPtr&lt;SchedulePair&gt;&amp; a, const RefPtr&lt;SchedulePair&gt;&amp; b) { return a == b; }
+
+    static const bool safeToCompareToEmptyOrDeleted = true;
+};
+
+struct SchedulePairTraits : WTF::GenericHashTraits&lt;RefPtr&lt;SchedulePair&gt; &gt; {
+    static const bool emptyValueIsZero = true;
+
+    static const RefPtr&lt;SchedulePair&gt;&amp; deletedValue() 
+    {
+        static const RefPtr&lt;SchedulePair&gt; SchedulePairDeletedValue = SchedulePair::create(static_cast&lt;CFRunLoopRef&gt;(0), 0);    
+        return SchedulePairDeletedValue; 
+    }
+
+    static SchedulePair* emptyValue() { return 0; }
+};
+
+typedef HashSet&lt;RefPtr&lt;SchedulePair&gt;, SchedulePairHash, SchedulePairTraits &gt; SchedulePairHashSet;
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkWebCoreplatformmacSchedulePairMacmm"></a>
<div class="addfile"><h4>Added: trunk/WebCore/platform/mac/SchedulePairMac.mm (0 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/mac/SchedulePairMac.mm                                (rev 0)
+++ trunk/WebCore/platform/mac/SchedulePairMac.mm        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#include &quot;SchedulePair.h&quot;
+
+namespace WebCore {
+
+SchedulePair::SchedulePair(NSRunLoop* runLoop, CFStringRef mode)
+    : m_nsRunLoop(runLoop)
+    , m_runLoop([runLoop getCFRunLoop])
+{
+    if (mode)
+        m_mode.adoptCF(CFStringCreateCopy(0, mode));
+}
+
+} // namespace
</ins></span></pre></div>
<a id="trunkWebCoreplatformnetworkResourceHandleh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/network/ResourceHandle.h (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/network/ResourceHandle.h        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebCore/platform/network/ResourceHandle.h        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -78,6 +78,7 @@
</span><span class="cx"> class ResourceHandleInternal;
</span><span class="cx"> class ResourceRequest;
</span><span class="cx"> class ResourceResponse;
</span><ins>+class SchedulePair;
</ins><span class="cx"> class SharedBuffer;
</span><span class="cx"> class SubresourceLoader;
</span><span class="cx"> class SubresourceLoaderClient;
</span><span class="lines">@@ -103,11 +104,16 @@
</span><span class="cx">     void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&amp;);
</span><span class="cx">     void receivedCancellation(const AuthenticationChallenge&amp;);
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     void didCancelAuthenticationChallenge(const AuthenticationChallenge&amp;);
</span><span class="cx">     NSURLConnection *connection() const;
</span><span class="cx">     WebCoreResourceHandleAsDelegate *delegate();
</span><span class="cx">     void releaseDelegate();
</span><ins>+    id releaseProxy();
+
+    void schedule(SchedulePair*);
+    void unschedule(SchedulePair*);
</ins><span class="cx"> #elif USE(CFNETWORK)
</span><span class="cx">     static CFRunLoopRef loaderRunLoop();
</span><span class="cx">     CFURLConnectionRef connection() const;
</span><span class="lines">@@ -116,12 +122,9 @@
</span><span class="cx">     static void setHostAllowsAnyHTTPSCertificate(const String&amp;);
</span><span class="cx">     static void setClientCertificate(const String&amp; host, CFDataRef);
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx">     PassRefPtr&lt;SharedBuffer&gt; bufferedData();
</span><span class="cx">     static bool supportsBufferedData();
</span><del>-    
-#if PLATFORM(MAC)
-    id releaseProxy();
-#endif
</del><span class="cx"> 
</span><span class="cx"> #if USE(WININET)
</span><span class="cx">     void setHasReceivedResponse(bool = true);
</span></span></pre></div>
<a id="trunkWebCoreplatformnetworkResourceHandleInternalh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/network/ResourceHandleInternal.h (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/network/ResourceHandleInternal.h        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebCore/platform/network/ResourceHandleInternal.h        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -107,6 +107,7 @@
</span><span class="cx">             , m_frame(0)
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(MAC)
</span><ins>+            , m_startWhenScheduled(false)
</ins><span class="cx">             , m_currentMacChallenge(nil)
</span><span class="cx"> #elif USE(CFNETWORK)
</span><span class="cx">             , m_currentCFChallenge(0)
</span><span class="lines">@@ -132,6 +133,7 @@
</span><span class="cx">         RetainPtr&lt;NSURLConnection&gt; m_connection;
</span><span class="cx">         RetainPtr&lt;WebCoreResourceHandleAsDelegate&gt; m_delegate;
</span><span class="cx">         RetainPtr&lt;id&gt; m_proxy;
</span><ins>+        bool m_startWhenScheduled;
</ins><span class="cx"> #endif
</span><span class="cx"> #if USE(WININET)
</span><span class="cx">         HANDLE m_fileHandle;
</span></span></pre></div>
<a id="trunkWebCoreplatformnetworkmacFormDataStreamMacmm"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/network/mac/FormDataStreamMac.mm (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/network/mac/FormDataStreamMac.mm        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebCore/platform/network/mac/FormDataStreamMac.mm        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;CString.h&quot;
</span><span class="cx"> #import &quot;FormData.h&quot;
</span><ins>+#import &quot;SchedulePair.h&quot;
</ins><span class="cx"> #import &quot;WebCoreSystemInterface.h&quot;
</span><span class="cx"> #import &lt;sys/stat.h&gt;
</span><span class="cx"> #import &lt;sys/types.h&gt;
</span><span class="lines">@@ -50,53 +51,13 @@
</span><span class="cx"> static void formEventCallback(CFReadStreamRef stream, CFStreamEventType type, void* context);
</span><span class="cx"> 
</span><span class="cx"> struct FormStreamFields {
</span><del>-    CFMutableSetRef scheduledRunLoopPairs;
</del><ins>+    SchedulePairHashSet scheduledRunLoopPairs;
</ins><span class="cx">     Vector&lt;FormDataElement&gt; remainingElements; // in reverse order
</span><span class="cx">     CFReadStreamRef currentStream;
</span><span class="cx">     char* currentData;
</span><span class="cx">     CFReadStreamRef formStream;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-struct SchedulePair {
-    CFRunLoopRef runLoop;
-    CFStringRef mode;
-};
-
-static const void* pairRetain(CFAllocatorRef alloc, const void* value)
-{
-    const SchedulePair* pair = static_cast&lt;const SchedulePair*&gt;(value);
-
-    SchedulePair* result = new SchedulePair;
-    CFRetain(pair-&gt;runLoop);
-    result-&gt;runLoop = pair-&gt;runLoop;
-    result-&gt;mode = CFStringCreateCopy(alloc, pair-&gt;mode);
-    return result;
-}
-
-static void pairRelease(CFAllocatorRef alloc, const void* value)
-{
-    const SchedulePair* pair = static_cast&lt;const SchedulePair*&gt;(value);
-
-    CFRelease(pair-&gt;runLoop);
-    CFRelease(pair-&gt;mode);
-    delete pair;
-}
-
-static Boolean pairEqual(const void* a, const void* b)
-{
-    const SchedulePair* pairA = static_cast&lt;const SchedulePair*&gt;(a);
-    const SchedulePair* pairB = static_cast&lt;const SchedulePair*&gt;(b);
-
-    return pairA-&gt;runLoop == pairB-&gt;runLoop &amp;&amp; CFEqual(pairA-&gt;mode, pairB-&gt;mode);
-}
-
-static CFHashCode pairHash(const void* value)
-{
-    const SchedulePair* pair = static_cast&lt;const SchedulePair*&gt;(value);
-
-    return (CFHashCode)pair-&gt;runLoop ^ CFHash(pair-&gt;mode);
-}
-
</del><span class="cx"> static void closeCurrentStream(FormStreamFields *form)
</span><span class="cx"> {
</span><span class="cx">     if (form-&gt;currentStream) {
</span><span class="lines">@@ -111,14 +72,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void scheduleWithPair(const void* value, void* context)
-{
-    const SchedulePair* pair = static_cast&lt;const SchedulePair*&gt;(value);
-    CFReadStreamRef stream = (CFReadStreamRef)context;
-
-    CFReadStreamScheduleWithRunLoop(stream, pair-&gt;runLoop, pair-&gt;mode);
-}
-
</del><span class="cx"> static void advanceCurrentStream(FormStreamFields *form)
</span><span class="cx"> {
</span><span class="cx">     closeCurrentStream(form);
</span><span class="lines">@@ -148,7 +101,9 @@
</span><span class="cx">         formEventCallback, &amp;context);
</span><span class="cx"> 
</span><span class="cx">     // Schedule with the current set of run loops.
</span><del>-    CFSetApplyFunction(form-&gt;scheduledRunLoopPairs, scheduleWithPair, form-&gt;currentStream);
</del><ins>+    SchedulePairHashSet::iterator end = form-&gt;scheduledRunLoopPairs.end();
+    for (SchedulePairHashSet::iterator it = form-&gt;scheduledRunLoopPairs.begin(); it != end; ++it)
+        CFReadStreamScheduleWithRunLoop(form-&gt;currentStream, (*it)-&gt;runLoop(), (*it)-&gt;mode());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void openNextStream(FormStreamFields* form)
</span><span class="lines">@@ -165,10 +120,7 @@
</span><span class="cx"> {
</span><span class="cx">     FormData* formData = static_cast&lt;FormData*&gt;(context);
</span><span class="cx"> 
</span><del>-    CFSetCallBacks runLoopAndModeCallBacks = { 0, pairRetain, pairRelease, NULL, pairEqual, pairHash };
-
</del><span class="cx">     FormStreamFields* newInfo = new FormStreamFields;
</span><del>-    newInfo-&gt;scheduledRunLoopPairs = CFSetCreateMutable(0, 0, &amp;runLoopAndModeCallBacks);
</del><span class="cx">     newInfo-&gt;currentStream = NULL;
</span><span class="cx">     newInfo-&gt;currentData = 0;
</span><span class="cx">     newInfo-&gt;formStream = stream; // Don't retain. That would create a reference cycle.
</span><span class="lines">@@ -191,7 +143,6 @@
</span><span class="cx">     getStreamFormDatas().remove(stream);
</span><span class="cx"> 
</span><span class="cx">     closeCurrentStream(form);
</span><del>-    CFRelease(form-&gt;scheduledRunLoopPairs);
</del><span class="cx">     delete form;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -256,8 +207,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (form-&gt;currentStream)
</span><span class="cx">         CFReadStreamScheduleWithRunLoop(form-&gt;currentStream, runLoop, runLoopMode);
</span><del>-    SchedulePair pair = { runLoop, runLoopMode };
-    CFSetAddValue(form-&gt;scheduledRunLoopPairs, &amp;pair);
</del><ins>+    form-&gt;scheduledRunLoopPairs.add(SchedulePair::create(runLoop, runLoopMode));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void formUnschedule(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void* context)
</span><span class="lines">@@ -266,8 +216,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (form-&gt;currentStream)
</span><span class="cx">         CFReadStreamUnscheduleFromRunLoop(form-&gt;currentStream, runLoop, runLoopMode);
</span><del>-    SchedulePair pair = { runLoop, runLoopMode };
-    CFSetRemoveValue(form-&gt;scheduledRunLoopPairs, &amp;pair);
</del><ins>+    form-&gt;scheduledRunLoopPairs.remove(SchedulePair::create(runLoop, runLoopMode));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void formEventCallback(CFReadStreamRef stream, CFStreamEventType type, void* context)
</span></span></pre></div>
<a id="trunkWebCoreplatformnetworkmacResourceHandleMacmm"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/network/mac/ResourceHandleMac.mm (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/network/mac/ResourceHandleMac.mm        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebCore/platform/network/mac/ResourceHandleMac.mm        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -32,8 +32,10 @@
</span><span class="cx"> #import &quot;DocLoader.h&quot;
</span><span class="cx"> #import &quot;Frame.h&quot;
</span><span class="cx"> #import &quot;FrameLoader.h&quot;
</span><ins>+#import &quot;Page.h&quot;
</ins><span class="cx"> #import &quot;ResourceError.h&quot;
</span><span class="cx"> #import &quot;ResourceResponse.h&quot;
</span><ins>+#import &quot;SchedulePair.h&quot;
</ins><span class="cx"> #import &quot;SharedBuffer.h&quot;
</span><span class="cx"> #import &quot;SubresourceLoader.h&quot;
</span><span class="cx"> #import &quot;AuthenticationChallenge.h&quot;
</span><span class="lines">@@ -119,9 +121,10 @@
</span><span class="cx"> 
</span><span class="cx">     // If we are no longer attached to a Page, this must be an attempted load from an
</span><span class="cx">     // onUnload handler, so let's just block it.
</span><del>-    if (!frame-&gt;page())
</del><ins>+    Page* page = frame-&gt;page();
+    if (!page)
</ins><span class="cx">         return false;
</span><del>-  
</del><ins>+
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     isInitializingConnection = YES;
</span><span class="cx"> #endif
</span><span class="lines">@@ -141,15 +144,42 @@
</span><span class="cx">     NSURLConnection *connection;
</span><span class="cx">     
</span><span class="cx">     if (d-&gt;m_shouldContentSniff) 
</span><ins>+#ifdef BUILDING_ON_TIGER
</ins><span class="cx">         connection = [[NSURLConnection alloc] initWithRequest:d-&gt;m_request.nsURLRequest() delegate:delegate];
</span><ins>+#else
+        connection = [[NSURLConnection alloc] initWithRequest:d-&gt;m_request.nsURLRequest() delegate:delegate startImmediately:NO];
+#endif
</ins><span class="cx">     else {
</span><span class="cx">         NSMutableURLRequest *request = [d-&gt;m_request.nsURLRequest() mutableCopy];
</span><span class="cx">         wkSetNSURLRequestShouldContentSniff(request, NO);
</span><ins>+#ifdef BUILDING_ON_TIGER
</ins><span class="cx">         connection = [[NSURLConnection alloc] initWithRequest:request delegate:delegate];
</span><ins>+#else
+        connection = [[NSURLConnection alloc] initWithRequest:request delegate:delegate startImmediately:NO];
+#endif
</ins><span class="cx">         [request release];
</span><span class="cx">     }
</span><del>-    
-    
</del><ins>+
+#ifndef BUILDING_ON_TIGER
+    bool scheduled = false;
+    if (SchedulePairHashSet* scheduledPairs = page-&gt;scheduledRunLoopPairs()) {
+        SchedulePairHashSet::iterator end = scheduledPairs-&gt;end();
+        for (SchedulePairHashSet::iterator it = scheduledPairs-&gt;begin(); it != end; ++it) {
+            if (NSRunLoop *runLoop = (*it)-&gt;nsRunLoop()) {
+                [connection scheduleInRunLoop:runLoop forMode:(NSString *)(*it)-&gt;mode()];
+                scheduled = true;
+            }
+        }
+    }
+
+    // Start the connection if we did schedule with at least one runloop.
+    // We can't start the connection until we have one runloop scheduled.
+    if (scheduled)
+        [connection start];
+    else
+        d-&gt;m_startWhenScheduled = true;
+#endif
+
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     isInitializingConnection = NO;
</span><span class="cx"> #endif
</span><span class="lines">@@ -157,7 +187,7 @@
</span><span class="cx">     [connection release];
</span><span class="cx">     if (d-&gt;m_defersLoading)
</span><span class="cx">         wkSetNSURLConnectionDefersCallbacks(d-&gt;m_connection.get(), YES);
</span><del>-    
</del><ins>+
</ins><span class="cx">     if (d-&gt;m_connection)
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="lines">@@ -177,6 +207,24 @@
</span><span class="cx">     wkSetNSURLConnectionDefersCallbacks(d-&gt;m_connection.get(), defers);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ResourceHandle::schedule(SchedulePair* pair)
+{
+    NSRunLoop *runLoop = pair-&gt;nsRunLoop();
+    if (!runLoop)
+        return;
+    [d-&gt;m_connection.get() scheduleInRunLoop:runLoop forMode:(NSString *)pair-&gt;mode()];
+    if (d-&gt;m_startWhenScheduled) {
+        [d-&gt;m_connection.get() start];
+        d-&gt;m_startWhenScheduled = false;
+    }
+}
+
+void ResourceHandle::unschedule(SchedulePair* pair)
+{
+    if (NSRunLoop *runLoop = pair-&gt;nsRunLoop())
+        [d-&gt;m_connection.get() unscheduleFromRunLoop:runLoop forMode:(NSString *)pair-&gt;mode()];
+}
+
</ins><span class="cx"> WebCoreResourceHandleAsDelegate *ResourceHandle::delegate()
</span><span class="cx"> {
</span><span class="cx">     if (!d-&gt;m_delegate) {
</span></span></pre></div>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebKit/mac/ChangeLog        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2008-03-04  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Reviewed by Darin Adler.
+
+        &lt;rdar://problem/5720160&gt; Browser windows &quot;do nothing&quot; 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.
+
</ins><span class="cx"> 2008-03-04  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin.
</span></span></pre></div>
<a id="trunkWebKitmacMiscWebKitVersionChecksh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Misc/WebKitVersionChecks.h (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Misc/WebKitVersionChecks.h        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebKit/mac/Misc/WebKitVersionChecks.h        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> #define WEBKIT_FIRST_VERSION_WITH_CACHE_MODEL_API 0x020B0500 // 523.5.0
</span><span class="cx"> #define WEBKIT_FIRST_VERSION_WITHOUT_JAVASCRIPT_RETURN_QUIRK 0x020D0100 // 525.1.0
</span><span class="cx"> #define WEBKIT_FIRST_VERSION_WITH_IE_COMPATIBLE_KEYBOARD_EVENT_DISPATCH 0x020D0100 // 525.1.0
</span><ins>+#define WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES 0x020E0000 // 526.0.0
</ins><span class="cx"> 
</span><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> extern &quot;C&quot; {
</span></span></pre></div>
<a id="trunkWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebView/WebView.mm (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebView/WebView.mm        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebKit/mac/WebView/WebView.mm        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -1823,6 +1823,11 @@
</span><span class="cx">     _private-&gt;page = new Page(new WebChromeClient(self), new WebContextMenuClient(self), new WebEditorClient(self), new WebDragClient(self), new WebInspectorClient(self));
</span><span class="cx">     [[[WebFrameBridge alloc] initMainFrameWithPage:_private-&gt;page frameName:frameName frameView:frameView] release];
</span><span class="cx"> 
</span><ins>+    if (WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES))
+        [self scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
+    else
+        [self scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
+
</ins><span class="cx">     [self _addToAllWebViewsSet];
</span><span class="cx">     [self setGroupName:groupName];
</span><span class="cx">     
</span><span class="lines">@@ -1831,9 +1836,8 @@
</span><span class="cx">     // contained frame view. This works together with our becomeFirstResponder 
</span><span class="cx">     // and setNextKeyView overrides.
</span><span class="cx">     NSView *nextKeyView = [self nextKeyView];
</span><del>-    if (nextKeyView != nil &amp;&amp; nextKeyView != frameView) {
</del><ins>+    if (nextKeyView &amp;&amp; nextKeyView != frameView)
</ins><span class="cx">         [frameView setNextKeyView:nextKeyView];
</span><del>-    }
</del><span class="cx">     [super setNextKeyView:frameView];
</span><span class="cx"> 
</span><span class="cx">     ++WebViewCount;
</span><span class="lines">@@ -2838,6 +2842,18 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WebView (WebPendingPublic)
</span><span class="cx"> 
</span><ins>+- (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode
+{
+    if (runLoop &amp;&amp; mode)
+        core(self)-&gt;addSchedulePair(SchedulePair::create(runLoop, (CFStringRef)mode));
+}
+
+- (void)unscheduleFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode
+{
+    if (runLoop &amp;&amp; mode)
+        core(self)-&gt;removeSchedulePair(SchedulePair::create(runLoop, (CFStringRef)mode));
+}
+
</ins><span class="cx"> - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection
</span><span class="cx"> {
</span><span class="cx">     if (_private-&gt;closed)
</span></span></pre></div>
<a id="trunkWebKitmacWebViewWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebView/WebViewPrivate.h (30777 => 30778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebView/WebViewPrivate.h        2008-03-05 00:53:11 UTC (rev 30777)
+++ trunk/WebKit/mac/WebView/WebViewPrivate.h        2008-03-05 00:57:26 UTC (rev 30778)
</span><span class="lines">@@ -84,6 +84,9 @@
</span><span class="cx"> 
</span><span class="cx"> @interface WebView (WebPendingPublic)
</span><span class="cx"> 
</span><ins>+- (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode;
+- (void)unscheduleFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode;
+
</ins><span class="cx"> /*!
</span><span class="cx"> @method searchFor:direction:caseSensitive:wrap:startInSelection:
</span><span class="cx">  @abstract Searches a document view for a string and highlights the string if it is found.
</span></span></pre>
</div>
</div>

</body>
</html>