<!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>[167901] 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/167901">167901</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2014-04-28 13:02:41 -0700 (Mon, 28 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] Implement WebQuickLookHandleClient for WebKit2
https://bugs.webkit.org/show_bug.cgi?id=132157

Reviewed by Darin Adler.

Source/WebCore:
* WebCore.exp.in: Exported QuickLookHandle::previewUTI().
* platform/network/ios/QuickLook.h:
* platform/network/ios/QuickLook.mm:
(WebCore::QuickLookHandle::previewFileName): Changed to return a WTF::String.
(WebCore::QuickLookHandle::previewUTI): Added.

Source/WebKit2:
* Shared/API/Cocoa/_WKNSFileManagerExtras.h: Added.
* Shared/API/Cocoa/_WKNSFileManagerExtras.mm: Added.
(+[NSFileManager _web_createTemporaryFileForQuickLook:]): Called WebCore::createTemporaryFileForQuickLook().
* Shared/ios/QuickLookDocumentData.cpp: Added.
(WebKit::QuickLookDocumentData::QuickLookDocumentData):
(WebKit::QuickLookDocumentData::append): Appened each CFDataRef to m_data and added their sizes to m_size.
(WebKit::QuickLookDocumentData::decodedData): Returned the combined CFDataRef created by decode().
Named this method 'decodedData' to indicate that it should only be called on objects populated by decode().
(WebKit::QuickLookDocumentData::clear): Cleared m_data and reset m_size to 0.
(WebKit::QuickLookDocumentData::encode): Implemented a custom encoding function to avoid having to combine
m_data into contiguous memory at encoding time. Encoded m_size then sequentially encoded each member of m_data.
(WebKit::QuickLookDocumentData::decode): Decoded the byte stream into a single CFDataRef. Eagerly copied the
decoded data rather than using a DataReference since we know this will outlive the decoder.
* Shared/ios/QuickLookDocumentData.h: Added.
* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame):
(API::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame):
(WebKit::NavigationState::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didStartLoadForQuickLookDocumentInMainFrame):
(WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
(WebKit::WebFrameLoaderClient::didCreateQuickLookHandle):
* WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp: Added.
(WebKit::WebQuickLookHandleClient::WebQuickLookHandleClient): Sent DidStartLoadForQuickLookDocumentInMainFrame
to WebPageProxy.
(WebKit::WebQuickLookHandleClient::didReceiveDataArray): Appended dataArray to m_data.
(WebKit::WebQuickLookHandleClient::didFinishLoading): Sent DidFinishLoadForQuickLookDocumentInMainFrame to
WebPageProxy and then cleared m_data.
(WebKit::WebQuickLookHandleClient::didFail): Cleared m_data.
* WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h: Added.
(WebKit::WebQuickLookHandleClient::create):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkiosQuickLookh">trunk/Source/WebCore/platform/network/ios/QuickLook.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkiosQuickLookmm">trunk/Source/WebCore/platform/network/ios/QuickLook.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPILoaderClienth">trunk/Source/WebKit2/UIProcess/API/APILoaderClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKNavigationDelegatePrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaNavigationStateh">trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaNavigationStatemm">trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedAPICocoa_WKNSFileManagerExtrash">trunk/Source/WebKit2/Shared/API/Cocoa/_WKNSFileManagerExtras.h</a></li>
<li><a href="#trunkSourceWebKit2SharedAPICocoa_WKNSFileManagerExtrasmm">trunk/Source/WebKit2/Shared/API/Cocoa/_WKNSFileManagerExtras.mm</a></li>
<li><a href="#trunkSourceWebKit2SharediosQuickLookDocumentDatacpp">trunk/Source/WebKit2/Shared/ios/QuickLookDocumentData.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharediosQuickLookDocumentDatah">trunk/Source/WebKit2/Shared/ios/QuickLookDocumentData.h</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 (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebCore/ChangeLog        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-04-24  Andy Estes  &lt;aestes@apple.com&gt;
+
+        [iOS] Implement WebQuickLookHandleClient for WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=132157
+
+        Reviewed by Darin Adler.
+
+        * WebCore.exp.in: Exported QuickLookHandle::previewUTI().
+        * platform/network/ios/QuickLook.h:
+        * platform/network/ios/QuickLook.mm:
+        (WebCore::QuickLookHandle::previewFileName): Changed to return a WTF::String.
+        (WebCore::QuickLookHandle::previewUTI): Added.
+
</ins><span class="cx"> 2014-04-28  Chris Fleizach  &lt;cfleizach@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION: Intermittent crash in SpeechSynthesis::didFinishSpeaking
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -3231,6 +3231,7 @@
</span><span class="cx"> __ZN7WebCore33QLPreviewGetSupportedMIMETypesSetEv
</span><span class="cx"> __ZN7WebCore34registerQLPreviewConverterIfNeededEP5NSURLP8NSStringP6NSData
</span><span class="cx"> __ZN7WebCore35addQLPreviewConverterWithFileForURLEP5NSURLP11objc_objectP8NSString
</span><ins>+__ZNK7WebCore15QuickLookHandle10previewUTIEv
</ins><span class="cx"> __ZNK7WebCore15QuickLookHandle15previewFileNameEv
</span><span class="cx"> __ZNK7WebCore15QuickLookHandle17previewRequestURLEv
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkiosQuickLookh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ios/QuickLook.h (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ios/QuickLook.h        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebCore/platform/network/ios/QuickLook.h        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -101,7 +101,8 @@
</span><span class="cx"> 
</span><span class="cx">     void setClient(PassRefPtr&lt;QuickLookHandleClient&gt; client) { m_client = client; }
</span><span class="cx"> 
</span><del>-    NSString *previewFileName() const;
</del><ins>+    String previewFileName() const;
+    String previewUTI() const;
</ins><span class="cx">     NSURL *firstRequestURL() const { return m_firstRequestURL.get(); }
</span><span class="cx">     NSURL *previewRequestURL() const;
</span><span class="cx">     QLPreviewConverter *converter() const { return m_converter.get(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkiosQuickLookmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ios/QuickLook.mm (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ios/QuickLook.mm        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebCore/platform/network/ios/QuickLook.mm        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -515,11 +515,16 @@
</span><span class="cx">     [m_delegate clearHandle];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-NSString *QuickLookHandle::previewFileName() const
</del><ins>+String QuickLookHandle::previewFileName() const
</ins><span class="cx"> {
</span><span class="cx">     return [m_converter previewFileName];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String QuickLookHandle::previewUTI() const
+{
+    return [m_converter previewUTI];
+}
+
</ins><span class="cx"> NSURL *QuickLookHandle::previewRequestURL() const
</span><span class="cx"> {
</span><span class="cx">     return [[m_converter previewRequest] URL];
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebKit2/ChangeLog        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2014-04-24  Andy Estes  &lt;aestes@apple.com&gt;
+
+        [iOS] Implement WebQuickLookHandleClient for WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=132157
+
+        Reviewed by Darin Adler.
+
+        * Shared/API/Cocoa/_WKNSFileManagerExtras.h: Added.
+        * Shared/API/Cocoa/_WKNSFileManagerExtras.mm: Added.
+        (+[NSFileManager _web_createTemporaryFileForQuickLook:]): Called WebCore::createTemporaryFileForQuickLook().
+        * Shared/ios/QuickLookDocumentData.cpp: Added.
+        (WebKit::QuickLookDocumentData::QuickLookDocumentData):
+        (WebKit::QuickLookDocumentData::append): Appened each CFDataRef to m_data and added their sizes to m_size.
+        (WebKit::QuickLookDocumentData::decodedData): Returned the combined CFDataRef created by decode().
+        Named this method 'decodedData' to indicate that it should only be called on objects populated by decode().
+        (WebKit::QuickLookDocumentData::clear): Cleared m_data and reset m_size to 0.
+        (WebKit::QuickLookDocumentData::encode): Implemented a custom encoding function to avoid having to combine
+        m_data into contiguous memory at encoding time. Encoded m_size then sequentially encoded each member of m_data.
+        (WebKit::QuickLookDocumentData::decode): Decoded the byte stream into a single CFDataRef. Eagerly copied the
+        decoded data rather than using a DataReference since we know this will outlive the decoder.
+        * Shared/ios/QuickLookDocumentData.h: Added.
+        * UIProcess/API/APILoaderClient.h:
+        (API::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame):
+        (API::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame):
+        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
+        * UIProcess/Cocoa/NavigationState.h:
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::setNavigationDelegate):
+        (WebKit::NavigationState::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame):
+        (WebKit::NavigationState::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::didStartLoadForQuickLookDocumentInMainFrame):
+        (WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame):
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+        * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
+        (WebKit::WebFrameLoaderClient::didCreateQuickLookHandle):
+        * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp: Added.
+        (WebKit::WebQuickLookHandleClient::WebQuickLookHandleClient): Sent DidStartLoadForQuickLookDocumentInMainFrame
+        to WebPageProxy.
+        (WebKit::WebQuickLookHandleClient::didReceiveDataArray): Appended dataArray to m_data.
+        (WebKit::WebQuickLookHandleClient::didFinishLoading): Sent DidFinishLoadForQuickLookDocumentInMainFrame to
+        WebPageProxy and then cleared m_data.
+        (WebKit::WebQuickLookHandleClient::didFail): Cleared m_data.
+        * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h: Added.
+        (WebKit::WebQuickLookHandleClient::create):
+
</ins><span class="cx"> 2014-04-28  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Hide service controls for selection behind a runtime switch
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAPICocoa_WKNSFileManagerExtrashfromrev167900trunkSourceWebKit2WebProcessWebCoreSupportiosWebFrameLoaderClientIOSmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Shared/API/Cocoa/_WKNSFileManagerExtras.h (from rev 167900, trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm) (0 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/Cocoa/_WKNSFileManagerExtras.h                                (rev 0)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/_WKNSFileManagerExtras.h        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &lt;WebKit2/WKFoundation.h&gt;
+
+#if TARGET_OS_IPHONE
+
+@interface NSFileManager (WKExtras)
+
++ (NSString *)_web_createTemporaryFileForQuickLook:(NSString *)fileName;
+
+@end
+
+#endif // TARGET_OS_IPHONE
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedAPICocoa_WKNSFileManagerExtrasmmfromrev167900trunkSourceWebKit2WebProcessWebCoreSupportiosWebFrameLoaderClientIOSmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Shared/API/Cocoa/_WKNSFileManagerExtras.mm (from rev 167900, trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm) (0 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/Cocoa/_WKNSFileManagerExtras.mm                                (rev 0)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/_WKNSFileManagerExtras.mm        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;_WKNSFileManagerExtras.h&quot;
+
+#if USE(QUICK_LOOK)
+
+#import &lt;WebCore/QuickLook.h&gt;
+
+@implementation NSFileManager (WKExtras)
+
++ (NSString *)_web_createTemporaryFileForQuickLook:(NSString *)fileName
+{
+    return WebCore::createTemporaryFileForQuickLook(fileName);
+}
+
+@end
+
+#endif // USE(QUICK_LOOK)
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharediosQuickLookDocumentDatacpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/ios/QuickLookDocumentData.cpp (0 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ios/QuickLookDocumentData.cpp                                (rev 0)
+++ trunk/Source/WebKit2/Shared/ios/QuickLookDocumentData.cpp        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;QuickLookDocumentData.h&quot;
+
+#if USE(QUICK_LOOK)
+
+#include &quot;ArgumentDecoder.h&quot;
+#include &quot;ArgumentEncoder.h&quot;
+
+namespace WebKit {
+
+void QuickLookDocumentData::append(CFDataRef data)
+{
+    m_data.append(data);
+}
+
+CFDataRef QuickLookDocumentData::decodedData() const
+{
+    ASSERT(m_data.size() &lt;= 1);
+    if (m_data.isEmpty())
+        return nullptr;
+    return m_data[0].get();
+}
+
+void QuickLookDocumentData::clear()
+{
+    m_data.clear();
+}
+
+void QuickLookDocumentData::encode(IPC::ArgumentEncoder&amp; encoder) const
+{
+    uint64_t size = 0;
+    for (const auto&amp; data : m_data)
+        size += CFDataGetLength(data.get());
+    encoder &lt;&lt; size;
+
+    for (const auto&amp; data : m_data)
+        encoder.encodeFixedLengthData(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get()), 1);
+}
+
+bool QuickLookDocumentData::decode(IPC::ArgumentDecoder&amp; decoder, QuickLookDocumentData&amp; documentData)
+{
+    uint64_t size;
+    if (!decoder.decode(size))
+        return false;
+
+    if (!size)
+        return true;
+
+    uint8_t* const buffer = static_cast&lt;uint8_t*&gt;(CFAllocatorAllocate(kCFAllocatorDefault, size, 0));
+    ASSERT(buffer);
+
+    if (!decoder.decodeFixedLengthData(buffer, size, 1)) {
+        CFAllocatorDeallocate(kCFAllocatorDefault, buffer);
+        return false;
+    }
+
+    documentData.clear();
+    documentData.m_data.append(adoptCF(CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, buffer, size, kCFAllocatorDefault)));
+    return true;
+}
+
+} // namespace WebKit
+
+#endif // USE(QUICK_LOOK)
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharediosQuickLookDocumentDatahfromrev167900trunkSourceWebKit2WebProcessWebCoreSupportiosWebFrameLoaderClientIOSmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Shared/ios/QuickLookDocumentData.h (from rev 167900, trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm) (0 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ios/QuickLookDocumentData.h                                (rev 0)
+++ trunk/Source/WebKit2/Shared/ios/QuickLookDocumentData.h        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef QuickLookDocumentData_h
+#define QuickLookDocumentData_h
+
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace IPC {
+class ArgumentDecoder;
+class ArgumentEncoder;
+}
+
+namespace WebKit {
+
+class QuickLookDocumentData {
+public:
+    void append(CFDataRef);
+    CFDataRef decodedData() const;
+    void clear();
+    void encode(IPC::ArgumentEncoder&amp;) const;
+    static bool decode(IPC::ArgumentDecoder&amp;, QuickLookDocumentData&amp;);
+
+private:
+    Vector&lt;RetainPtr&lt;CFDataRef&gt;, 1&gt; m_data;
+};
+} // namespace WebKit
+
+#endif // QuickLookDocumentData_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPILoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APILoaderClient.h (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APILoaderClient.h        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebKit2/UIProcess/API/APILoaderClient.h        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> class AuthenticationChallengeProxy;
</span><span class="cx"> class ImmutableDictionary;
</span><ins>+class QuickLookDocumentData;
</ins><span class="cx"> class WebBackForwardListItem;
</span><span class="cx"> class WebFrameProxy;
</span><span class="cx"> class WebPageProxy;
</span><span class="lines">@@ -100,6 +101,11 @@
</span><span class="cx">     virtual WebCore::WebGLLoadPolicy webGLLoadPolicy(WebKit::WebPageProxy*, const WTF::String&amp;) const { return WebCore::WebGLLoadPolicy::WebGLAllowCreation; }
</span><span class="cx">     virtual WebCore::WebGLLoadPolicy resolveWebGLLoadPolicy(WebKit::WebPageProxy*, const WTF::String&amp;) const { return WebCore::WebGLLoadPolicy::WebGLAllowCreation; }
</span><span class="cx"> #endif // ENABLE(WEBGL)
</span><ins>+
+#if USE(QUICK_LOOK)
+    virtual void didStartLoadForQuickLookDocumentInMainFrame(const WTF::String&amp; fileName, const WTF::String&amp; uti) { }
+    virtual void didFinishLoadForQuickLookDocumentInMainFrame(const WebKit::QuickLookDocumentData&amp;) { }
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace API
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKNavigationDelegatePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -45,6 +45,11 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_webViewWebProcessDidCrash:(WKWebView *)webView;
</span><span class="cx"> 
</span><ins>+#if TARGET_OS_IPHONE
+- (void)_webView:(WKWebView *)webView didStartLoadForQuickLookDocumentInMainFrameWithFileName:(NSString *)fileName uti:(NSString *)uti;
+- (void)_webView:(WKWebView *)webView didFinishLoadForQuickLookDocumentInMainFrame:(NSData *)documentData;
+#endif
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaNavigationStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -103,6 +103,10 @@
</span><span class="cx">         virtual void didReceiveAuthenticationChallengeInFrame(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebKit::AuthenticationChallengeProxy*) override;
</span><span class="cx">         virtual void processDidCrash(WebKit::WebPageProxy*) override;
</span><span class="cx">         virtual void didChangeBackForwardList(WebKit::WebPageProxy*, WebKit::WebBackForwardListItem* addedItem, Vector&lt;RefPtr&lt;WebKit::WebBackForwardListItem&gt;&gt; removedItems) override;
</span><ins>+#if USE(QUICK_LOOK)
+        virtual void didStartLoadForQuickLookDocumentInMainFrame(const WTF::String&amp; fileName, const WTF::String&amp; uti) override;
+        virtual void didFinishLoadForQuickLookDocumentInMainFrame(const WebKit::QuickLookDocumentData&amp;) override;
+#endif
</ins><span class="cx"> 
</span><span class="cx">         NavigationState&amp; m_navigationState;
</span><span class="cx">     };
</span><span class="lines">@@ -138,6 +142,10 @@
</span><span class="cx">         bool webViewCanAuthenticateAgainstProtectionSpace : 1;
</span><span class="cx">         bool webViewDidReceiveAuthenticationChallenge : 1;
</span><span class="cx">         bool webViewWebProcessDidCrash : 1;
</span><ins>+#if USE(QUICK_LOOK)
+        bool webViewDidStartLoadForQuickLookDocumentInMainFrame : 1;
+        bool webViewDidFinishLoadForQuickLookDocumentInMainFrame : 1;
+#endif
</ins><span class="cx">     } m_navigationDelegateMethods;
</span><span class="cx"> 
</span><span class="cx">     HashMap&lt;uint64_t, RetainPtr&lt;WKNavigation&gt;&gt; m_navigations;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaNavigationStatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -53,6 +53,10 @@
</span><span class="cx"> #import &quot;WebPageProxy.h&quot;
</span><span class="cx"> #import &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+#import &quot;QuickLookDocumentData.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> static HashMap&lt;WebPageProxy*, NavigationState*&gt;&amp; navigationStates()
</span><span class="lines">@@ -123,6 +127,10 @@
</span><span class="cx">     m_navigationDelegateMethods.webViewCanAuthenticateAgainstProtectionSpace = [delegate respondsToSelector:@selector(_webView:canAuthenticateAgainstProtectionSpace:)];
</span><span class="cx">     m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallenge = [delegate respondsToSelector:@selector(_webView:didReceiveAuthenticationChallenge:)];
</span><span class="cx">     m_navigationDelegateMethods.webViewWebProcessDidCrash = [delegate respondsToSelector:@selector(_webViewWebProcessDidCrash:)];
</span><ins>+#if USE(QUICK_LOOK)
+    m_navigationDelegateMethods.webViewDidStartLoadForQuickLookDocumentInMainFrame = [delegate respondsToSelector:@selector(_webView:didStartLoadForQuickLookDocumentInMainFrameWithFileName:uti:)];
+    m_navigationDelegateMethods.webViewDidFinishLoadForQuickLookDocumentInMainFrame = [delegate respondsToSelector:@selector(_webView:didFinishLoadForQuickLookDocumentInMainFrame:)];
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RetainPtr&lt;id &lt;WKHistoryDelegatePrivate&gt; &gt; NavigationState::historyDelegate()
</span><span class="lines">@@ -567,6 +575,32 @@
</span><span class="cx">     [[NSNotificationCenter defaultCenter] postNotificationName:_WKBackForwardListDidChangeNotification object:wrapper(m_navigationState.m_webView-&gt;_page-&gt;backForwardList())];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+void NavigationState::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame(const String&amp; fileName, const String&amp; uti)
+{
+    if (!m_navigationState.m_navigationDelegateMethods.webViewDidStartLoadForQuickLookDocumentInMainFrame)
+        return;
+
+    auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
+    if (!navigationDelegate)
+        return;
+
+    [static_cast&lt;id &lt;WKNavigationDelegatePrivate&gt;&gt;(navigationDelegate.get()) _webView:m_navigationState.m_webView didStartLoadForQuickLookDocumentInMainFrameWithFileName:fileName uti:uti];
+}
+
+void NavigationState::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame(const WebKit::QuickLookDocumentData&amp; data)
+{
+    if (!m_navigationState.m_navigationDelegateMethods.webViewDidFinishLoadForQuickLookDocumentInMainFrame)
+        return;
+
+    auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
+    if (!navigationDelegate)
+        return;
+
+    [static_cast&lt;id &lt;WKNavigationDelegatePrivate&gt;&gt;(navigationDelegate.get()) _webView:m_navigationState.m_webView didFinishLoadForQuickLookDocumentInMainFrame:(NSData *)data.decodedData()];
+}
+#endif
+
</ins><span class="cx"> void NavigationState::willChangeIsLoading()
</span><span class="cx"> {
</span><span class="cx">     [m_webView willChangeValueForKey:@&quot;loading&quot;];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -173,6 +173,10 @@
</span><span class="cx"> class WebVibrationProxy;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+class QuickLookDocumentData;
+#endif
+
</ins><span class="cx"> typedef GenericCallback&lt;uint64_t&gt; UnsignedCallback;
</span><span class="cx"> typedef GenericCallback&lt;EditingRange&gt; EditingRangeCallback;
</span><span class="cx"> typedef GenericCallback&lt;StringImpl*&gt; StringCallback;
</span><span class="lines">@@ -1394,6 +1398,11 @@
</span><span class="cx">     void findPlugin(const String&amp; mimeType, uint32_t processType, const String&amp; urlString, const String&amp; frameURLString, const String&amp; pageURLString, bool allowOnlyApplicationPlugins, uint64_t&amp; pluginProcessToken, String&amp; newMIMEType, uint32_t&amp; pluginLoadPolicy, String&amp; unavailabilityDescription);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+    void didStartLoadForQuickLookDocumentInMainFrame(const String&amp; fileName, const String&amp; uti);
+    void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&amp;);
+#endif
+
</ins><span class="cx">     uint64_t generateNavigationID();
</span><span class="cx"> 
</span><span class="cx">     PageClient&amp; m_pageClient;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -367,4 +367,9 @@
</span><span class="cx">     ShowTelephoneNumberMenu(String telephoneNumber, WebCore::IntPoint point)
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><ins>+
+#if USE(QUICK_LOOK)
+    DidStartLoadForQuickLookDocumentInMainFrame(String fileName, String uti)
+    DidFinishLoadForQuickLookDocumentInMainFrame(WebKit::QuickLookDocumentData data)
+#endif
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -44,6 +44,11 @@
</span><span class="cx"> #import &lt;WebCore/SharedBuffer.h&gt;
</span><span class="cx"> #import &lt;WebCore/UserAgent.h&gt;
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+#import &quot;APILoaderClient.h&quot;
+#import &lt;wtf/text/WTFString.h&gt;
+#endif
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -575,6 +580,21 @@
</span><span class="cx">     m_pageClient.zoomToRect(rect, minimumScale, maximumScale);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+    
+void WebPageProxy::didStartLoadForQuickLookDocumentInMainFrame(const String&amp; fileName, const String&amp; uti)
+{
+    // Ensure that fileName isn't really a path name
+    static_assert(notFound + 1 == 0, &quot;The following line assumes WTF::notFound equals -1&quot;);
+    m_loaderClient-&gt;didStartLoadForQuickLookDocumentInMainFrame(fileName.substring(fileName.reverseFind('/') + 1), uti);
+}
+
+void WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&amp; data)
+{
+    m_loaderClient-&gt;didFinishLoadForQuickLookDocumentInMainFrame(data);
+}
+#endif
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -1021,10 +1021,16 @@
</span><span class="cx">                 9F54F8951648AE0F007DF81A /* PluginProcessManagerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9F54F8941648AE0E007DF81A /* PluginProcessManagerMac.mm */; };
</span><span class="cx">                 9FB5F394169E6A80002C25BF /* WKContextPrivateMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9FB5F392169E6A80002C25BF /* WKContextPrivateMac.mm */; };
</span><span class="cx">                 9FB5F395169E6A80002C25BF /* WKContextPrivateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FB5F393169E6A80002C25BF /* WKContextPrivateMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                A118A9EE1907AD6F00F7C92B /* QuickLookDocumentData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A118A9EC1907AD6F00F7C92B /* QuickLookDocumentData.cpp */; };
+                A118A9EF1907AD6F00F7C92B /* QuickLookDocumentData.h in Headers */ = {isa = PBXBuildFile; fileRef = A118A9ED1907AD6F00F7C92B /* QuickLookDocumentData.h */; };
+                A118A9F21908B8EA00F7C92B /* _WKNSFileManagerExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = A118A9F01908B8EA00F7C92B /* _WKNSFileManagerExtras.mm */; };
+                A118A9F31908B8EA00F7C92B /* _WKNSFileManagerExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A118A9F11908B8EA00F7C92B /* _WKNSFileManagerExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 A1A4FE5A18DCE9FA00B5EA8A /* _WKDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = A1A4FE5718DCE9FA00B5EA8A /* _WKDownload.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A1A4FE5B18DCE9FA00B5EA8A /* _WKDownload.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1A4FE5818DCE9FA00B5EA8A /* _WKDownload.mm */; };
</span><span class="cx">                 A1A4FE5C18DCE9FA00B5EA8A /* _WKDownloadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A1A4FE5918DCE9FA00B5EA8A /* _WKDownloadInternal.h */; };
</span><span class="cx">                 A1A4FE6118DD54A400B5EA8A /* _WKDownloadDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A1A4FE6018DD54A400B5EA8A /* _WKDownloadDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                A1C512C8190656E500448914 /* WebQuickLookHandleClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1C512C6190656E500448914 /* WebQuickLookHandleClient.cpp */; };
+                A1C512C9190656E500448914 /* WebQuickLookHandleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A1C512C7190656E500448914 /* WebQuickLookHandleClient.h */; };
</ins><span class="cx">                 A1DF631218E0B7C8003A3E2A /* DownloadClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1DF631018E0B7C8003A3E2A /* DownloadClient.mm */; };
</span><span class="cx">                 A1DF631318E0B7C8003A3E2A /* DownloadClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A1DF631118E0B7C8003A3E2A /* DownloadClient.h */; };
</span><span class="cx">                 A5EFD38C16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EFD38B16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2886,10 +2892,16 @@
</span><span class="cx">                 9F54F8941648AE0E007DF81A /* PluginProcessManagerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginProcessManagerMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9FB5F392169E6A80002C25BF /* WKContextPrivateMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKContextPrivateMac.mm; path = mac/WKContextPrivateMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9FB5F393169E6A80002C25BF /* WKContextPrivateMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKContextPrivateMac.h; path = mac/WKContextPrivateMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A118A9EC1907AD6F00F7C92B /* QuickLookDocumentData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = QuickLookDocumentData.cpp; path = ios/QuickLookDocumentData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A118A9ED1907AD6F00F7C92B /* QuickLookDocumentData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QuickLookDocumentData.h; path = ios/QuickLookDocumentData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A118A9F01908B8EA00F7C92B /* _WKNSFileManagerExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKNSFileManagerExtras.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A118A9F11908B8EA00F7C92B /* _WKNSFileManagerExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKNSFileManagerExtras.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A1A4FE5718DCE9FA00B5EA8A /* _WKDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKDownload.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1A4FE5818DCE9FA00B5EA8A /* _WKDownload.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKDownload.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1A4FE5918DCE9FA00B5EA8A /* _WKDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKDownloadInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1A4FE6018DD54A400B5EA8A /* _WKDownloadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKDownloadDelegate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A1C512C6190656E500448914 /* WebQuickLookHandleClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebQuickLookHandleClient.cpp; path = ios/WebQuickLookHandleClient.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A1C512C7190656E500448914 /* WebQuickLookHandleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebQuickLookHandleClient.h; path = ios/WebQuickLookHandleClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A1DF631018E0B7C8003A3E2A /* DownloadClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DownloadClient.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1DF631118E0B7C8003A3E2A /* DownloadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DownloadClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1EDD2D91884ACE000BBFE98 /* All.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = All.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4420,6 +4432,8 @@
</span><span class="cx">                                 2D28F3E11885CCC1004B9EAE /* WebDatabaseManagerIOS.mm */,
</span><span class="cx">                                 2D28F3E21885CCC1004B9EAE /* WebEditorClientIOS.mm */,
</span><span class="cx">                                 2D28F3E31885CCC1004B9EAE /* WebFrameLoaderClientIOS.mm */,
</span><ins>+                                A1C512C6190656E500448914 /* WebQuickLookHandleClient.cpp */,
+                                A1C512C7190656E500448914 /* WebQuickLookHandleClient.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = ios;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -4438,6 +4452,8 @@
</span><span class="cx">                                 2DA9449D1884E4F000ED86DB /* GestureTypes.h */,
</span><span class="cx">                                 2DA944971884E4F000ED86DB /* NativeWebKeyboardEventIOS.mm */,
</span><span class="cx">                                 2DA944981884E4F000ED86DB /* NativeWebTouchEventIOS.mm */,
</span><ins>+                                A118A9EC1907AD6F00F7C92B /* QuickLookDocumentData.cpp */,
+                                A118A9ED1907AD6F00F7C92B /* QuickLookDocumentData.h */,
</ins><span class="cx">                                 2DA944991884E4F000ED86DB /* WebIOSEventFactory.h */,
</span><span class="cx">                                 2DA9449A1884E4F000ED86DB /* WebIOSEventFactory.mm */,
</span><span class="cx">                                 2DA9449B1884E4F000ED86DB /* WebPlatformTouchPointIOS.cpp */,
</span><span class="lines">@@ -4750,6 +4766,8 @@
</span><span class="cx">                                 373D122118A473010066D9CC /* _WKFrameHandle.h */,
</span><span class="cx">                                 373D122018A473010066D9CC /* _WKFrameHandle.mm */,
</span><span class="cx">                                 373D122618A473F60066D9CC /* _WKFrameHandleInternal.h */,
</span><ins>+                                A118A9F11908B8EA00F7C92B /* _WKNSFileManagerExtras.h */,
+                                A118A9F01908B8EA00F7C92B /* _WKNSFileManagerExtras.mm */,
</ins><span class="cx">                                 1A9E328B182165A900F5D04C /* _WKRemoteObjectInterface.h */,
</span><span class="cx">                                 1A9E328C182165A900F5D04C /* _WKRemoteObjectInterface.mm */,
</span><span class="cx">                                 1AABFE391829C1ED005B070E /* _WKRemoteObjectInterfaceInternal.h */,
</span><span class="lines">@@ -6779,6 +6797,7 @@
</span><span class="cx">                                 BCB0AEE9122F53E300B1341E /* MutableDictionary.h in Headers */,
</span><span class="cx">                                 1A6FBA2A11E6862700DB1371 /* NetscapeBrowserFuncs.h in Headers */,
</span><span class="cx">                                 1A6FBD2811E69BC200DB1371 /* NetscapePlugin.h in Headers */,
</span><ins>+                                A1C512C9190656E500448914 /* WebQuickLookHandleClient.h in Headers */,
</ins><span class="cx">                                 1A4A9C5612B816CF008FE984 /* NetscapePluginModule.h in Headers */,
</span><span class="cx">                                 1AA5889211EE70400061B882 /* NetscapePluginStream.h in Headers */,
</span><span class="cx">                                 E1798C7A16E6818800240139 /* NetworkBlobRegistry.h in Headers */,
</span><span class="lines">@@ -6826,6 +6845,7 @@
</span><span class="cx">                                 5106D7C418BDBE73000AB166 /* ContextMenuContextData.h in Headers */,
</span><span class="cx">                                 BC8ACA1516670D89004C1941 /* ObjCObjectGraphCoders.h in Headers */,
</span><span class="cx">                                 BCCF672D12C7EDF7008F9C35 /* OriginAndDatabases.h in Headers */,
</span><ins>+                                A118A9EF1907AD6F00F7C92B /* QuickLookDocumentData.h in Headers */,
</ins><span class="cx">                                 1A5B1C511898606F004FCF9B /* WKNavigation.h in Headers */,
</span><span class="cx">                                 7CF47FFB17275C57008ACB91 /* PageBanner.h in Headers */,
</span><span class="cx">                                 BC6EDAA6111271C600E7678B /* PageClient.h in Headers */,
</span><span class="lines">@@ -7258,6 +7278,7 @@
</span><span class="cx">                                 BCCF6AC312C91F34008F9C35 /* WKImage.h in Headers */,
</span><span class="cx">                                 BCCF6ACA12C91F59008F9C35 /* WKImageCG.h in Headers */,
</span><span class="cx">                                 1C8E293912761E5B00BC7BD0 /* WKInspector.h in Headers */,
</span><ins>+                                A118A9F31908B8EA00F7C92B /* _WKNSFileManagerExtras.h in Headers */,
</ins><span class="cx">                                 6EE849C81368D9390038D481 /* WKInspectorPrivateMac.h in Headers */,
</span><span class="cx">                                 51A9E10B1315CD18009E7031 /* WKKeyValueStorageManager.h in Headers */,
</span><span class="cx">                                 33D3A3B61339600B00709BE4 /* WKMediaCacheManager.h in Headers */,
</span><span class="lines">@@ -8323,6 +8344,7 @@
</span><span class="cx">                                 BC82844D16B5081C00A278FE /* PluginServiceEntryPoint.mm in Sources */,
</span><span class="cx">                                 1A6FB7AE11E64B6800DB1371 /* PluginView.cpp in Sources */,
</span><span class="cx">                                 E18C92F412DB9E7100CF2AEB /* PrintInfo.cpp in Sources */,
</span><ins>+                                A1C512C8190656E500448914 /* WebQuickLookHandleClient.cpp in Sources */,
</ins><span class="cx">                                 E1CC1B9112D7EADF00625838 /* PrintInfoMac.mm in Sources */,
</span><span class="cx">                                 1AC1336E18565D2B00F3EC05 /* APIPageHandle.cpp in Sources */,
</span><span class="cx">                                 1AE117F611DBB30900981615 /* ProcessLauncher.cpp in Sources */,
</span><span class="lines">@@ -8459,6 +8481,7 @@
</span><span class="cx">                                 BC032DBA10F4380F0058C15A /* WebEventConversion.cpp in Sources */,
</span><span class="cx">                                 2D140EAF18F37BE0005E75A0 /* PageOverlayController.cpp in Sources */,
</span><span class="cx">                                 BC111B5E112F629800337BAB /* WebEventFactory.mm in Sources */,
</span><ins>+                                A118A9EE1907AD6F00F7C92B /* QuickLookDocumentData.cpp in Sources */,
</ins><span class="cx">                                 1A3DD1FD125E59F3004515E6 /* WebFindClient.cpp in Sources */,
</span><span class="cx">                                 BCE469531214E6CB000B98EB /* WebFormClient.cpp in Sources */,
</span><span class="cx">                                 BCE469551214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp in Sources */,
</span><span class="lines">@@ -8616,6 +8639,7 @@
</span><span class="cx">                                 512E34E4130B4D0500ABD19A /* WKApplicationCacheManager.cpp in Sources */,
</span><span class="cx">                                 51C96118183D294700D2002E /* WebIDBServerConnectionMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 BC4075F3124FF0270068F20A /* WKArray.cpp in Sources */,
</span><ins>+                                A118A9F21908B8EA00F7C92B /* _WKNSFileManagerExtras.mm in Sources */,
</ins><span class="cx">                                 512F58F512A88A5400629530 /* WKAuthenticationChallenge.cpp in Sources */,
</span><span class="cx">                                 51E351CA180F2CCC00E53BE9 /* IDBUtilities.cpp in Sources */,
</span><span class="cx">                                 512F58F712A88A5400629530 /* WKAuthenticationDecisionListener.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -229,6 +229,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void forcePageTransitionIfNeeded() override;
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+    virtual void didCreateQuickLookHandle(WebCore::QuickLookHandle&amp;) override;
+#endif
+
</ins><span class="cx">     WebFrame* m_frame;
</span><span class="cx">     RefPtr&lt;PluginView&gt; m_pluginView;
</span><span class="cx">     bool m_hasSentResponseToPluginView;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportiosWebFrameLoaderClientIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm (167900 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm        2014-04-28 20:01:36 UTC (rev 167900)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -30,6 +30,13 @@
</span><span class="cx"> 
</span><span class="cx"> #import &lt;WebCore/NotImplemented.h&gt;
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+#import &quot;WebFrame.h&quot;
+#import &quot;WebPage.h&quot;
+#import &quot;WebQuickLookHandleClient.h&quot;
+#import &lt;WebCore/QuickLook.h&gt;
+#endif
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -50,6 +57,20 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+void WebFrameLoaderClient::didCreateQuickLookHandle(WebCore::QuickLookHandle&amp; handle)
+{
+    if (!m_frame-&gt;isMainFrame())
+        return;
+
+    WebPage* webPage = m_frame-&gt;page();
+    if (!webPage)
+        return;
+
+    handle.setClient(WebQuickLookHandleClient::create(handle, webPage-&gt;pageID()));
+}
+#endif
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportiosWebQuickLookHandleClientcppfromrev167900trunkSourceWebKit2UIProcessAPICocoaWKNavigationDelegatePrivateh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp (from rev 167900, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h) (0 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebQuickLookHandleClient.h&quot;
+
+#if USE(QUICK_LOOK)
+
+#include &quot;WebPageProxyMessages.h&quot;
+#include &quot;WebProcess.h&quot;
+#include &lt;WebCore/QuickLook.h&gt;
+
+namespace WebKit {
+
+WebQuickLookHandleClient::WebQuickLookHandleClient(const WebCore::QuickLookHandle&amp; handle, uint64_t pageID)
+    : m_fileName(handle.previewFileName())
+    , m_uti(handle.previewUTI())
+    , m_pageID(pageID)
+{
+    WebProcess::shared().send(Messages::WebPageProxy::DidStartLoadForQuickLookDocumentInMainFrame(m_fileName, m_uti), m_pageID);
+}
+
+void WebQuickLookHandleClient::didReceiveDataArray(CFArrayRef dataArray)
+{
+    CFArrayApplyFunction(dataArray, CFRangeMake(0, CFArrayGetCount(dataArray)), [](const void* value, void* context) {
+        ASSERT(CFGetTypeID(value) == CFDataGetTypeID());
+        static_cast&lt;QuickLookDocumentData*&gt;(context)-&gt;append((CFDataRef)value);
+    }, this);
+}
+
+void WebQuickLookHandleClient::didFinishLoading()
+{
+    WebProcess::shared().send(Messages::WebPageProxy::DidFinishLoadForQuickLookDocumentInMainFrame(m_data), m_pageID);
+    m_data.clear();
+}
+
+void WebQuickLookHandleClient::didFail()
+{
+    m_data.clear();
+}
+
+} // namespace WebKit
+
+#endif // USE(QUICK_LOOK)
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportiosWebQuickLookHandleClienthfromrev167900trunkSourceWebKit2UIProcessAPICocoaWKNavigationDelegatePrivateh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h (from rev 167900, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h) (0 => 167901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h        2014-04-28 20:02:41 UTC (rev 167901)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebQuickLookHandleClient_h
+#define WebQuickLookHandleClient_h
+
+#if USE(QUICK_LOOK)
+
+#include &quot;QuickLookDocumentData.h&quot;
+#include &lt;WebCore/QuickLookHandleClient.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+class QuickLookHandle;
+}
+
+namespace WebKit {
+
+class WebFrame;
+
+class WebQuickLookHandleClient final : public WebCore::QuickLookHandleClient {
+public:
+    static PassRefPtr&lt;WebQuickLookHandleClient&gt; create(const WebCore::QuickLookHandle&amp; handle, uint64_t pageID)
+    {
+        return adoptRef(new WebQuickLookHandleClient(handle, pageID));
+    }
+
+private:
+    WebQuickLookHandleClient(const WebCore::QuickLookHandle&amp;, uint64_t pageID);
+    virtual void didReceiveDataArray(CFArrayRef) override;
+    virtual void didFinishLoading() override;
+    virtual void didFail() override;
+
+    const String m_fileName;
+    const String m_uti;
+    const uint64_t m_pageID;
+    QuickLookDocumentData m_data;
+};
+
+} // namespace WebKit
+
+#endif // USE(QUICK_LOOK)
+
+#endif // WebQuickLookHandleClient_h
</ins></span></pre>
</div>
</div>

</body>
</html>