<!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" />
<title>[167183] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/167183">167183</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2014-04-12 12:10:56 -0700 (Sat, 12 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Some small loader refinements and refactoring
https://bugs.webkit.org/show_bug.cgi?id=131541

Reviewed by Alexey Proskuryakov.

Cut down on use of ResourceLoader::handle, which always returns null when
using a network process. Also streamlined conditionals and did some other
small refactoring.

* loader/DocumentLoader.h: Use references rather than pointers for SchedulePair.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didChangePriority): Use m_handle instead of handle(),
since we'd like to delete handle() entirely soon.
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge): Ditto.
(WebCore::ResourceLoader::schedule): Added.
(WebCore::ResourceLoader::unschedule): Ditto.
* loader/ResourceLoader.h: Rearranged header to eliminate nested conditionals.
Added schedule and unschedule functions for Mac.

* loader/mac/DocumentLoaderMac.cpp:
(WebCore::scheduleAll): Changed to take a reference and call ResourceLoader::schedule.
(WebCore::unscheduleAll): Ditto.
(WebCore::DocumentLoader::schedule): Ditto.
(WebCore::DocumentLoader::unschedule): Ditto.

* page/mac/PageMac.cpp:
(WebCore::Page::addSchedulePair): Pass a reference rather than a pointer to schedule.
(WebCore::Page::removeSchedulePair): Ditto.

* platform/network/ResourceHandle.h: Did a bit of reformatting and reorganizing of
conditionals.

* platform/network/ResourceHandleInternal.h: Removed a tiny bit of unneeded declaration.

* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::schedule): Updated to take a reference rather than a pointer.
(WebCore::ResourceHandle::unschedule): Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoaderh">trunk/Source/WebCore/loader/DocumentLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadercpp">trunk/Source/WebCore/loader/ResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoaderh">trunk/Source/WebCore/loader/ResourceLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloadermacDocumentLoaderMaccpp">trunk/Source/WebCore/loader/mac/DocumentLoaderMac.cpp</a></li>
<li><a href="#trunkSourceWebCorepagemacPageMaccpp">trunk/Source/WebCore/page/mac/PageMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandleh">trunk/Source/WebCore/platform/network/ResourceHandle.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandleInternalh">trunk/Source/WebCore/platform/network/ResourceHandleInternal.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacResourceHandleMacmm">trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (167182 => 167183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-12 18:22:27 UTC (rev 167182)
+++ trunk/Source/WebCore/ChangeLog        2014-04-12 19:10:56 UTC (rev 167183)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2014-04-11  Darin Adler  &lt;darin@apple.com&gt;
+
+        Some small loader refinements and refactoring
+        https://bugs.webkit.org/show_bug.cgi?id=131541
+
+        Reviewed by Alexey Proskuryakov.
+
+        Cut down on use of ResourceLoader::handle, which always returns null when
+        using a network process. Also streamlined conditionals and did some other
+        small refactoring.
+
+        * loader/DocumentLoader.h: Use references rather than pointers for SchedulePair.
+
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::didChangePriority): Use m_handle instead of handle(),
+        since we'd like to delete handle() entirely soon.
+        (WebCore::ResourceLoader::didReceiveAuthenticationChallenge): Ditto.
+        (WebCore::ResourceLoader::schedule): Added.
+        (WebCore::ResourceLoader::unschedule): Ditto.
+        * loader/ResourceLoader.h: Rearranged header to eliminate nested conditionals.
+        Added schedule and unschedule functions for Mac.
+
+        * loader/mac/DocumentLoaderMac.cpp:
+        (WebCore::scheduleAll): Changed to take a reference and call ResourceLoader::schedule.
+        (WebCore::unscheduleAll): Ditto.
+        (WebCore::DocumentLoader::schedule): Ditto.
+        (WebCore::DocumentLoader::unschedule): Ditto.
+
+        * page/mac/PageMac.cpp:
+        (WebCore::Page::addSchedulePair): Pass a reference rather than a pointer to schedule.
+        (WebCore::Page::removeSchedulePair): Ditto.
+
+        * platform/network/ResourceHandle.h: Did a bit of reformatting and reorganizing of
+        conditionals.
+
+        * platform/network/ResourceHandleInternal.h: Removed a tiny bit of unneeded declaration.
+
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::schedule): Updated to take a reference rather than a pointer.
+        (WebCore::ResourceHandle::unschedule): Ditto.
+
</ins><span class="cx"> 2014-04-11  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Make NodeList.length inline-cacheable by JSC.
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.h (167182 => 167183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.h        2014-04-12 18:22:27 UTC (rev 167182)
+++ trunk/Source/WebCore/loader/DocumentLoader.h        2014-04-12 19:10:56 UTC (rev 167183)
</span><span class="lines">@@ -51,15 +51,10 @@
</span><span class="cx"> #include &lt;wtf/RunLoopTimer.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-namespace WTF {
-class SchedulePair;
-}
-
</del><span class="cx"> namespace WebCore {
</span><ins>+
</ins><span class="cx">     class ApplicationCacheHost;
</span><del>-#if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
</del><span class="cx">     class Archive;
</span><del>-#endif
</del><span class="cx">     class ArchiveResource;
</span><span class="cx">     class ArchiveResourceCollection;
</span><span class="cx">     class CachedRawResource;
</span><span class="lines">@@ -144,9 +139,9 @@
</span><span class="cx">         void setTitle(const StringWithDirection&amp;);
</span><span class="cx">         const String&amp; overrideEncoding() const { return m_overrideEncoding; }
</span><span class="cx"> 
</span><del>-#if PLATFORM(COCOA)
-        void schedule(WTF::SchedulePair*);
-        void unschedule(WTF::SchedulePair*);
</del><ins>+#if PLATFORM(MAC)
+        void schedule(SchedulePair&amp;);
+        void unschedule(SchedulePair&amp;);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
</span><span class="lines">@@ -157,7 +152,7 @@
</span><span class="cx">         SharedBuffer* parsedArchiveData() const;
</span><span class="cx"> 
</span><span class="cx">         bool scheduleArchiveLoad(ResourceLoader*, const ResourceRequest&amp;);
</span><del>-#endif // ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
</del><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">         // Return the ArchiveResource for the URL only when loading an Archive
</span><span class="cx">         ArchiveResource* archiveResourceForURL(const URL&amp;) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (167182 => 167183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.cpp        2014-04-12 18:22:27 UTC (rev 167182)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp        2014-04-12 19:10:56 UTC (rev 167183)
</span><span class="lines">@@ -396,8 +396,8 @@
</span><span class="cx"> 
</span><span class="cx"> void ResourceLoader::didChangePriority(ResourceLoadPriority loadPriority)
</span><span class="cx"> {
</span><del>-    if (handle())
-        handle()-&gt;didChangePriority(loadPriority);
</del><ins>+    if (m_handle)
+        m_handle-&gt;didChangePriority(loadPriority);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ResourceLoader::cancel()
</span><span class="lines">@@ -536,7 +536,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ResourceLoader::didReceiveAuthenticationChallenge(const AuthenticationChallenge&amp; challenge)
</span><span class="cx"> {
</span><del>-    ASSERT(handle()-&gt;hasAuthenticationChallenge());
</del><ins>+    ASSERT(m_handle-&gt;hasAuthenticationChallenge());
</ins><span class="cx"> 
</span><span class="cx">     // Protect this in this delegate method since the additional processing can do
</span><span class="cx">     // anything including possibly derefing this; one example of this is Radar 3266216.
</span><span class="lines">@@ -552,7 +552,7 @@
</span><span class="cx">     // If we can't continue with credentials, we need to cancel the load altogether.
</span><span class="cx"> #if PLATFORM(COCOA) || USE(CFNETWORK) || USE(CURL) || PLATFORM(GTK) || PLATFORM(EFL)
</span><span class="cx">     challenge.authenticationClient()-&gt;receivedRequestToContinueWithoutCredential(challenge);
</span><del>-    ASSERT(!handle() || !handle()-&gt;hasAuthenticationChallenge());
</del><ins>+    ASSERT(!m_handle || !m_handle-&gt;hasAuthenticationChallenge());
</ins><span class="cx"> #else
</span><span class="cx">     didFail(blockedError());
</span><span class="cx"> #endif
</span><span class="lines">@@ -567,18 +567,22 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
</span><ins>+
</ins><span class="cx"> bool ResourceLoader::canAuthenticateAgainstProtectionSpace(const ProtectionSpace&amp; protectionSpace)
</span><span class="cx"> {
</span><span class="cx">     Ref&lt;ResourceLoader&gt; protect(*this);
</span><span class="cx">     return frameLoader()-&gt;client().canAuthenticateAgainstProtectionSpace(documentLoader(), identifier(), protectionSpace);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+
</ins><span class="cx"> RetainPtr&lt;CFDictionaryRef&gt; ResourceLoader::connectionProperties(ResourceHandle*)
</span><span class="cx"> {
</span><span class="cx">     return frameLoader()-&gt;connectionProperties(this);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void ResourceLoader::receivedCancellation(const AuthenticationChallenge&amp;)
</span><span class="lines">@@ -586,4 +590,20 @@
</span><span class="cx">     cancel();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
+
+void ResourceLoader::schedule(SchedulePair&amp; pair)
+{
+    if (m_handle)
+        m_handle-&gt;schedule(pair);
</ins><span class="cx"> }
</span><ins>+
+void ResourceLoader::unschedule(SchedulePair&amp; pair)
+{
+    if (m_handle)
+        m_handle-&gt;unschedule(pair);
+}
+
+#endif
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.h (167182 => 167183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.h        2014-04-12 18:22:27 UTC (rev 167182)
+++ trunk/Source/WebCore/loader/ResourceLoader.h        2014-04-12 19:10:56 UTC (rev 167183)
</span><span class="lines">@@ -34,14 +34,16 @@
</span><span class="cx"> #include &quot;ResourceLoaderTypes.h&quot;
</span><span class="cx"> #include &quot;ResourceRequest.h&quot;
</span><span class="cx"> #include &quot;ResourceResponse.h&quot;
</span><del>-
</del><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> 
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx"> #include &quot;QuickLook.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+namespace WTF {
+class SchedulePair;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class AuthenticationChallenge;
</span><span class="lines">@@ -50,7 +52,6 @@
</span><span class="cx"> class FrameLoader;
</span><span class="cx"> class URL;
</span><span class="cx"> class ResourceBuffer;
</span><del>-class ResourceHandle;
</del><span class="cx"> 
</span><span class="cx"> class ResourceLoader : public RefCounted&lt;ResourceLoader&gt;, protected ResourceHandleClient {
</span><span class="cx"> public:
</span><span class="lines">@@ -126,26 +127,30 @@
</span><span class="cx">     virtual bool shouldUseCredentialStorage(ResourceHandle*) override { return shouldUseCredentialStorage(); }
</span><span class="cx">     virtual void didReceiveAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge&amp; challenge) override { didReceiveAuthenticationChallenge(challenge); } 
</span><span class="cx">     virtual void didCancelAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge&amp; challenge) override { didCancelAuthenticationChallenge(challenge); } 
</span><ins>+    virtual void receivedCancellation(ResourceHandle*, const AuthenticationChallenge&amp; challenge) override { receivedCancellation(challenge); }
+
</ins><span class="cx"> #if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
</span><span class="cx">     virtual void didReceiveDataArray(ResourceHandle*, CFArrayRef dataArray) override;
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
</span><span class="cx">     virtual bool canAuthenticateAgainstProtectionSpace(ResourceHandle*, const ProtectionSpace&amp; protectionSpace) override { return canAuthenticateAgainstProtectionSpace(protectionSpace); }
</span><span class="cx"> #endif
</span><del>-    virtual void receivedCancellation(ResourceHandle*, const AuthenticationChallenge&amp; challenge) override { receivedCancellation(challenge); }
-#if PLATFORM(COCOA)
-#if USE(CFNETWORK)
</del><ins>+
+#if PLATFORM(COCOA) &amp;&amp; USE(CFNETWORK)
</ins><span class="cx">     virtual CFCachedURLResponseRef willCacheResponse(ResourceHandle*, CFCachedURLResponseRef) override;
</span><del>-#else
-    virtual NSCachedURLResponse* willCacheResponse(ResourceHandle*, NSCachedURLResponse*) override;
</del><span class="cx"> #endif
</span><del>-#endif // PLATFORM(COCOA)
</del><ins>+
</ins><span class="cx"> #if PLATFORM(WIN) &amp;&amp; USE(CFNETWORK)
</span><span class="cx">     // FIXME: Windows should use willCacheResponse - &lt;https://bugs.webkit.org/show_bug.cgi?id=57257&gt;.
</span><span class="cx">     virtual bool shouldCacheResponse(ResourceHandle*, CFCachedURLResponseRef) override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    const URL&amp; url() const { return m_request.url(); } 
</del><ins>+#if PLATFORM(COCOA) &amp;&amp; !USE(CFNETWORK)
+    virtual NSCachedURLResponse* willCacheResponse(ResourceHandle*, NSCachedURLResponse*) override;
+#endif
+
+    const URL&amp; url() const { return m_request.url(); }
</ins><span class="cx">     ResourceHandle* handle() const { return m_handle.get(); }
</span><span class="cx">     bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCallbacks == SendCallbacks; }
</span><span class="cx">     void setSendCallbackPolicy(SendCallbackPolicy sendLoadCallbacks) { m_options.sendLoadCallbacks = sendLoadCallbacks; }
</span><span class="lines">@@ -163,6 +168,11 @@
</span><span class="cx">     void setQuickLookHandle(PassOwnPtr&lt;QuickLookHandle&gt; handle) { m_quickLookHandle = handle; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
+    void schedule(WTF::SchedulePair&amp;);
+    void unschedule(WTF::SchedulePair&amp;);
+#endif
+
</ins><span class="cx"> protected:
</span><span class="cx">     ResourceLoader(Frame*, ResourceLoaderOptions);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloadermacDocumentLoaderMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/mac/DocumentLoaderMac.cpp (167182 => 167183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/mac/DocumentLoaderMac.cpp        2014-04-12 18:22:27 UTC (rev 167182)
+++ trunk/Source/WebCore/loader/mac/DocumentLoaderMac.cpp        2014-04-12 19:10:56 UTC (rev 167183)
</span><span class="lines">@@ -28,58 +28,47 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;DocumentLoader.h&quot;
</span><del>-#include &quot;ResourceHandle.h&quot;
</del><ins>+
</ins><span class="cx"> #include &quot;ResourceLoader.h&quot;
</span><del>-#include &lt;wtf/SchedulePair.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-#if !PLATFORM(IOS)
-static void scheduleAll(const ResourceLoaderMap&amp; loaders, SchedulePair* pair)
</del><ins>+#if PLATFORM(MAC)
+
+static void scheduleAll(const ResourceLoaderMap&amp; loaders, SchedulePair&amp; pair)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;RefPtr&lt;ResourceLoader&gt;&gt; loadersCopy;
</span><span class="cx">     copyValuesToVector(loaders, loadersCopy);
</span><del>-    for (auto&amp; loader : loadersCopy) {
-        if (ResourceHandle* handle = loader-&gt;handle())
-            handle-&gt;schedule(pair);
-    }
</del><ins>+    for (auto&amp; loader : loadersCopy)
+        loader-&gt;schedule(pair);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void unscheduleAll(const ResourceLoaderMap&amp; loaders, SchedulePair* pair)
</del><ins>+static void unscheduleAll(const ResourceLoaderMap&amp; loaders, SchedulePair&amp; pair)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;RefPtr&lt;ResourceLoader&gt;&gt; loadersCopy;
</span><span class="cx">     copyValuesToVector(loaders, loadersCopy);
</span><del>-    for (auto&amp; loader : loadersCopy) {
-        if (ResourceHandle* handle = loader-&gt;handle())
-            handle-&gt;unschedule(pair);
-    }
</del><ins>+    for (auto&amp; loader : loadersCopy)
+        loader-&gt;unschedule(pair);
</ins><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><del>-void DocumentLoader::schedule(SchedulePair* pair)
</del><ins>+void DocumentLoader::schedule(SchedulePair&amp; pair)
</ins><span class="cx"> {
</span><del>-#if !PLATFORM(IOS)
-    if (mainResourceLoader() &amp;&amp; mainResourceLoader()-&gt;handle())
-        mainResourceLoader()-&gt;handle()-&gt;schedule(pair);
</del><ins>+    if (mainResourceLoader())
+        mainResourceLoader()-&gt;schedule(pair);
</ins><span class="cx">     scheduleAll(m_subresourceLoaders, pair);
</span><span class="cx">     scheduleAll(m_plugInStreamLoaders, pair);
</span><span class="cx">     scheduleAll(m_multipartSubresourceLoaders, pair);
</span><del>-#else
-    UNUSED_PARAM(pair);
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DocumentLoader::unschedule(SchedulePair* pair)
</del><ins>+void DocumentLoader::unschedule(SchedulePair&amp; pair)
</ins><span class="cx"> {
</span><del>-#if !PLATFORM(IOS)
-    if (mainResourceLoader() &amp;&amp; mainResourceLoader()-&gt;handle())
-        mainResourceLoader()-&gt;handle()-&gt;unschedule(pair);
</del><ins>+    if (mainResourceLoader())
+        mainResourceLoader()-&gt;unschedule(pair);
</ins><span class="cx">     unscheduleAll(m_subresourceLoaders, pair);
</span><span class="cx">     unscheduleAll(m_plugInStreamLoaders, pair);
</span><span class="cx">     unscheduleAll(m_multipartSubresourceLoaders, pair);
</span><del>-#else
-    UNUSED_PARAM(pair);
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#endif
+
</ins><span class="cx"> } // namespace
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacPageMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/PageMac.cpp (167182 => 167183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/PageMac.cpp        2014-04-12 18:22:27 UTC (rev 167182)
+++ trunk/Source/WebCore/page/mac/PageMac.cpp        2014-04-12 19:10:56 UTC (rev 167183)
</span><span class="lines">@@ -47,9 +47,9 @@
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     for (Frame* frame = m_mainFrame.get(); frame; frame = frame-&gt;tree().traverseNext()) {
</span><span class="cx">         if (DocumentLoader* documentLoader = frame-&gt;loader().documentLoader())
</span><del>-            documentLoader-&gt;schedule(pair.get());
</del><ins>+            documentLoader-&gt;schedule(*pair);
</ins><span class="cx">         if (DocumentLoader* documentLoader = frame-&gt;loader().provisionalDocumentLoader())
</span><del>-            documentLoader-&gt;schedule(pair.get());
</del><ins>+            documentLoader-&gt;schedule(*pair);
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -68,9 +68,9 @@
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     for (Frame* frame = m_mainFrame.get(); frame; frame = frame-&gt;tree().traverseNext()) {
</span><span class="cx">         if (DocumentLoader* documentLoader = frame-&gt;loader().documentLoader())
</span><del>-            documentLoader-&gt;unschedule(pair.get());
</del><ins>+            documentLoader-&gt;unschedule(*pair);
</ins><span class="cx">         if (DocumentLoader* documentLoader = frame-&gt;loader().provisionalDocumentLoader())
</span><del>-            documentLoader-&gt;unschedule(pair.get());
</del><ins>+            documentLoader-&gt;unschedule(*pair);
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandle.h (167182 => 167183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandle.h        2014-04-12 18:22:27 UTC (rev 167182)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.h        2014-04-12 19:10:56 UTC (rev 167183)
</span><span class="lines">@@ -33,9 +33,13 @@
</span><span class="cx"> #include &lt;wtf/OwnPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(COCOA) || USE(CFNETWORK)
+#include &lt;wtf/RetainPtr.h&gt;
+#endif
+
</ins><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx"> #include &quot;QuickLook.h&quot;
</span><del>-#endif // USE(QUICK_LOOK)
</del><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if USE(SOUP)
</span><span class="cx"> typedef struct _GTlsCertificate GTlsCertificate;
</span><span class="lines">@@ -54,10 +58,6 @@
</span><span class="cx"> typedef LPVOID HINTERNET;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(COCOA) || USE(CFNETWORK)
-#include &lt;wtf/RetainPtr.h&gt;
-#endif
-
</del><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> OBJC_CLASS NSCachedURLResponse;
</span><span class="cx"> OBJC_CLASS NSData;
</span><span class="lines">@@ -84,6 +84,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+
</ins><span class="cx"> class AuthenticationChallenge;
</span><span class="cx"> class Credential;
</span><span class="cx"> class Frame;
</span><span class="lines">@@ -113,6 +114,7 @@
</span><span class="cx"> #if PLATFORM(COCOA) || USE(CFNETWORK)
</span><span class="cx">     void willSendRequest(ResourceRequest&amp;, const ResourceResponse&amp; redirectResponse);
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if PLATFORM(COCOA) || USE(CFNETWORK) || USE(CURL) || USE(SOUP)
</span><span class="cx">     bool shouldUseCredentialStorage();
</span><span class="cx">     void didReceiveAuthenticationChallenge(const AuthenticationChallenge&amp;);
</span><span class="lines">@@ -121,20 +123,22 @@
</span><span class="cx">     virtual void receivedCancellation(const AuthenticationChallenge&amp;) override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(COCOA)
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
</del><ins>+#if PLATFORM(COCOA) &amp;&amp; USE(PROTECTION_SPACE_AUTH_CALLBACK)
</ins><span class="cx">     bool canAuthenticateAgainstProtectionSpace(const ProtectionSpace&amp;);
</span><span class="cx"> #endif
</span><del>-#if !USE(CFNETWORK)
</del><ins>+
+#if PLATFORM(COCOA) &amp;&amp; !USE(CFNETWORK)
</ins><span class="cx">     void didCancelAuthenticationChallenge(const AuthenticationChallenge&amp;);
</span><span class="cx">     NSURLConnection *connection() const;
</span><span class="cx">     id delegate();
</span><span class="cx">     void releaseDelegate();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void schedule(WTF::SchedulePair*);
-    void unschedule(WTF::SchedulePair*);
</del><ins>+#if PLATFORM(MAC)
+    void schedule(WTF::SchedulePair&amp;);
+    void unschedule(WTF::SchedulePair&amp;);
</ins><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if USE(CFNETWORK)
</span><span class="cx">     CFURLStorageSessionRef storageSession() const;
</span><span class="cx">     CFURLConnectionRef connection() const;
</span><span class="lines">@@ -142,18 +146,18 @@
</span><span class="cx">     const ResourceRequest&amp; currentRequest() const;
</span><span class="cx">     static void setHostAllowsAnyHTTPSCertificate(const String&amp;);
</span><span class="cx">     static void setClientCertificate(const String&amp; host, CFDataRef);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx">     QuickLookHandle* quickLookHandle() { return m_quickLook.get(); }
</span><span class="cx">     void setQuickLookHandle(PassOwnPtr&lt;QuickLookHandle&gt; handle) { m_quickLook = handle; }
</span><del>-#endif // USE(QUICK_LOOK)
</del><ins>+#endif
</ins><span class="cx"> 
</span><del>-#endif // USE(CFNETWORK)
-
</del><span class="cx"> #if PLATFORM(WIN) &amp;&amp; USE(CURL)
</span><span class="cx">     static void setHostAllowsAnyHTTPSCertificate(const String&amp;);
</span><span class="cx">     static void setClientCertificateInfo(const String&amp;, const String&amp;, const String&amp;);
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if PLATFORM(WIN) &amp;&amp; USE(CURL) &amp;&amp; USE(CF)
</span><span class="cx">     static void setClientCertificate(const String&amp; host, CFDataRef);
</span><span class="cx"> #endif
</span><span class="lines">@@ -215,7 +219,8 @@
</span><span class="cx">     // Called in response to ResourceHandleClient::willCacheResponseAsync().
</span><span class="cx"> #if USE(CFNETWORK)
</span><span class="cx">     void continueWillCacheResponse(CFCachedURLResponseRef);
</span><del>-#elif PLATFORM(COCOA)
</del><ins>+#endif
+#if PLATFORM(COCOA) &amp;&amp; !USE(CFNETWORK)
</ins><span class="cx">     void continueWillCacheResponse(NSCachedURLResponse *);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -236,6 +241,7 @@
</span><span class="cx"> #if PLATFORM(COCOA) || USE(CFNETWORK)
</span><span class="cx">     static CFStringRef synchronousLoadRunLoopMode();
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if PLATFORM(IOS) &amp;&amp; USE(CFNETWORK)
</span><span class="cx">     static CFMutableDictionaryRef createSSLPropertiesFromNSURLRequest(const ResourceRequest&amp;);
</span><span class="cx"> #endif
</span><span class="lines">@@ -271,24 +277,23 @@
</span><span class="cx">     virtual void derefAuthenticationClient() override { deref(); }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA) || USE(CFNETWORK)
</span><del>-    enum class SchedulingBehavior {
-        Asynchronous,
-        Synchronous
-    };
</del><ins>+    enum class SchedulingBehavior { Asynchronous, Synchronous };
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if USE(CFNETWORK)
</span><span class="cx">     void createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior, CFDictionaryRef clientProperties);
</span><del>-#else
</del><ins>+#endif
+
+#if PLATFORM(COCOA) &amp;&amp; !USE(CFNETWORK)
</ins><span class="cx">     void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior);
</span><span class="cx"> #endif
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx">     friend class ResourceHandleInternal;
</span><span class="cx">     OwnPtr&lt;ResourceHandleInternal&gt; d;
</span><span class="cx"> 
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx">     OwnPtr&lt;QuickLookHandle&gt; m_quickLook;
</span><del>-#endif // USE(QUICK_LOOK)
</del><ins>+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandleInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandleInternal.h (167182 => 167183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandleInternal.h        2014-04-12 18:22:27 UTC (rev 167182)
+++ trunk/Source/WebCore/platform/network/ResourceHandleInternal.h        2014-04-12 19:10:56 UTC (rev 167183)
</span><span class="lines">@@ -52,7 +52,6 @@
</span><span class="cx"> #include &quot;GUniquePtrSoup.h&quot;
</span><span class="cx"> #include &lt;libsoup/soup.h&gt;
</span><span class="cx"> #include &lt;wtf/gobject/GRefPtr.h&gt;
</span><del>-class Frame;
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -69,6 +68,7 @@
</span><span class="cx"> // WebCoreResourceLoaderImp which avoids doing work in dealloc).
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+
</ins><span class="cx">     class ResourceHandleClient;
</span><span class="cx"> 
</span><span class="cx">     class ResourceHandleInternal {
</span><span class="lines">@@ -83,7 +83,6 @@
</span><span class="cx">             , m_defersLoading(defersLoading)
</span><span class="cx">             , m_shouldContentSniff(shouldContentSniff)
</span><span class="cx"> #if USE(CFNETWORK)
</span><del>-            , m_connection(0)
</del><span class="cx">             , m_currentRequest(request)
</span><span class="cx"> #endif
</span><span class="cx"> #if USE(WININET)
</span><span class="lines">@@ -216,6 +215,7 @@
</span><span class="cx">         // It is almost identical to m_currentWebChallenge.nsURLAuthenticationChallenge(), but has a different sender.
</span><span class="cx">         NSURLAuthenticationChallenge *m_currentMacChallenge;
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx">         AuthenticationChallenge m_currentWebChallenge;
</span><span class="cx">         ResourceHandle::FailureType m_scheduledFailureType;
</span><span class="cx">         Timer&lt;ResourceHandle&gt; m_failureTimer;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacResourceHandleMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (167182 => 167183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm        2014-04-12 18:22:27 UTC (rev 167182)
+++ trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm        2014-04-12 19:10:56 UTC (rev 167183)
</span><span class="lines">@@ -297,32 +297,28 @@
</span><span class="cx">         wkSetNSURLConnectionDefersCallbacks(d-&gt;m_connection.get(), defers);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ResourceHandle::schedule(SchedulePair* pair)
</del><ins>+#if PLATFORM(MAC)
+
+void ResourceHandle::schedule(SchedulePair&amp; pair)
</ins><span class="cx"> {
</span><del>-#if !PLATFORM(IOS)
-    NSRunLoop *runLoop = pair-&gt;nsRunLoop();
</del><ins>+    NSRunLoop *runLoop = pair.nsRunLoop();
</ins><span class="cx">     if (!runLoop)
</span><span class="cx">         return;
</span><del>-    [d-&gt;m_connection.get() scheduleInRunLoop:runLoop forMode:(NSString *)pair-&gt;mode()];
</del><ins>+    [d-&gt;m_connection.get() scheduleInRunLoop:runLoop forMode:(NSString *)pair.mode()];
</ins><span class="cx">     if (d-&gt;m_startWhenScheduled) {
</span><span class="cx">         [d-&gt;m_connection.get() start];
</span><span class="cx">         d-&gt;m_startWhenScheduled = false;
</span><span class="cx">     }
</span><del>-#else
-    UNUSED_PARAM(pair);
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ResourceHandle::unschedule(SchedulePair* pair)
</del><ins>+void ResourceHandle::unschedule(SchedulePair&amp; pair)
</ins><span class="cx"> {
</span><del>-#if !PLATFORM(IOS)
-    if (NSRunLoop *runLoop = pair-&gt;nsRunLoop())
-        [d-&gt;m_connection.get() unscheduleFromRunLoop:runLoop forMode:(NSString *)pair-&gt;mode()];
-#else
-    UNUSED_PARAM(pair);
-#endif
</del><ins>+    if (NSRunLoop *runLoop = pair.nsRunLoop())
+        [d-&gt;m_connection.get() unscheduleFromRunLoop:runLoop forMode:(NSString *)pair.mode()];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#endif
+
</ins><span class="cx"> id ResourceHandle::delegate()
</span><span class="cx"> {
</span><span class="cx">     if (!d-&gt;m_delegate) {
</span></span></pre>
</div>
</div>

</body>
</html>