<!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>[210480] trunk/Source</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/210480">210480</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2017-01-07 13:00:30 -0800 (Sat, 07 Jan 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[QuickLook] Consolidate usage of QuickLookHandle into SubresourceLoader
https://bugs.webkit.org/show_bug.cgi?id=166713

Reviewed by Alex Christensen.

Source/WebCore:

QuickLook conversion was originally implemented by intercepting document loads at the
ResourceHandle level, with separate paths for NSURLConnection and CFURLConnection handles.
When QuickLook was ported to WebKit2, a third path was added in WebResourceLoader.

This change removes these three separate paths and implements a single conversion path in
SubresourceLoader, where QuickLook can intercept document loads regardless of the networking
API being used.

No change in behavior. Covered by existing tests.

* loader/ResourceLoader.h: Removed override from didCreateQuickLookHandle() since this
function is no longer declared in ResourceHandleClient.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::shouldCreateQuickLookHandleForResponse): Added a helper
function to check if a QuickLookHandle should be created for a response.
(WebCore::SubresourceLoader::didReceiveResponse): Created a QuickLookHandle if necessary
and stored it in the DocumentLoader.
(WebCore::SubresourceLoader::didReceiveData): If there is a QuickLookHandle, call
QuickLookHandle::didReceiveBuffer(), and return early if QuickLook is converting.
(WebCore::SubresourceLoader::didReceiveBuffer): Ditto for QuickLookHandle::didReceiveBuffer().
(WebCore::SubresourceLoader::didFinishLoading): Ditto for QuickLookHandle::didFinishLoading().
(WebCore::SubresourceLoader::didFail): If there is a QuickLookHandle, call QuickLookHandle::didFail().
* loader/SubresourceLoader.h: Declared shouldCreateQuickLookHandleForResponse().
* loader/ios/QuickLook.h: Removed declarations used by the ResourceHandles and declared new
functions used by SubresourceLoader.
* loader/ios/QuickLook.mm:
(WebCore::QuickLookHandle::QuickLookHandle): Removed the NSURLConnection * parameter, since
we’d now always pass nil.
(WebCore::QuickLookHandle::create): Removed create() functions used by ResourceHandles.
(WebCore::QuickLookHandle::didReceiveData): Added. Copies the data into an NSData, wraps it
in an NSArray, and passes it to didReceiveDataArray().
(WebCore::QuickLookHandle::didReceiveBuffer): Added. Creates a NSArray of NSData from the
SharedBuffer and passes it to didReceiveDataArray().
(-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]): Deleted.
(-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didFailWithError:]): Deleted.
(-[WebQuickLookHandleAsDelegate detachHandle]): Deleted.
(WebCore::QuickLookHandle::cfResponse): Deleted.
(WebCore::QuickLookHandle::didReceiveDataArray): Passed dataArray to m_converter and m_client.
* platform/SharedBuffer.h: Const-qualified createNSDataArray().
* platform/cocoa/SharedBufferCocoa.mm:
(WebCore::SharedBuffer::createNSDataArray): Ditto.
* platform/network/ResourceHandle.cpp: Stopped including QuickLook.h.
* platform/network/ResourceHandle.h: Removed m_quickLook.
(WebCore::ResourceHandle::quickLookHandle): Deleted.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didCreateQuickLookHandle): Deleted.
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): Removed QuickLook code.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData): Ditto.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading): Ditto.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFail): Ditto.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray): Ditto.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::setQuickLookHandle): Deleted.
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Removed QuickLook code.
(-[WebCoreResourceHandleAsDelegate connection:didReceiveDataArray:]): Ditto.
(-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]): Ditto.
(-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]): Ditto.
(-[WebCoreResourceHandleAsDelegate connection:didFailWithError:]): Ditto.

Source/WebKit2:

* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResponse): Removed QuickLook code.
(WebKit::WebResourceLoader::didReceiveData): Ditto.
(WebKit::WebResourceLoader::didFinishResourceLoad): Ditto.
(WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
(WebKit::WebResourceLoader::didReceiveResource): Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoaderh">trunk/Source/WebCore/loader/ResourceLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderSubresourceLoadercpp">trunk/Source/WebCore/loader/SubresourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderSubresourceLoaderh">trunk/Source/WebCore/loader/SubresourceLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderiosQuickLookh">trunk/Source/WebCore/loader/ios/QuickLook.h</a></li>
<li><a href="#trunkSourceWebCoreloaderiosQuickLookmm">trunk/Source/WebCore/loader/ios/QuickLook.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformSharedBufferh">trunk/Source/WebCore/platform/SharedBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaSharedBufferCocoamm">trunk/Source/WebCore/platform/cocoa/SharedBufferCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandlecpp">trunk/Source/WebCore/platform/network/ResourceHandle.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandleh">trunk/Source/WebCore/platform/network/ResourceHandle.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandleClienth">trunk/Source/WebCore/platform/network/ResourceHandleClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfSynchronousResourceHandleCFURLConnectionDelegatecpp">trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacResourceHandleMacmm">trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacWebCoreResourceHandleAsDelegatemm">trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkWebResourceLoadercpp">trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/ChangeLog        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,3 +1,74 @@
</span><ins>+2017-01-07  Andy Estes  &lt;aestes@apple.com&gt;
+
+        [QuickLook] Consolidate usage of QuickLookHandle into SubresourceLoader
+        https://bugs.webkit.org/show_bug.cgi?id=166713
+
+        Reviewed by Alex Christensen.
+
+        QuickLook conversion was originally implemented by intercepting document loads at the
+        ResourceHandle level, with separate paths for NSURLConnection and CFURLConnection handles.
+        When QuickLook was ported to WebKit2, a third path was added in WebResourceLoader.
+        
+        This change removes these three separate paths and implements a single conversion path in
+        SubresourceLoader, where QuickLook can intercept document loads regardless of the networking
+        API being used.
+
+        No change in behavior. Covered by existing tests.
+
+        * loader/ResourceLoader.h: Removed override from didCreateQuickLookHandle() since this
+        function is no longer declared in ResourceHandleClient.
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::shouldCreateQuickLookHandleForResponse): Added a helper
+        function to check if a QuickLookHandle should be created for a response.
+        (WebCore::SubresourceLoader::didReceiveResponse): Created a QuickLookHandle if necessary
+        and stored it in the DocumentLoader.
+        (WebCore::SubresourceLoader::didReceiveData): If there is a QuickLookHandle, call
+        QuickLookHandle::didReceiveBuffer(), and return early if QuickLook is converting.
+        (WebCore::SubresourceLoader::didReceiveBuffer): Ditto for QuickLookHandle::didReceiveBuffer().
+        (WebCore::SubresourceLoader::didFinishLoading): Ditto for QuickLookHandle::didFinishLoading().
+        (WebCore::SubresourceLoader::didFail): If there is a QuickLookHandle, call QuickLookHandle::didFail().
+        * loader/SubresourceLoader.h: Declared shouldCreateQuickLookHandleForResponse().
+        * loader/ios/QuickLook.h: Removed declarations used by the ResourceHandles and declared new
+        functions used by SubresourceLoader.
+        * loader/ios/QuickLook.mm:
+        (WebCore::QuickLookHandle::QuickLookHandle): Removed the NSURLConnection * parameter, since
+        we’d now always pass nil.
+        (WebCore::QuickLookHandle::create): Removed create() functions used by ResourceHandles.
+        (WebCore::QuickLookHandle::didReceiveData): Added. Copies the data into an NSData, wraps it
+        in an NSArray, and passes it to didReceiveDataArray().
+        (WebCore::QuickLookHandle::didReceiveBuffer): Added. Creates a NSArray of NSData from the
+        SharedBuffer and passes it to didReceiveDataArray().
+        (-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]): Deleted.
+        (-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]): Deleted.
+        (-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]): Deleted.
+        (-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]): Deleted.
+        (-[WebQuickLookHandleAsDelegate connection:didFailWithError:]): Deleted.
+        (-[WebQuickLookHandleAsDelegate detachHandle]): Deleted.
+        (WebCore::QuickLookHandle::cfResponse): Deleted.
+        (WebCore::QuickLookHandle::didReceiveDataArray): Passed dataArray to m_converter and m_client.
+        * platform/SharedBuffer.h: Const-qualified createNSDataArray().
+        * platform/cocoa/SharedBufferCocoa.mm:
+        (WebCore::SharedBuffer::createNSDataArray): Ditto.
+        * platform/network/ResourceHandle.cpp: Stopped including QuickLook.h.
+        * platform/network/ResourceHandle.h: Removed m_quickLook.
+        (WebCore::ResourceHandle::quickLookHandle): Deleted.
+        * platform/network/ResourceHandleClient.h:
+        (WebCore::ResourceHandleClient::didCreateQuickLookHandle): Deleted.
+        * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
+        (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): Removed QuickLook code.
+        (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData): Ditto.
+        (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading): Ditto.
+        (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFail): Ditto.
+        (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray): Ditto.
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::setQuickLookHandle): Deleted.
+        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
+        (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Removed QuickLook code.
+        (-[WebCoreResourceHandleAsDelegate connection:didReceiveDataArray:]): Ditto.
+        (-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]): Ditto.
+        (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]): Ditto.
+        (-[WebCoreResourceHandleAsDelegate connection:didFailWithError:]): Ditto.
+
</ins><span class="cx"> 2017-01-06  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Ensure navigation only allowed for documents not in the page cache
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.h (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.h        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/loader/ResourceLoader.h        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005, 2006, 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -50,12 +50,9 @@
</span><span class="cx"> class DocumentLoader;
</span><span class="cx"> class Frame;
</span><span class="cx"> class FrameLoader;
</span><ins>+class QuickLookHandle;
</ins><span class="cx"> class URL;
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-class QuickLookHandle;
-#endif
-
</del><span class="cx"> class ResourceLoader : public RefCounted&lt;ResourceLoader&gt;, protected ResourceHandleClient {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~ResourceLoader() = 0;
</span><span class="lines">@@ -119,7 +116,7 @@
</span><span class="cx">     virtual void receivedCancellation(const AuthenticationChallenge&amp;);
</span><span class="cx"> 
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><del>-    void didCreateQuickLookHandle(QuickLookHandle&amp;) override;
</del><ins>+    void didCreateQuickLookHandle(QuickLookHandle&amp;);
</ins><span class="cx"> #endif
</span><span class="cx">     bool isQuickLookResource() { return m_isQuickLookResource; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubresourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubresourceLoader.cpp        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006-2007, 2009, 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -57,6 +57,10 @@
</span><span class="cx"> #include &quot;ResourceLoadInfo.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+#include &quot;QuickLook.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, subresourceLoaderCounter, (&quot;SubresourceLoader&quot;));
</span><span class="lines">@@ -247,11 +251,31 @@
</span><span class="cx">     m_resource-&gt;didSendData(bytesSent, totalBytesToBeSent);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+bool SubresourceLoader::shouldCreateQuickLookHandleForResponse(const ResourceResponse&amp; response) const
+{
+    if (m_resource-&gt;type() != CachedResource::MainResource)
+        return false;
+
+    if (m_documentLoader-&gt;quickLookHandle())
+        return false;
+
+    return QuickLookHandle::shouldCreateForMIMEType(response.mimeType());
+}
+#endif
+
</ins><span class="cx"> void SubresourceLoader::didReceiveResponse(const ResourceResponse&amp; response)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!response.isNull());
</span><span class="cx">     ASSERT(m_state == Initialized);
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+    if (shouldCreateQuickLookHandleForResponse(response)) {
+        m_documentLoader-&gt;setQuickLookHandle(QuickLookHandle::create(*this, response));
+        return;
+    }
+#endif
+
</ins><span class="cx">     // We want redirect responses to be processed through willSendRequestInternal. The only exception is redirection with no Location headers.
</span><span class="cx">     ASSERT(response.httpStatusCode() &lt; 300 || response.httpStatusCode() &gt;= 400 || response.httpStatusCode() == 304 || !response.httpHeaderField(HTTPHeaderName::Location));
</span><span class="cx"> 
</span><span class="lines">@@ -325,11 +349,25 @@
</span><span class="cx"> 
</span><span class="cx"> void SubresourceLoader::didReceiveData(const char* data, unsigned length, long long encodedDataLength, DataPayloadType dataPayloadType)
</span><span class="cx"> {
</span><ins>+#if USE(QUICK_LOOK)
+    if (auto quickLookHandle = m_documentLoader-&gt;quickLookHandle()) {
+        if (quickLookHandle-&gt;didReceiveData(data, length))
+            return;
+    }
+#endif
+
</ins><span class="cx">     didReceiveDataOrBuffer(data, length, nullptr, encodedDataLength, dataPayloadType);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SubresourceLoader::didReceiveBuffer(Ref&lt;SharedBuffer&gt;&amp;&amp; buffer, long long encodedDataLength, DataPayloadType dataPayloadType)
</span><span class="cx"> {
</span><ins>+#if USE(QUICK_LOOK)
+    if (auto quickLookHandle = m_documentLoader-&gt;quickLookHandle()) {
+        if (quickLookHandle-&gt;didReceiveBuffer(buffer.get()))
+            return;
+    }
+#endif
+
</ins><span class="cx">     didReceiveDataOrBuffer(nullptr, 0, WTFMove(buffer), encodedDataLength, dataPayloadType);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -468,6 +506,13 @@
</span><span class="cx"> 
</span><span class="cx"> void SubresourceLoader::didFinishLoading(double finishTime)
</span><span class="cx"> {
</span><ins>+#if USE(QUICK_LOOK)
+    if (auto quickLookHandle = m_documentLoader-&gt;quickLookHandle()) {
+        if (quickLookHandle-&gt;didFinishLoading())
+            return;
+    }
+#endif
+
</ins><span class="cx">     if (m_state != Initialized)
</span><span class="cx">         return;
</span><span class="cx">     ASSERT(!reachedTerminalState());
</span><span class="lines">@@ -510,6 +555,11 @@
</span><span class="cx"> 
</span><span class="cx"> void SubresourceLoader::didFail(const ResourceError&amp; error)
</span><span class="cx"> {
</span><ins>+#if USE(QUICK_LOOK)
+    if (auto quickLookHandle = m_documentLoader-&gt;quickLookHandle())
+        quickLookHandle-&gt;didFail();
+#endif
+
</ins><span class="cx">     if (m_state != Initialized)
</span><span class="cx">         return;
</span><span class="cx">     ASSERT(!reachedTerminalState());
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubresourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubresourceLoader.h (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubresourceLoader.h        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/loader/SubresourceLoader.h        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005, 2006, 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -101,6 +101,10 @@
</span><span class="cx"> 
</span><span class="cx">     void notifyDone();
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+    bool shouldCreateQuickLookHandleForResponse(const ResourceResponse&amp;) const;
+#endif
+
</ins><span class="cx">     enum SubresourceLoaderState {
</span><span class="cx">         Uninitialized,
</span><span class="cx">         Initialized,
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderiosQuickLookh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ios/QuickLook.h (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ios/QuickLook.h        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/loader/ios/QuickLook.h        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><ins>+OBJC_CLASS NSArray;
</ins><span class="cx"> OBJC_CLASS NSData;
</span><span class="cx"> OBJC_CLASS NSDictionary;
</span><span class="cx"> OBJC_CLASS NSFileHandle;
</span><span class="lines">@@ -39,7 +40,6 @@
</span><span class="cx"> OBJC_CLASS NSSet;
</span><span class="cx"> OBJC_CLASS NSString;
</span><span class="cx"> OBJC_CLASS NSURL;
</span><del>-OBJC_CLASS NSURLConnection;
</del><span class="cx"> OBJC_CLASS NSURLRequest;
</span><span class="cx"> OBJC_CLASS NSURLResponse;
</span><span class="cx"> OBJC_CLASS QLPreviewConverter;
</span><span class="lines">@@ -46,10 +46,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class ResourceHandle;
</del><span class="cx"> class ResourceLoader;
</span><span class="cx"> class ResourceResponse;
</span><del>-class SynchronousResourceHandleCFURLConnectionDelegate;
</del><ins>+class SharedBuffer;
</ins><span class="cx"> class URL;
</span><span class="cx"> 
</span><span class="cx"> WEBCORE_EXPORT NSSet *QLPreviewGetSupportedMIMETypesSet();
</span><span class="lines">@@ -74,26 +73,16 @@
</span><span class="cx"> class QuickLookHandle {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(QuickLookHandle);
</span><span class="cx"> public:
</span><del>-    WEBCORE_EXPORT static bool shouldCreateForMIMEType(const String&amp;);
</del><ins>+    static bool shouldCreateForMIMEType(const String&amp;);
+    static std::unique_ptr&lt;QuickLookHandle&gt; create(ResourceLoader&amp;, const ResourceResponse&amp;);
+    ~QuickLookHandle();
</ins><span class="cx"> 
</span><del>-    static std::unique_ptr&lt;QuickLookHandle&gt; create(ResourceHandle*, NSURLConnection *, NSURLResponse *, id delegate);
-#if USE(CFURLCONNECTION)
-    static std::unique_ptr&lt;QuickLookHandle&gt; create(ResourceHandle*, SynchronousResourceHandleCFURLConnectionDelegate*, CFURLResponseRef);
-#endif
-    // FIXME: Use of ResourceLoader here is a platform violation.
-    WEBCORE_EXPORT static std::unique_ptr&lt;QuickLookHandle&gt; create(ResourceLoader&amp;, const ResourceResponse&amp;);
</del><ins>+    bool didReceiveData(const char* data, unsigned length);
+    bool didReceiveBuffer(const SharedBuffer&amp;);
+    bool didFinishLoading();
+    void didFail();
</ins><span class="cx"> 
</span><del>-    WEBCORE_EXPORT ~QuickLookHandle();
-
-    WEBCORE_EXPORT bool didReceiveDataArray(CFArrayRef);
-    WEBCORE_EXPORT bool didReceiveData(CFDataRef);
-    WEBCORE_EXPORT bool didFinishLoading();
-    WEBCORE_EXPORT void didFail();
-
</del><span class="cx">     WEBCORE_EXPORT NSURLResponse *nsResponse();
</span><del>-#if USE(CFURLCONNECTION)
-    CFURLResponseRef cfResponse();
-#endif
</del><span class="cx"> 
</span><span class="cx">     void setClient(PassRefPtr&lt;QuickLookHandleClient&gt; client) { m_client = client; }
</span><span class="cx"> 
</span><span class="lines">@@ -104,8 +93,10 @@
</span><span class="cx">     QLPreviewConverter *converter() const { return m_converter.get(); }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    QuickLookHandle(NSURL *, NSURLConnection *, NSURLResponse *, id delegate);
</del><ins>+    QuickLookHandle(NSURL *, NSURLResponse *, id delegate);
</ins><span class="cx"> 
</span><ins>+    void didReceiveDataArray(NSArray *);
+
</ins><span class="cx">     RetainPtr&lt;NSURL&gt; m_firstRequestURL;
</span><span class="cx">     RetainPtr&lt;QLPreviewConverter&gt; m_converter;
</span><span class="cx">     RetainPtr&lt;id&gt; m_delegate;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderiosQuickLookmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ios/QuickLook.mm (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ios/QuickLook.mm        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/loader/ios/QuickLook.mm        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,21 +28,15 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx"> 
</span><del>-#import &quot;DocumentLoader.h&quot;
</del><span class="cx"> #import &quot;FileSystemIOS.h&quot;
</span><span class="cx"> #import &quot;Logging.h&quot;
</span><span class="cx"> #import &quot;NSFileManagerSPI.h&quot;
</span><span class="cx"> #import &quot;ResourceError.h&quot;
</span><del>-#import &quot;ResourceHandle.h&quot;
</del><span class="cx"> #import &quot;ResourceLoader.h&quot;
</span><del>-#import &quot;RuntimeApplicationChecks.h&quot;
-#import &quot;SynchronousResourceHandleCFURLConnectionDelegate.h&quot;
</del><ins>+#import &quot;SharedBuffer.h&quot;
</ins><span class="cx"> #import &quot;WebCoreResourceHandleAsDelegate.h&quot;
</span><del>-#import &quot;WebCoreURLResponseIOS.h&quot;
</del><span class="cx"> #import &lt;Foundation/Foundation.h&gt;
</span><span class="cx"> #import &lt;wtf/NeverDestroyed.h&gt;
</span><del>-#import &lt;wtf/StdLibExtras.h&gt;
-#import &lt;wtf/Threading.h&gt;
</del><span class="cx"> #import &lt;wtf/Vector.h&gt;
</span><span class="cx"> #import &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -185,81 +179,6 @@
</span><span class="cx">     return previewProtocol.get().data();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if USE(CFURLCONNECTION)
-// The way QuickLook works is we pass it an NSURLConnectionDelegate callback object at creation
-// time. Then we pass it all the data as we receive it. Once we've downloaded the full URL,
-// QuickLook turns around and send us, through this delegate, the HTML version of the file which we
-// pass on to WebCore. The flag m_finishedLoadingDataIntoConverter in QuickLookHandle decides
-// whether to pass the data to QuickLook or WebCore.
-//
-// This works fine when using NS APIs, but when using CFNetwork, we don't have a NSURLConnectionDelegate.
-// So we create WebQuickLookHandleAsDelegate as an intermediate delegate object and pass it to
-// QLPreviewConverter. The proxy delegate then forwards the messages on to the CFNetwork code.
-@interface WebQuickLookHandleAsDelegate : NSObject &lt;NSURLConnectionDelegate, WebCoreResourceLoaderDelegate&gt; {
-    RefPtr&lt;SynchronousResourceHandleCFURLConnectionDelegate&gt; m_connectionDelegate;
-}
-
-- (id)initWithConnectionDelegate:(SynchronousResourceHandleCFURLConnectionDelegate*)connectionDelegate;
-@end
-
-@implementation WebQuickLookHandleAsDelegate
-- (id)initWithConnectionDelegate:(SynchronousResourceHandleCFURLConnectionDelegate*)connectionDelegate
-{
-    self = [super init];
-    if (!self)
-        return nil;
-    m_connectionDelegate = connectionDelegate;
-    return self;
-}
-
-- (void)connection:(NSURLConnection *)connection didReceiveDataArray:(NSArray *)dataArray
-{
-    UNUSED_PARAM(connection);
-    if (!m_connectionDelegate)
-        return;
-    LOG(Network, &quot;WebQuickLookHandleAsDelegate::didReceiveDataArray()&quot;);
-    m_connectionDelegate-&gt;didReceiveDataArray(reinterpret_cast&lt;CFArrayRef&gt;(dataArray));
-}
-
-- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
-{
-    UNUSED_PARAM(connection);
-    if (!m_connectionDelegate)
-        return;
-    LOG(Network, &quot;WebQuickLookHandleAsDelegate::didReceiveData() - data length = %ld&quot;, (long)[data length]);
-
-    // QuickLook code sends us a nil data at times. The check below is the same as the one in
-    // ResourceHandleMac.cpp added for a different bug.
-    if (![data length])
-        return;
-    m_connectionDelegate-&gt;didReceiveData(reinterpret_cast&lt;CFDataRef&gt;(data), static_cast&lt;int&gt;(lengthReceived));
-}
-
-- (void)connectionDidFinishLoading:(NSURLConnection *)connection
-{
-    UNUSED_PARAM(connection);
-    if (!m_connectionDelegate)
-        return;
-    LOG(Network, &quot;WebQuickLookHandleAsDelegate::didFinishLoading()&quot;);
-    m_connectionDelegate-&gt;didFinishLoading();
-}
-
-- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
-{
-    UNUSED_PARAM(connection);
-    if (!m_connectionDelegate)
-        return;
-    LOG(Network, &quot;WebQuickLookHandleAsDelegate::didFail()&quot;);
-    m_connectionDelegate-&gt;didFail(reinterpret_cast&lt;CFErrorRef&gt;(error));
-}
-
-- (void)detachHandle
-{
-    m_connectionDelegate = nullptr;
-}
-@end
-#endif
-
</del><span class="cx"> @interface WebResourceLoaderQuickLookDelegate : NSObject &lt;NSURLConnectionDelegate, WebCoreResourceLoaderDelegate&gt; {
</span><span class="cx">     RefPtr&lt;ResourceLoader&gt; _resourceLoader;
</span><span class="cx">     BOOL _hasSentDidReceiveResponse;
</span><span class="lines">@@ -392,9 +311,9 @@
</span><span class="cx">     return &amp;emptyClient.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-QuickLookHandle::QuickLookHandle(NSURL *firstRequestURL, NSURLConnection *connection, NSURLResponse *nsResponse, id delegate)
</del><ins>+QuickLookHandle::QuickLookHandle(NSURL *firstRequestURL, NSURLResponse *nsResponse, id delegate)
</ins><span class="cx">     : m_firstRequestURL(firstRequestURL)
</span><del>-    , m_converter(adoptNS([allocQLPreviewConverterInstance() initWithConnection:connection delegate:delegate response:nsResponse options:nil]))
</del><ins>+    , m_converter(adoptNS([allocQLPreviewConverterInstance() initWithConnection:nil delegate:delegate response:nsResponse options:nil]))
</ins><span class="cx">     , m_delegate(delegate)
</span><span class="cx">     , m_finishedLoadingDataIntoConverter(false)
</span><span class="cx">     , m_nsResponse([m_converter previewResponse])
</span><span class="lines">@@ -403,37 +322,6 @@
</span><span class="cx">     LOG(Network, &quot;QuickLookHandle::QuickLookHandle() - previewFileName: %s&quot;, [m_converter previewFileName]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr&lt;QuickLookHandle&gt; QuickLookHandle::create(ResourceHandle* handle, NSURLConnection *connection, NSURLResponse *nsResponse, id delegate)
-{
-    ASSERT_ARG(handle, handle);
-    if (handle-&gt;firstRequest().requester() != ResourceRequest::Requester::Main || ![QLPreviewGetSupportedMIMETypesSet() containsObject:[nsResponse MIMEType]])
-        return nullptr;
-
-    std::unique_ptr&lt;QuickLookHandle&gt; quickLookHandle(new QuickLookHandle([handle-&gt;firstRequest().nsURLRequest(DoNotUpdateHTTPBody) URL], connection, nsResponse, delegate));
-    handle-&gt;client()-&gt;didCreateQuickLookHandle(*quickLookHandle);
-    return quickLookHandle;
-}
-
-#if USE(CFURLCONNECTION)
-std::unique_ptr&lt;QuickLookHandle&gt; QuickLookHandle::create(ResourceHandle* handle, SynchronousResourceHandleCFURLConnectionDelegate* connectionDelegate, CFURLResponseRef cfResponse)
-{
-    ASSERT_ARG(handle, handle);
-    if (handle-&gt;firstRequest().requester() != ResourceRequest::Requester::Main || ![QLPreviewGetSupportedMIMETypesSet() containsObject:(NSString *)CFURLResponseGetMIMEType(cfResponse)])
-        return nullptr;
-
-    NSURLResponse *nsResponse = [NSURLResponse _responseWithCFURLResponse:cfResponse];
-    WebQuickLookHandleAsDelegate *delegate = [[[WebQuickLookHandleAsDelegate alloc] initWithConnectionDelegate:connectionDelegate] autorelease];
-    std::unique_ptr&lt;QuickLookHandle&gt; quickLookHandle(new QuickLookHandle([handle-&gt;firstRequest().nsURLRequest(DoNotUpdateHTTPBody) URL], nil, nsResponse, delegate));
-    handle-&gt;client()-&gt;didCreateQuickLookHandle(*quickLookHandle);
-    return quickLookHandle;
-}
-
-CFURLResponseRef QuickLookHandle::cfResponse()
-{
-    return [m_nsResponse _CFURLResponse];
-}
-#endif
-
</del><span class="cx"> bool QuickLookHandle::shouldCreateForMIMEType(const String&amp; mimeType)
</span><span class="cx"> {
</span><span class="cx">     return [QLPreviewGetSupportedMIMETypesSet() containsObject:mimeType];
</span><span class="lines">@@ -444,7 +332,7 @@
</span><span class="cx">     ASSERT(shouldCreateForMIMEType(response.mimeType()));
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;WebResourceLoaderQuickLookDelegate&gt; delegate = adoptNS([[WebResourceLoaderQuickLookDelegate alloc] initWithResourceLoader:&amp;loader]);
</span><del>-    std::unique_ptr&lt;QuickLookHandle&gt; quickLookHandle(new QuickLookHandle([loader.originalRequest().nsURLRequest(DoNotUpdateHTTPBody) URL], nil, response.nsURLResponse(), delegate.get()));
</del><ins>+    std::unique_ptr&lt;QuickLookHandle&gt; quickLookHandle(new QuickLookHandle([loader.originalRequest().nsURLRequest(DoNotUpdateHTTPBody) URL], response.nsURLResponse(), delegate.get()));
</ins><span class="cx">     [delegate setQuickLookHandle:quickLookHandle.get()];
</span><span class="cx">     loader.didCreateQuickLookHandle(*quickLookHandle);
</span><span class="cx">     return quickLookHandle;
</span><span class="lines">@@ -455,25 +343,32 @@
</span><span class="cx">     return m_nsResponse.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool QuickLookHandle::didReceiveDataArray(CFArrayRef cfDataArray)
</del><ins>+bool QuickLookHandle::didReceiveData(const char* data, unsigned length)
</ins><span class="cx"> {
</span><span class="cx">     if (m_finishedLoadingDataIntoConverter)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    LOG(Network, &quot;QuickLookHandle::didReceiveDataArray()&quot;);
-    [m_converter appendDataArray:(NSArray *)cfDataArray];
-    m_client-&gt;didReceiveDataArray(cfDataArray);
</del><ins>+    didReceiveDataArray(@[ [NSData dataWithBytes:data length:length] ]);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool QuickLookHandle::didReceiveData(CFDataRef cfData)
</del><ins>+bool QuickLookHandle::didReceiveBuffer(const SharedBuffer&amp; buffer)
</ins><span class="cx"> {
</span><span class="cx">     if (m_finishedLoadingDataIntoConverter)
</span><span class="cx">         return false;
</span><del>-    
-    return didReceiveDataArray(adoptCF(CFArrayCreate(kCFAllocatorDefault, (const void**)&amp;cfData, 1, &amp;kCFTypeArrayCallBacks)).get());
</del><ins>+
+    didReceiveDataArray(buffer.createNSDataArray().get());
+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void QuickLookHandle::didReceiveDataArray(NSArray *dataArray)
+{
+    ASSERT(!m_finishedLoadingDataIntoConverter);
+    LOG(Network, &quot;QuickLookHandle::didReceiveDataArray()&quot;);
+    [m_converter appendDataArray:dataArray];
+    m_client-&gt;didReceiveDataArray((CFArrayRef)dataArray);
+}
+
</ins><span class="cx"> bool QuickLookHandle::didFinishLoading()
</span><span class="cx"> {
</span><span class="cx">     if (m_finishedLoadingDataIntoConverter)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformSharedBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/SharedBuffer.h (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/SharedBuffer.h        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/platform/SharedBuffer.h        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">     
</span><span class="cx"> #if USE(FOUNDATION)
</span><span class="cx">     WEBCORE_EXPORT RetainPtr&lt;NSData&gt; createNSData();
</span><del>-    WEBCORE_EXPORT RetainPtr&lt;NSArray&gt; createNSDataArray();
</del><ins>+    WEBCORE_EXPORT RetainPtr&lt;NSArray&gt; createNSDataArray() const;
</ins><span class="cx">     WEBCORE_EXPORT static Ref&lt;SharedBuffer&gt; wrapNSData(NSData *);
</span><span class="cx"> #endif
</span><span class="cx"> #if USE(CF)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaSharedBufferCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/SharedBufferCocoa.mm (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/SharedBufferCocoa.mm        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/platform/cocoa/SharedBufferCocoa.mm        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RetainPtr&lt;NSArray&gt; SharedBuffer::createNSDataArray()
</del><ins>+RetainPtr&lt;NSArray&gt; SharedBuffer::createNSDataArray() const
</ins><span class="cx"> {
</span><span class="cx">     if (auto platformData = (NSData *)m_cfData.get())
</span><span class="cx">         return @[ platformData ];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandle.cpp (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandle.cpp        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.cpp        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -38,10 +38,6 @@
</span><span class="cx"> #include &lt;wtf/text/AtomicStringHash.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-#include &quot;QuickLook.h&quot;
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static bool shouldForceContentSniffing;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandle.h (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandle.h        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.h        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2004, 2006, 2011, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -147,11 +147,6 @@
</span><span class="cx">     static void setClientCertificate(const String&amp; host, CFDataRef);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    QuickLookHandle* quickLookHandle() { return m_quickLook.get(); }
-    void setQuickLookHandle(std::unique_ptr&lt;QuickLookHandle&gt;);
-#endif
-
</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="lines">@@ -280,10 +275,6 @@
</span><span class="cx"> 
</span><span class="cx">     friend class ResourceHandleInternal;
</span><span class="cx">     std::unique_ptr&lt;ResourceHandleInternal&gt; d;
</span><del>-
-#if USE(QUICK_LOOK)
-    std::unique_ptr&lt;QuickLookHandle&gt; m_quickLook;
-#endif
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandleClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandleClient.h (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandleClient.h        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/platform/network/ResourceHandleClient.h        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,6 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006 Apple Inc.  All rights reserved.
- * Copyright (C) 2013 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -53,10 +52,6 @@
</span><span class="cx">     class ResourceResponse;
</span><span class="cx">     class SharedBuffer;
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    class QuickLookHandle;
-#endif
-
</del><span class="cx">     enum CacheStoragePolicy {
</span><span class="cx">         StorageAllowed,
</span><span class="cx">         StorageAllowedInMemoryOnly,
</span><span class="lines">@@ -131,10 +126,6 @@
</span><span class="cx"> #elif PLATFORM(COCOA)
</span><span class="cx">         virtual NSCachedURLResponse *willCacheResponse(ResourceHandle*, NSCachedURLResponse *response) { return response; }
</span><span class="cx"> #endif
</span><del>-
-#if USE(QUICK_LOOK)
-        virtual void didCreateQuickLookHandle(QuickLookHandle&amp;) { }
-#endif
</del><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfSynchronousResourceHandleCFURLConnectionDelegatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2004-2013, 2015 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -167,15 +167,6 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    bool isQuickLookPreview = false;
-    m_handle-&gt;setQuickLookHandle(QuickLookHandle::create(m_handle, this, cfResponse));
-    if (m_handle-&gt;quickLookHandle()) {
-        cfResponse = m_handle-&gt;quickLookHandle()-&gt;cfResponse();
-        isQuickLookPreview = true;
-    }
-#endif
-
</del><span class="cx">     ResourceResponse resourceResponse(cfResponse);
</span><span class="cx"> #if PLATFORM(COCOA) &amp;&amp; ENABLE(WEB_TIMING)
</span><span class="cx">     ResourceHandle::getConnectionTimingData(connection, resourceResponse.networkLoadTiming());
</span><span class="lines">@@ -183,10 +174,6 @@
</span><span class="cx">     UNUSED_PARAM(connection);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    resourceResponse.setIsQuickLook(isQuickLookPreview);
-#endif
-
</del><span class="cx">     m_handle-&gt;client()-&gt;didReceiveResponse(m_handle, WTFMove(resourceResponse));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -194,11 +181,6 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(Network, &quot;CFNet - SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData(handle=%p, bytes=%ld) (%s)&quot;, m_handle, CFDataGetLength(data), m_handle-&gt;firstRequest().url().string().utf8().data());
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    if (m_handle-&gt;quickLookHandle() &amp;&amp; m_handle-&gt;quickLookHandle()-&gt;didReceiveData(data))
-        return;
-#endif
-
</del><span class="cx">     if (ResourceHandleClient* client = m_handle-&gt;client())
</span><span class="cx">         client-&gt;didReceiveBuffer(m_handle, SharedBuffer::wrapCFData(data), originalLength);
</span><span class="cx"> }
</span><span class="lines">@@ -207,11 +189,6 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(Network, &quot;CFNet - SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading(handle=%p) (%s)&quot;, m_handle, m_handle-&gt;firstRequest().url().string().utf8().data());
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    if (m_handle-&gt;quickLookHandle() &amp;&amp; m_handle-&gt;quickLookHandle()-&gt;didFinishLoading())
-        return;
-#endif
-
</del><span class="cx">     if (ResourceHandleClient* client = m_handle-&gt;client())
</span><span class="cx">         client-&gt;didFinishLoading(m_handle, 0);
</span><span class="cx"> }
</span><span class="lines">@@ -220,11 +197,6 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(Network, &quot;CFNet - SynchronousResourceHandleCFURLConnectionDelegate::didFail(handle=%p, error = %p) (%s)&quot;, m_handle, error, m_handle-&gt;firstRequest().url().string().utf8().data());
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    if (QuickLookHandle* quickLookHandle = m_handle-&gt;quickLookHandle())
-        quickLookHandle-&gt;didFail();
-#endif
-
</del><span class="cx">     if (ResourceHandleClient* client = m_handle-&gt;client())
</span><span class="cx">         client-&gt;didFail(m_handle, ResourceError(error));
</span><span class="cx"> }
</span><span class="lines">@@ -306,11 +278,6 @@
</span><span class="cx"> 
</span><span class="cx">     LOG(Network, &quot;CFNet - SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray(handle=%p, arrayLength=%ld) (%s)&quot;, m_handle, CFArrayGetCount(dataArray), m_handle-&gt;firstRequest().url().string().utf8().data());
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    if (m_handle-&gt;quickLookHandle() &amp;&amp; m_handle-&gt;quickLookHandle()-&gt;didReceiveDataArray(dataArray))
-        return;
-#endif
-
</del><span class="cx">     if (ResourceHandleClient* client = m_handle-&gt;client())
</span><span class="cx">         client-&gt;didReceiveBuffer(m_handle, SharedBuffer::wrapCFDataArray(dataArray), -1);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacResourceHandleMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -77,10 +77,6 @@
</span><span class="cx"> @end
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-#import &quot;QuickLook.h&quot;
-#endif
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> @interface NSURLConnection ()
</span><span class="lines">@@ -752,12 +748,5 @@
</span><span class="cx">     
</span><span class="cx"> #endif // ENABLE(WEB_TIMING)
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-void ResourceHandle::setQuickLookHandle(std::unique_ptr&lt;QuickLookHandle&gt; handle)
-{
-    m_quickLook = WTFMove(handle);
-}
-#endif
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacWebCoreResourceHandleAsDelegatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -39,10 +39,6 @@
</span><span class="cx"> #import &quot;SharedBuffer.h&quot;
</span><span class="cx"> #import &quot;WebCoreURLResponse.h&quot;
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-#import &quot;QuickLook.h&quot;
-#endif
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> @implementation WebCoreResourceHandleAsDelegate
</span><span class="lines">@@ -146,20 +142,8 @@
</span><span class="cx">         [response _setMIMEType:@&quot;text/html&quot;];
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    bool isQuickLookPreview = false;
-    m_handle-&gt;setQuickLookHandle(QuickLookHandle::create(m_handle, connection, response, self));
-    if (m_handle-&gt;quickLookHandle()) {
-        response = m_handle-&gt;quickLookHandle()-&gt;nsResponse();
-        isQuickLookPreview = true;
-    }
-#endif
-
</del><span class="cx">     ResourceResponse resourceResponse(response);
</span><span class="cx">     resourceResponse.setSource(ResourceResponse::Source::Network);
</span><del>-#if USE(QUICK_LOOK)
-    resourceResponse.setIsQuickLook(isQuickLookPreview);
-#endif
</del><span class="cx"> #if ENABLE(WEB_TIMING)
</span><span class="cx">     ResourceHandle::getConnectionTimingData(connection, resourceResponse.networkLoadTiming());
</span><span class="cx"> #else
</span><span class="lines">@@ -181,11 +165,6 @@
</span><span class="cx">     if (!m_handle || !m_handle-&gt;client())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    if (m_handle-&gt;quickLookHandle() &amp;&amp; m_handle-&gt;quickLookHandle()-&gt;didReceiveDataArray(reinterpret_cast&lt;CFArrayRef&gt;(dataArray)))
-        return;
-#endif
-
</del><span class="cx">     m_handle-&gt;client()-&gt;didReceiveBuffer(m_handle, SharedBuffer::wrapCFDataArray(reinterpret_cast&lt;CFArrayRef&gt;(dataArray)), -1);
</span><span class="cx">     // The call to didReceiveData above can cancel a load, and if so, the delegate (self) could have been deallocated by this point.
</span><span class="cx"> }
</span><span class="lines">@@ -209,11 +188,6 @@
</span><span class="cx">     // However, with today's computers and networking speeds, this won't happen in practice.
</span><span class="cx">     // Could be an issue with a giant local file.
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    if (m_handle-&gt;quickLookHandle() &amp;&amp; m_handle-&gt;quickLookHandle()-&gt;didReceiveData(reinterpret_cast&lt;CFDataRef&gt;(data)))
-        return;
-#endif
-
</del><span class="cx">     // FIXME: https://bugs.webkit.org/show_bug.cgi?id=19793
</span><span class="cx">     // -1 means we do not provide any data about transfer size to inspector so it would use
</span><span class="cx">     // Content-Length headers or content size to show transfer size.
</span><span class="lines">@@ -241,11 +215,6 @@
</span><span class="cx">     if (!m_handle || !m_handle-&gt;client())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    if (m_handle-&gt;quickLookHandle() &amp;&amp; m_handle-&gt;quickLookHandle()-&gt;didFinishLoading())
-        return;
-#endif
-
</del><span class="cx">     m_handle-&gt;client()-&gt;didFinishLoading(m_handle, 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -258,11 +227,6 @@
</span><span class="cx">     if (!m_handle || !m_handle-&gt;client())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    if (m_handle-&gt;quickLookHandle())
-        m_handle-&gt;quickLookHandle()-&gt;didFail();
-#endif
-
</del><span class="cx">     m_handle-&gt;client()-&gt;didFail(m_handle, error);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebKit2/ChangeLog        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2017-01-07  Andy Estes  &lt;aestes@apple.com&gt;
+
+        [QuickLook] Consolidate usage of QuickLookHandle into SubresourceLoader
+        https://bugs.webkit.org/show_bug.cgi?id=166713
+
+        Reviewed by Alex Christensen.
+
+        * WebProcess/Network/WebResourceLoader.cpp:
+        (WebKit::WebResourceLoader::didReceiveResponse): Removed QuickLook code.
+        (WebKit::WebResourceLoader::didReceiveData): Ditto.
+        (WebKit::WebResourceLoader::didFinishResourceLoad): Ditto.
+        (WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
+        (WebKit::WebResourceLoader::didReceiveResource): Ditto.
+
</ins><span class="cx"> 2017-01-06  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Attempt to fix the EFL build following &lt;http://trac.webkit.org/changeset/210461&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkWebResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp (210479 => 210480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp        2017-01-07 18:51:46 UTC (rev 210479)
+++ trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp        2017-01-07 21:00:30 UTC (rev 210480)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -44,10 +44,6 @@
</span><span class="cx"> #include &lt;WebCore/ResourceLoader.h&gt;
</span><span class="cx"> #include &lt;WebCore/SubresourceLoader.h&gt;
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-#include &lt;WebCore/QuickLook.h&gt;
-#endif
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, &quot;%p - WebResourceLoader::&quot; fmt, this, ##__VA_ARGS__)
</span><span class="lines">@@ -117,19 +113,7 @@
</span><span class="cx">     if (m_coreLoader-&gt;documentLoader()-&gt;applicationCacheHost()-&gt;maybeLoadFallbackForResponse(m_coreLoader.get(), response))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    bool shoudCallCoreLoaderDidReceiveResponse = true;
-#if USE(QUICK_LOOK)
-    // Refrain from calling didReceiveResponse if QuickLook will convert this response, since the MIME type of the
-    // converted resource isn't yet known. WebResourceLoaderQuickLookDelegate will later call didReceiveResponse upon
-    // receiving the converted data.
-    bool isMainLoad = m_coreLoader-&gt;documentLoader()-&gt;mainResourceLoader() == m_coreLoader;
-    if (isMainLoad &amp;&amp; QuickLookHandle::shouldCreateForMIMEType(response.mimeType())) {
-        m_coreLoader-&gt;documentLoader()-&gt;setQuickLookHandle(QuickLookHandle::create(*m_coreLoader, response));
-        shoudCallCoreLoaderDidReceiveResponse = false;
-    }
-#endif
-    if (shoudCallCoreLoaderDidReceiveResponse)
-        m_coreLoader-&gt;didReceiveResponse(response);
</del><ins>+    m_coreLoader-&gt;didReceiveResponse(response);
</ins><span class="cx"> 
</span><span class="cx">     // If m_coreLoader becomes null as a result of the didReceiveResponse callback, we can't use the send function(). 
</span><span class="cx">     if (!m_coreLoader)
</span><span class="lines">@@ -148,12 +132,6 @@
</span><span class="cx">         m_hasReceivedData = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    if (QuickLookHandle* quickLookHandle = m_coreLoader-&gt;documentLoader()-&gt;quickLookHandle()) {
-        if (quickLookHandle-&gt;didReceiveData(adoptCF(CFDataCreate(kCFAllocatorDefault, data.data(), data.size())).get()))
-            return;
-    }
-#endif
</del><span class="cx">     m_coreLoader-&gt;didReceiveData(reinterpret_cast&lt;const char*&gt;(data.data()), data.size(), encodedDataLength, DataPayloadBytes);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -162,12 +140,6 @@
</span><span class="cx">     LOG(Network, &quot;(WebProcess) WebResourceLoader::didFinishResourceLoad for '%s'&quot;, m_coreLoader-&gt;url().string().latin1().data());
</span><span class="cx">     RELEASE_LOG_IF_ALLOWED(&quot;didFinishResourceLoad: (pageID = %&quot; PRIu64 &quot;, frameID = %&quot; PRIu64 &quot;, resourceID = %&quot; PRIu64 &quot;)&quot;, m_trackingParameters.pageID, m_trackingParameters.frameID, m_trackingParameters.resourceID);
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    if (QuickLookHandle* quickLookHandle = m_coreLoader-&gt;documentLoader()-&gt;quickLookHandle()) {
-        if (quickLookHandle-&gt;didFinishLoading())
-            return;
-    }
-#endif
</del><span class="cx">     m_coreLoader-&gt;didFinishLoading(finishTime);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -176,10 +148,6 @@
</span><span class="cx">     LOG(Network, &quot;(WebProcess) WebResourceLoader::didFailResourceLoad for '%s'&quot;, m_coreLoader-&gt;url().string().latin1().data());
</span><span class="cx">     RELEASE_LOG_IF_ALLOWED(&quot;didFailResourceLoad: (pageID = %&quot; PRIu64 &quot;, frameID = %&quot; PRIu64 &quot;, resourceID = %&quot; PRIu64 &quot;)&quot;, m_trackingParameters.pageID, m_trackingParameters.frameID, m_trackingParameters.resourceID);
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    if (QuickLookHandle* quickLookHandle = m_coreLoader-&gt;documentLoader()-&gt;quickLookHandle())
-        quickLookHandle-&gt;didFail();
-#endif
</del><span class="cx">     if (m_coreLoader-&gt;documentLoader()-&gt;applicationCacheHost()-&gt;maybeLoadFallbackForError(m_coreLoader.get(), error))
</span><span class="cx">         return;
</span><span class="cx">     m_coreLoader-&gt;didFail(error);
</span><span class="lines">@@ -193,18 +161,6 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;SharedBuffer&gt; buffer = handle.tryWrapInSharedBuffer();
</span><span class="cx"> 
</span><del>-#if USE(QUICK_LOOK)
-    if (QuickLookHandle* quickLookHandle = m_coreLoader-&gt;documentLoader()-&gt;quickLookHandle()) {
-        if (buffer) {
-            if (quickLookHandle-&gt;didReceiveData(buffer-&gt;existingCFData())) {
-                quickLookHandle-&gt;didFinishLoading();
-                return;
-            }
-        } else
-            quickLookHandle-&gt;didFail();
-    }
-#endif
-
</del><span class="cx">     if (!buffer) {
</span><span class="cx">         LOG_ERROR(&quot;Unable to create buffer from ShareableResource sent from the network process.&quot;);
</span><span class="cx">         RELEASE_LOG_IF_ALLOWED(&quot;didReceiveResource: Unable to create SharedBuffer (pageID = %&quot; PRIu64 &quot;, frameID = %&quot; PRIu64 &quot;, resourceID = %&quot; PRIu64 &quot;)&quot;, m_trackingParameters.pageID, m_trackingParameters.frameID, m_trackingParameters.resourceID);
</span></span></pre>
</div>
</div>

</body>
</html>