<!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>[211402] 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/211402">211402</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2017-01-30 19:06:05 -0800 (Mon, 30 Jan 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[QuickLook] FrameLoaderClient should return the new QuickLookHandleClient it creates
https://bugs.webkit.org/show_bug.cgi?id=167625

Reviewed by Andreas Kling.

Source/WebCore:

QuickLookHandleClients were being created by QuickLookHandle calling
FrameLoaderClient::didCreateQuickLookHandle() then having the FrameLoaderClient create a new
QuickLookHandleClient and set it using QuickLookHandle::setClient().

Since all FrameLoaderClient::didCreateQuickLookHandle() does is create a new
QuickLookHandleClient, this patch changes the FrameLoaderClient function to return the new
QuickLookHandleClient directly and removes the API from QuickLookHandle to set a client.
This also removes previewFileName() and previewUTI() from QuickLookHandle and instead passes
these as arguments to the FrameLoaderClient.

No change in behavior. Covered by existing tests.

* loader/EmptyClients.cpp: Added an implementation of createQuickLookHandleClient() that
returns nullptr.
* loader/FrameLoaderClient.h: Declared createQuickLookHandleClient() and removed
didCreateQuickLookHandle().
* loader/ios/QuickLook.h: Removed setClient(), previewFileName(), and previewUTI().
* loader/ios/QuickLook.mm: Removed testingOrEmptyClient().
(-[WebPreviewLoader initWithResourceLoader:resourceResponse:quickLookHandle:]): Set _client
to testingClient() if it exists, otherwise set it to the client returned by
FrameLoaderClient::createQuickLookHandleClient() it non-null, otherwise set it to
emptyClient().
(testingOrEmptyClient): Deleted.
(-[WebPreviewLoader setClient:]): Deleted.
(-[WebPreviewLoader converter]): Deleted.
(WebCore::QuickLookHandle::setClient): Deleted.
(WebCore::QuickLookHandle::previewFileName): Deleted.
(WebCore::QuickLookHandle::previewUTI): Deleted.

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.h: Declared createQuickLookHandleClient().
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::createQuickLookHandleClient): Renamed from didCreateQuickLookHandle().
(WebFrameLoaderClient::didCreateQuickLookHandle): Renamed to createQuickLookHandleClient().

Source/WebKit2:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Declared createQuickLookHandleClient().
* WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
(WebKit::WebFrameLoaderClient::createQuickLookHandleClient): Renamed from didCreateQuickLookHandle().
(WebKit::WebFrameLoaderClient::didCreateQuickLookHandle): Renamed to createQuickLookHandleClient().
* WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp:
(WebKit::WebQuickLookHandleClient::WebQuickLookHandleClient): Set m_fileName and m_uti from
the constructor arguments instead of from handle.
* WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientscpp">trunk/Source/WebCore/loader/EmptyClients.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderClienth">trunk/Source/WebCore/loader/FrameLoaderClient.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="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClienth">trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportiosWebFrameLoaderClientIOSmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportiosWebQuickLookHandleClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportiosWebQuickLookHandleClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebCore/ChangeLog        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2017-01-30  Andy Estes  &lt;aestes@apple.com&gt;
+
+        [QuickLook] FrameLoaderClient should return the new QuickLookHandleClient it creates
+        https://bugs.webkit.org/show_bug.cgi?id=167625
+
+        Reviewed by Andreas Kling.
+
+        QuickLookHandleClients were being created by QuickLookHandle calling
+        FrameLoaderClient::didCreateQuickLookHandle() then having the FrameLoaderClient create a new
+        QuickLookHandleClient and set it using QuickLookHandle::setClient().
+
+        Since all FrameLoaderClient::didCreateQuickLookHandle() does is create a new
+        QuickLookHandleClient, this patch changes the FrameLoaderClient function to return the new
+        QuickLookHandleClient directly and removes the API from QuickLookHandle to set a client.
+        This also removes previewFileName() and previewUTI() from QuickLookHandle and instead passes
+        these as arguments to the FrameLoaderClient.
+
+        No change in behavior. Covered by existing tests.
+
+        * loader/EmptyClients.cpp: Added an implementation of createQuickLookHandleClient() that
+        returns nullptr.
+        * loader/FrameLoaderClient.h: Declared createQuickLookHandleClient() and removed
+        didCreateQuickLookHandle().
+        * loader/ios/QuickLook.h: Removed setClient(), previewFileName(), and previewUTI().
+        * loader/ios/QuickLook.mm: Removed testingOrEmptyClient().
+        (-[WebPreviewLoader initWithResourceLoader:resourceResponse:quickLookHandle:]): Set _client
+        to testingClient() if it exists, otherwise set it to the client returned by
+        FrameLoaderClient::createQuickLookHandleClient() it non-null, otherwise set it to
+        emptyClient().
+        (testingOrEmptyClient): Deleted.
+        (-[WebPreviewLoader setClient:]): Deleted.
+        (-[WebPreviewLoader converter]): Deleted.
+        (WebCore::QuickLookHandle::setClient): Deleted.
+        (WebCore::QuickLookHandle::previewFileName): Deleted.
+        (WebCore::QuickLookHandle::previewUTI): Deleted.
+
</ins><span class="cx"> 2017-01-30  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         NULL-deref crash in TextTrack::removeCue()
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.cpp        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -67,6 +67,10 @@
</span><span class="cx"> #include &quot;CompiledContentExtension.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+#include &quot;QuickLookHandleClient.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class UserMessageHandlerDescriptor;
</span><span class="lines">@@ -441,6 +445,10 @@
</span><span class="cx"> 
</span><span class="cx">     bool isEmptyFrameLoaderClient() final { return true; }
</span><span class="cx">     void prefetchDNS(const String&amp;) final { }
</span><ins>+
+#if USE(QUICK_LOOK)
+    RefPtr&lt;QuickLookHandleClient&gt; createQuickLookHandleClient(const String&amp;, const String&amp;) final { return nullptr; }
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class EmptyFrameNetworkingContext final : public FrameNetworkingContext {
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoaderClient.h        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx"> class PluginViewBase;
</span><span class="cx"> class PolicyChecker;
</span><span class="cx"> class ProtectionSpace;
</span><del>-class QuickLookHandle;
</del><ins>+class QuickLookHandleClient;
</ins><span class="cx"> class RTCPeerConnectionHandler;
</span><span class="cx"> class ResourceError;
</span><span class="cx"> class ResourceHandle;
</span><span class="lines">@@ -340,7 +340,7 @@
</span><span class="cx">     virtual bool isEmptyFrameLoaderClient() { return false; }
</span><span class="cx"> 
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><del>-    virtual void didCreateQuickLookHandle(QuickLookHandle&amp;) { }
</del><ins>+    virtual RefPtr&lt;QuickLookHandleClient&gt; createQuickLookHandleClient(const String&amp;, const String&amp;) = 0;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderiosQuickLookh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ios/QuickLook.h (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ios/QuickLook.h        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebCore/loader/ios/QuickLook.h        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -63,12 +63,8 @@
</span><span class="cx">     bool didFinishLoading();
</span><span class="cx">     void didFail();
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT void setClient(Ref&lt;QuickLookHandleClient&gt;&amp;&amp;);
</del><span class="cx">     WEBCORE_EXPORT static void setClientForTesting(RefPtr&lt;QuickLookHandleClient&gt;&amp;&amp;);
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT String previewFileName() const;
-    WEBCORE_EXPORT String previewUTI() const;
-
</del><span class="cx"> private:
</span><span class="cx">     friend std::unique_ptr&lt;QuickLookHandle&gt; std::make_unique&lt;QuickLookHandle&gt;(ResourceLoader&amp;, const ResourceResponse&amp;);
</span><span class="cx">     QuickLookHandle(ResourceLoader&amp;, const ResourceResponse&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderiosQuickLookmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ios/QuickLook.mm (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ios/QuickLook.mm        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebCore/loader/ios/QuickLook.mm        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -134,13 +134,6 @@
</span><span class="cx">     return emptyClient.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static QuickLookHandleClient&amp; testingOrEmptyClient()
-{
-    if (testingClient())
-        return *testingClient();
-    return emptyClient();
-}
-
</del><span class="cx"> @interface WebPreviewLoader : NSObject {
</span><span class="cx">     RefPtr&lt;ResourceLoader&gt; _resourceLoader;
</span><span class="cx">     ResourceResponse _response;
</span><span class="lines">@@ -152,13 +145,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (instancetype)initWithResourceLoader:(ResourceLoader&amp;)resourceLoader resourceResponse:(const ResourceResponse&amp;)resourceResponse quickLookHandle:(QuickLookHandle&amp;)quickLookHandle;
</span><del>-- (void)setClient:(Ref&lt;QuickLookHandleClient&gt;&amp;&amp;)client;
</del><span class="cx"> - (void)appendDataArray:(NSArray&lt;NSData *&gt; *)dataArray;
</span><span class="cx"> - (void)finishedAppending;
</span><span class="cx"> - (void)failed;
</span><span class="cx"> 
</span><del>-@property (nonatomic, readonly) PreviewConverter* converter;
-
</del><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation WebPreviewLoader
</span><span class="lines">@@ -172,20 +162,20 @@
</span><span class="cx">     _resourceLoader = &amp;resourceLoader;
</span><span class="cx">     _response = resourceResponse;
</span><span class="cx">     _handle = &amp;quickLookHandle;
</span><del>-    _client = &amp;testingOrEmptyClient();
</del><span class="cx">     _converter = std::make_unique&lt;PreviewConverter&gt;(self, _response);
</span><span class="cx">     _bufferedDataArray = adoptNS([[NSMutableArray alloc] init]);
</span><span class="cx"> 
</span><ins>+    if (testingClient())
+        _client = testingClient();
+    else if (auto client = resourceLoader.frameLoader()-&gt;client().createQuickLookHandleClient(_converter-&gt;previewFileName(), _converter-&gt;previewUTI()))
+        _client = WTFMove(client);
+    else
+        _client = &amp;emptyClient();
+
</ins><span class="cx">     LOG(Network, &quot;WebPreviewConverter created with preview file name \&quot;%s\&quot;.&quot;, _converter-&gt;previewFileName().utf8().data());
</span><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)setClient:(Ref&lt;QuickLookHandleClient&gt;&amp;&amp;)client
-{
-    if (!testingClient())
-        _client = WTFMove(client);
-}
-
</del><span class="cx"> - (void)appendDataArray:(NSArray&lt;NSData *&gt; *)dataArray
</span><span class="cx"> {
</span><span class="cx">     LOG(Network, &quot;WebPreviewConverter appending data array with count %ld.&quot;, dataArray.count);
</span><span class="lines">@@ -208,11 +198,6 @@
</span><span class="cx">     _client-&gt;didFail();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (PreviewConverter*)converter
-{
-    return _converter.get();
-}
-
</del><span class="cx"> - (void)_sendDidReceiveResponseIfNecessary
</span><span class="cx"> {
</span><span class="cx">     if (_hasSentDidReceiveResponse)
</span><span class="lines">@@ -326,7 +311,6 @@
</span><span class="cx"> QuickLookHandle::QuickLookHandle(ResourceLoader&amp; loader, const ResourceResponse&amp; response)
</span><span class="cx">     : m_previewLoader { adoptNS([[WebPreviewLoader alloc] initWithResourceLoader:loader resourceResponse:response quickLookHandle:*this]) }
</span><span class="cx"> {
</span><del>-    loader.frameLoader()-&gt;client().didCreateQuickLookHandle(*this);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> QuickLookHandle::~QuickLookHandle()
</span><span class="lines">@@ -378,26 +362,11 @@
</span><span class="cx">     m_previewLoader = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void QuickLookHandle::setClient(Ref&lt;QuickLookHandleClient&gt;&amp;&amp; client)
-{
-    [m_previewLoader setClient:WTFMove(client)];
-}
-
</del><span class="cx"> void QuickLookHandle::setClientForTesting(RefPtr&lt;QuickLookHandleClient&gt;&amp;&amp; client)
</span><span class="cx"> {
</span><span class="cx">     testingClient() = WTFMove(client);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String QuickLookHandle::previewFileName() const
-{
-    return [m_previewLoader converter]-&gt;previewFileName();
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-String QuickLookHandle::previewUTI() const
-{
-    return [m_previewLoader converter]-&gt;previewUTI();
-}
-
-}
-
</del><span class="cx"> #endif // USE(QUICK_LOOK)
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebKit/mac/ChangeLog        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-01-30  Andy Estes  &lt;aestes@apple.com&gt;
+
+        [QuickLook] FrameLoaderClient should return the new QuickLookHandleClient it creates
+        https://bugs.webkit.org/show_bug.cgi?id=167625
+
+        Reviewed by Andreas Kling.
+
+        * WebCoreSupport/WebFrameLoaderClient.h: Declared createQuickLookHandleClient().
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::createQuickLookHandleClient): Renamed from didCreateQuickLookHandle().
+        (WebFrameLoaderClient::didCreateQuickLookHandle): Renamed to createQuickLookHandleClient().
+
</ins><span class="cx"> 2017-01-30  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Drop legacy Attributes.isId attribute
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -246,7 +246,7 @@
</span><span class="cx">     bool shouldPaintBrokenImage(const WebCore::URL&amp;) const final;
</span><span class="cx"> 
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><del>-    void didCreateQuickLookHandle(WebCore::QuickLookHandle&amp;) final;
</del><ins>+    RefPtr&lt;WebCore::QuickLookHandleClient&gt; createQuickLookHandleClient(const String&amp; fileName, const String&amp; uti) final;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -2225,7 +2225,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><del>-void WebFrameLoaderClient::didCreateQuickLookHandle(WebCore::QuickLookHandle&amp; handle)
</del><ins>+RefPtr&lt;QuickLookHandleClient&gt; WebFrameLoaderClient::createQuickLookHandleClient(const String&amp; fileName, const String&amp; uti)
</ins><span class="cx"> {
</span><span class="cx">     class QuickLookDocumentWriter : public WebCore::QuickLookHandleClient {
</span><span class="cx">     public:
</span><span class="lines">@@ -2263,14 +2263,14 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     if (![m_webFrame webView].preferences.quickLookDocumentSavingEnabled)
</span><del>-        return;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><del>-    NSString *filePath = createTemporaryFileForQuickLook(handle.previewFileName());
</del><ins>+    NSString *filePath = createTemporaryFileForQuickLook(fileName);
</ins><span class="cx">     if (!filePath)
</span><del>-        return;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><del>-    [m_webFrame provisionalDataSource]._quickLookContent = @{ WebQuickLookFileNameKey : filePath, WebQuickLookUTIKey : handle.previewUTI() };
-    handle.setClient(adoptRef(*new QuickLookDocumentWriter(filePath)));
</del><ins>+    [m_webFrame provisionalDataSource]._quickLookContent = @{ WebQuickLookFileNameKey : filePath, WebQuickLookUTIKey : uti };
+    return adoptRef(*new QuickLookDocumentWriter(filePath));
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebKit2/ChangeLog        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2017-01-30  Andy Estes  &lt;aestes@apple.com&gt;
+
+        [QuickLook] FrameLoaderClient should return the new QuickLookHandleClient it creates
+        https://bugs.webkit.org/show_bug.cgi?id=167625
+
+        Reviewed by Andreas Kling.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Declared createQuickLookHandleClient().
+        * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
+        (WebKit::WebFrameLoaderClient::createQuickLookHandleClient): Renamed from didCreateQuickLookHandle().
+        (WebKit::WebFrameLoaderClient::didCreateQuickLookHandle): Renamed to createQuickLookHandleClient().
+        * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp:
+        (WebKit::WebQuickLookHandleClient::WebQuickLookHandleClient): Set m_fileName and m_uti from
+        the constructor arguments instead of from handle.
+        * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h:
+
</ins><span class="cx"> 2017-01-30  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add some more crash reporter information to diagnose a failed mach_msg
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -245,7 +245,7 @@
</span><span class="cx">     void forcePageTransitionIfNeeded() final;
</span><span class="cx"> 
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><del>-    void didCreateQuickLookHandle(WebCore::QuickLookHandle&amp;) final;
</del><ins>+    RefPtr&lt;WebCore::QuickLookHandleClient&gt; createQuickLookHandleClient(const String&amp; fileName, const String&amp; uti) final;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportiosWebFrameLoaderClientIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -66,16 +66,16 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><del>-void WebFrameLoaderClient::didCreateQuickLookHandle(WebCore::QuickLookHandle&amp; handle)
</del><ins>+RefPtr&lt;QuickLookHandleClient&gt; WebFrameLoaderClient::createQuickLookHandleClient(const String&amp; fileName, const String&amp; uti)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_frame-&gt;isMainFrame())
</span><del>-        return;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     WebPage* webPage = m_frame-&gt;page();
</span><span class="cx">     if (!webPage)
</span><del>-        return;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><del>-    handle.setClient(WebQuickLookHandleClient::create(handle, webPage-&gt;pageID()));
</del><ins>+    return WebQuickLookHandleClient::create(fileName, uti, webPage-&gt;pageID());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportiosWebQuickLookHandleClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -44,10 +44,10 @@
</span><span class="cx">     return callbackMap.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebQuickLookHandleClient::WebQuickLookHandleClient(const WebCore::QuickLookHandle&amp; handle, uint64_t pageID)
-    : m_fileName(handle.previewFileName())
-    , m_uti(handle.previewUTI())
-    , m_pageID(pageID)
</del><ins>+WebQuickLookHandleClient::WebQuickLookHandleClient(const String&amp; fileName, const String&amp; uti, uint64_t pageID)
+    : m_fileName { fileName }
+    , m_uti { uti }
+    , m_pageID { pageID }
</ins><span class="cx"> {
</span><span class="cx">     WebProcess::singleton().send(Messages::WebPageProxy::DidStartLoadForQuickLookDocumentInMainFrame(m_fileName, m_uti), m_pageID);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportiosWebQuickLookHandleClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h (211401 => 211402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h        2017-01-31 02:38:07 UTC (rev 211401)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h        2017-01-31 03:06:05 UTC (rev 211402)
</span><span class="lines">@@ -41,9 +41,9 @@
</span><span class="cx"> 
</span><span class="cx"> class WebQuickLookHandleClient final : public WebCore::QuickLookHandleClient {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;WebQuickLookHandleClient&gt; create(const WebCore::QuickLookHandle&amp; handle, uint64_t pageID)
</del><ins>+    static Ref&lt;WebQuickLookHandleClient&gt; create(const String&amp; fileName, const String&amp; uti, uint64_t pageID)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new WebQuickLookHandleClient(handle, pageID));
</del><ins>+        return adoptRef(*new WebQuickLookHandleClient(fileName, uti, pageID));
</ins><span class="cx">     }
</span><span class="cx">     ~WebQuickLookHandleClient();
</span><span class="cx"> 
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">     static void didReceivePassword(const String&amp;, uint64_t pageID);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    WebQuickLookHandleClient(const WebCore::QuickLookHandle&amp;, uint64_t pageID);
</del><ins>+    WebQuickLookHandleClient(const String&amp; fileName, const String&amp; uti, uint64_t pageID);
</ins><span class="cx">     void didReceiveDataArray(CFArrayRef) override;
</span><span class="cx">     void didFinishLoading() override;
</span><span class="cx">     void didFail() override;
</span></span></pre>
</div>
</div>

</body>
</html>