<!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>[208865] trunk</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/208865">208865</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-11-17 16:22:44 -0800 (Thu, 17 Nov 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add _WKIconLoadingDelegate SPI.
https://bugs.webkit.org/show_bug.cgi?id=164894
Reviewed by Alex Christensen.
Source/WebCore:
No new tests (Manual testing possible in MiniBrowser now, WKTR tests coming soon in https://bugs.webkit.org/show_bug.cgi?id=164895).
With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
For icons the app decides to load, WebKit will pass the data to the app without storing locally.
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::implicitClose):
* html/LinkIconCollector.cpp:
(WebCore::iconSize):
(WebCore::compareIcons):
* html/LinkIconCollector.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startIconLoading):
(WebCore::DocumentLoader::didGetLoadDecisionForIcon):
(WebCore::DocumentLoader::finishedLoadingIcon):
* loader/DocumentLoader.h:
* loader/FrameLoaderClient.h:
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::IconLoader):
(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::notifyFinished):
* loader/icon/IconLoader.h:
* platform/LinkIcon.h: Copied from Source/WebCore/html/LinkIconCollector.h.
(WebCore::LinkIcon::encode):
(WebCore::LinkIcon::decode):
Source/WebKit2:
With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
For icons the app decides to load, WebKit will pass the data to the app without storing locally.
* UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
(API::IconLoadingClient::~IconLoadingClient):
(API::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _iconLoadingDelegate]):
(-[WKWebView _setIconLoadingDelegate:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
(-[_WKLinkIconParameters _initWithLinkIcon:]):
(-[_WKLinkIconParameters url]):
(-[_WKLinkIconParameters mimeType]):
(-[_WKLinkIconParameters size]):
(-[_WKLinkIconParameters iconType]):
* UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
(WebKit::IconLoadingDelegate::IconLoadingDelegate):
(WebKit::IconLoadingDelegate::~IconLoadingDelegate):
(WebKit::IconLoadingDelegate::createIconLoadingClient):
(WebKit::IconLoadingDelegate::delegate):
(WebKit::IconLoadingDelegate::setDelegate):
(WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
(WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
(WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setIconLoadingClient):
(WebKit::WebPageProxy::getLoadDecisionForIcon):
(WebKit::WebPageProxy::finishedLoadingIcon):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::iconLoadingClient):
* UIProcess/WebPageProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::useIconLoadingClient):
(WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
(WebKit::WebFrameLoaderClient::finishedLoadingIcon):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
(WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didGetLoadDecisionForIcon):
(WebKit::WebPage::setUseIconLoadingClient):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Tools:
Add MiniBrowser support for this new SPI, configurable with a setting.
* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController loadsAllSiteIcons]):
(-[SettingsController toggleLoadsAllSiteIcons:]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
(-[WK2BrowserWindowController webView:shouldLoadIconWithParameters:completionHandler:]):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlLinkIconCollectorcpp">trunk/Source/WebCore/html/LinkIconCollector.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlLinkIconCollectorh">trunk/Source/WebCore/html/LinkIconCollector.h</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoaderh">trunk/Source/WebCore/loader/DocumentLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderClienth">trunk/Source/WebCore/loader/FrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebCoreloadericonIconLoadercpp">trunk/Source/WebCore/loader/icon/IconLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadericonIconLoaderh">trunk/Source/WebCore/loader/icon/IconLoader.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</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="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagemessagesin">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsMiniBrowsermacSettingsControllerh">trunk/Tools/MiniBrowser/mac/SettingsController.h</a></li>
<li><a href="#trunkToolsMiniBrowsermacSettingsControllerm">trunk/Tools/MiniBrowser/mac/SettingsController.m</a></li>
<li><a href="#trunkToolsMiniBrowsermacWK2BrowserWindowControllerm">trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformLinkIconh">trunk/Source/WebCore/platform/LinkIcon.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIIconLoadingClienth">trunk/Source/WebKit2/UIProcess/API/APIIconLoadingClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKIconLoadingDelegateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKIconLoadingDelegate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKLinkIconParametersh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKLinkIconParameters.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKLinkIconParametersmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKLinkIconParameters.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKLinkIconParametersInternalh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaIconLoadingDelegateh">trunk/Source/WebKit2/UIProcess/Cocoa/IconLoadingDelegate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaIconLoadingDelegatemm">trunk/Source/WebKit2/UIProcess/Cocoa/IconLoadingDelegate.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebCore/ChangeLog        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2016-11-17 Brady Eidson <beidson@apple.com>
+
+ Add _WKIconLoadingDelegate SPI.
+ https://bugs.webkit.org/show_bug.cgi?id=164894
+
+ Reviewed by Alex Christensen.
+
+ No new tests (Manual testing possible in MiniBrowser now, WKTR tests coming soon in https://bugs.webkit.org/show_bug.cgi?id=164895).
+
+ With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
+
+ WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
+
+ For icons the app decides to load, WebKit will pass the data to the app without storing locally.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+ * dom/Document.cpp:
+ (WebCore::Document::implicitClose):
+
+ * html/LinkIconCollector.cpp:
+ (WebCore::iconSize):
+ (WebCore::compareIcons):
+ * html/LinkIconCollector.h:
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::startIconLoading):
+ (WebCore::DocumentLoader::didGetLoadDecisionForIcon):
+ (WebCore::DocumentLoader::finishedLoadingIcon):
+ * loader/DocumentLoader.h:
+
+ * loader/FrameLoaderClient.h:
+
+ * loader/icon/IconLoader.cpp:
+ (WebCore::IconLoader::IconLoader):
+ (WebCore::IconLoader::startLoading):
+ (WebCore::IconLoader::notifyFinished):
+ * loader/icon/IconLoader.h:
+
+ * platform/LinkIcon.h: Copied from Source/WebCore/html/LinkIconCollector.h.
+ (WebCore::LinkIcon::encode):
+ (WebCore::LinkIcon::decode):
+
</ins><span class="cx"> 2016-11-15 Sam Weinig <sam@webkit.org>
</span><span class="cx">
</span><span class="cx"> [SVG] Moving more special casing of SVG out of the bindings - SVG lists
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -2065,6 +2065,7 @@
</span><span class="cx">                 514129981C6976900059E714 /* IDBRequestCompletionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514129961C6976150059E714 /* IDBRequestCompletionEvent.cpp */; };
</span><span class="cx">                 514129991C6976900059E714 /* IDBRequestCompletionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 514129971C6976150059E714 /* IDBRequestCompletionEvent.h */; };
</span><span class="cx">                 5141299B1C6C16740059E714 /* JSIDBIndexCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5141299A1C6C166D0059E714 /* JSIDBIndexCustom.cpp */; };
</span><ins>+                5143B2631DDD15200014FAC6 /* LinkIcon.h in Headers */ = {isa = PBXBuildFile; fileRef = 5143B2621DDD14900014FAC6 /* LinkIcon.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 5145B1091BC48E2E00E86219 /* IDBResourceIdentifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5145B1071BC4890B00E86219 /* IDBResourceIdentifier.cpp */; };
</span><span class="cx">                 5145B10A1BC48E2E00E86219 /* IDBResourceIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 5145B1081BC4890B00E86219 /* IDBResourceIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 5148453E1BB9D07E006A72ED /* IDBError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5148453C1BB9D076006A72ED /* IDBError.cpp */; };
</span><span class="lines">@@ -9268,6 +9269,7 @@
</span><span class="cx">                 514129961C6976150059E714 /* IDBRequestCompletionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBRequestCompletionEvent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 514129971C6976150059E714 /* IDBRequestCompletionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBRequestCompletionEvent.h; sourceTree = "<group>"; };
</span><span class="cx">                 5141299A1C6C166D0059E714 /* JSIDBIndexCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBIndexCustom.cpp; sourceTree = "<group>"; };
</span><ins>+                5143B2621DDD14900014FAC6 /* LinkIcon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkIcon.h; sourceTree = "<group>"; };
</ins><span class="cx">                 5145B1071BC4890B00E86219 /* IDBResourceIdentifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBResourceIdentifier.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 5145B1081BC4890B00E86219 /* IDBResourceIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBResourceIdentifier.h; sourceTree = "<group>"; };
</span><span class="cx">                 5148453C1BB9D076006A72ED /* IDBError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBError.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -22439,6 +22441,7 @@
</span><span class="cx">                                 BCFF64900EAD15C200C1D6F7 /* LengthSize.h */,
</span><span class="cx">                                 A7AD2F850EC89D07008AB002 /* LinkHash.cpp */,
</span><span class="cx">                                 A7AD2F860EC89D07008AB002 /* LinkHash.h */,
</span><ins>+                                5143B2621DDD14900014FAC6 /* LinkIcon.h */,
</ins><span class="cx">                                 C046E1AB1208A9FE00BA2CF7 /* LocalizedStrings.cpp */,
</span><span class="cx">                                 935207BD09BD410A00F2038D /* LocalizedStrings.h */,
</span><span class="cx">                                 A8239DFE09B3CF8A00B60641 /* Logging.cpp */,
</span><span class="lines">@@ -27645,6 +27648,7 @@
</span><span class="cx">                                 B22279F40D00BF220071B782 /* SVGFEMergeElement.h in Headers */,
</span><span class="cx">                                 B22279F70D00BF220071B782 /* SVGFEMergeNodeElement.h in Headers */,
</span><span class="cx">                                 84224194107E78A700766A87 /* SVGFEMorphologyElement.h in Headers */,
</span><ins>+                                5143B2631DDD15200014FAC6 /* LinkIcon.h in Headers */,
</ins><span class="cx">                                 B22279FA0D00BF220071B782 /* SVGFEOffsetElement.h in Headers */,
</span><span class="cx">                                 B22279FD0D00BF220071B782 /* SVGFEPointLightElement.h in Headers */,
</span><span class="cx">                                 B2227A000D00BF220071B782 /* SVGFESpecularLightingElement.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -2654,7 +2654,12 @@
</span><span class="cx"> // ramifications, and we need to decide what is the Right Thing To Do(tm)
</span><span class="cx"> Frame* f = frame();
</span><span class="cx"> if (f) {
</span><del>- f->loader().icon().startLoader();
</del><ins>+ if (f->loader().client().useIconLoadingClient()) {
+ if (auto* documentLoader = loader())
+ documentLoader->startIconLoading();
+ } else
+ f->loader().icon().startLoader();
+
</ins><span class="cx"> f->animation().startAnimationsIfNotSuspended(this);
</span><span class="cx">
</span><span class="cx"> // FIXME: We shouldn't be dispatching pending events globally on all Documents here.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlLinkIconCollectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/LinkIconCollector.cpp (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/LinkIconCollector.cpp        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebCore/html/LinkIconCollector.cpp        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">
</span><span class="cx"> const unsigned defaultTouchIconWidth = 60;
</span><span class="cx">
</span><del>-static unsigned iconSize(const LinkIconCollector::Icon& icon)
</del><ins>+static unsigned iconSize(const LinkIcon& icon)
</ins><span class="cx"> {
</span><span class="cx"> if (icon.size)
</span><span class="cx"> return *icon.size;
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static int compareIcons(const LinkIconCollector::Icon& a, const LinkIconCollector::Icon& b)
</del><ins>+static int compareIcons(const LinkIcon& a, const LinkIcon& b)
</ins><span class="cx"> {
</span><span class="cx"> // Apple Touch icons always come first.
</span><span class="cx"> if (a.type == LinkIconType::Favicon && b.type != LinkIconType::Favicon)
</span><span class="lines">@@ -72,13 +72,13 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-auto LinkIconCollector::iconsOfTypes(OptionSet<LinkIconType> iconTypes) -> Vector<Icon>
</del><ins>+auto LinkIconCollector::iconsOfTypes(OptionSet<LinkIconType> iconTypes) -> Vector<LinkIcon>
</ins><span class="cx"> {
</span><span class="cx"> auto* head = m_document.head();
</span><span class="cx"> if (!head)
</span><span class="cx"> return { };
</span><span class="cx">
</span><del>- Vector<Icon> icons;
</del><ins>+ Vector<LinkIcon> icons;
</ins><span class="cx">
</span><span class="cx"> for (auto& linkElement : childrenOfType<HTMLLinkElement>(*head)) {
</span><span class="cx"> if (!linkElement.iconType())
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx"> iconSize = size;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- icons.append({ url, iconType, iconSize });
</del><ins>+ icons.append({ url, iconType, linkElement.type(), iconSize });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> std::sort(icons.begin(), icons.end(), [](auto& a, auto& b) {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlLinkIconCollectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/LinkIconCollector.h (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/LinkIconCollector.h        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebCore/html/LinkIconCollector.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -25,9 +25,8 @@
</span><span class="cx">
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><del>-#include "URL.h"
</del><ins>+#include "LinkIcon.h"
</ins><span class="cx"> #include <wtf/OptionSet.h>
</span><del>-#include <wtf/Optional.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -41,15 +40,8 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- struct Icon {
- URL url;
</del><ins>+ WEBCORE_EXPORT Vector<LinkIcon> iconsOfTypes(OptionSet<LinkIconType>);
</ins><span class="cx">
</span><del>- LinkIconType type;
- Optional<unsigned> size;
- };
-
- WEBCORE_EXPORT Vector<Icon> iconsOfTypes(OptionSet<LinkIconType>);
-
</del><span class="cx"> private:
</span><span class="cx"> Document& m_document;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "DocumentParser.h"
</span><span class="cx"> #include "DocumentWriter.h"
</span><ins>+#include "ElementChildIterator.h"
</ins><span class="cx"> #include "Event.h"
</span><span class="cx"> #include "EventNames.h"
</span><span class="cx"> #include "ExtensionStyleSheets.h"
</span><span class="lines">@@ -53,7 +54,10 @@
</span><span class="cx"> #include "HTTPHeaderNames.h"
</span><span class="cx"> #include "HistoryItem.h"
</span><span class="cx"> #include "IconController.h"
</span><ins>+#include "IconLoader.h"
</ins><span class="cx"> #include "InspectorInstrumentation.h"
</span><ins>+#include "LinkIconCollector.h"
+#include "LinkIconType.h"
</ins><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "MainFrame.h"
</span><span class="cx"> #include "MemoryCache.h"
</span><span class="lines">@@ -1698,6 +1702,46 @@
</span><span class="cx"> iconDatabase().iconDataForIconURL(urlString, m_iconDataCallback);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void DocumentLoader::startIconLoading()
+{
+ ASSERT(m_frame->loader().client().useIconLoadingClient());
+
+ static uint64_t nextIconCallbackID = 1;
+
+ auto* document = this->document();
+ if (!document)
+ return;
+
+ Vector<LinkIcon> icons = LinkIconCollector { *document }.iconsOfTypes({ LinkIconType::Favicon, LinkIconType::TouchIcon, LinkIconType::TouchPrecomposedIcon });
+
+ if (icons.isEmpty())
+ icons.append({ m_frame->document()->completeURL(ASCIILiteral("/favicon.ico")), LinkIconType::Favicon, String(), Nullopt });
+
+ for (auto& icon : icons) {
+ auto result = m_iconsPendingLoadDecision.add(nextIconCallbackID++, icon);
+ m_frame->loader().client().getLoadDecisionForIcon(icon, result.iterator->key);
+ }
+}
+
+void DocumentLoader::didGetLoadDecisionForIcon(bool decision, uint64_t loadIdentifier, uint64_t newCallbackID)
+{
+ auto icon = m_iconsPendingLoadDecision.take(loadIdentifier);
+ if (!decision || icon.url.isEmpty() || !m_frame)
+ return;
+
+ auto iconLoader = std::make_unique<IconLoader>(*this, icon.url);
+ iconLoader->startLoading();
+ m_iconLoaders.set(WTFMove(iconLoader), newCallbackID);
+}
+
+void DocumentLoader::finishedLoadingIcon(IconLoader& loader, SharedBuffer* buffer)
+{
+ auto loadIdentifier = m_iconLoaders.take(&loader);
+ ASSERT(loadIdentifier);
+
+ m_frame->loader().client().finishedLoadingIcon(loadIdentifier, buffer);
+}
+
</ins><span class="cx"> void DocumentLoader::dispatchOnloadEvents()
</span><span class="cx"> {
</span><span class="cx"> m_wasOnloadDispatched = true;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.h (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.h        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebCore/loader/DocumentLoader.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include "CachedResourceHandle.h"
</span><span class="cx"> #include "DocumentWriter.h"
</span><span class="cx"> #include "IconDatabaseBase.h"
</span><ins>+#include "LinkIcon.h"
</ins><span class="cx"> #include "LoadTiming.h"
</span><span class="cx"> #include "NavigationAction.h"
</span><span class="cx"> #include "ResourceError.h"
</span><span class="lines">@@ -71,6 +72,7 @@
</span><span class="cx"> class FormState;
</span><span class="cx"> class Frame;
</span><span class="cx"> class FrameLoader;
</span><ins>+class IconLoader;
</ins><span class="cx"> class Page;
</span><span class="cx"> class ResourceLoader;
</span><span class="cx"> class SharedBuffer;
</span><span class="lines">@@ -289,6 +291,10 @@
</span><span class="cx">
</span><span class="cx"> bool isAlwaysOnLoggingAllowed() const;
</span><span class="cx">
</span><ins>+ void startIconLoading();
+ WEBCORE_EXPORT void didGetLoadDecisionForIcon(bool decision, uint64_t loadIdentifier, uint64_t newCallbackID);
+ void finishedLoadingIcon(IconLoader&, SharedBuffer*);
+
</ins><span class="cx"> protected:
</span><span class="cx"> WEBCORE_EXPORT DocumentLoader(const ResourceRequest&, const SubstituteData&);
</span><span class="cx">
</span><span class="lines">@@ -441,9 +447,14 @@
</span><span class="cx"> bool m_waitingForContentPolicy { false };
</span><span class="cx"> bool m_waitingForNavigationPolicy { false };
</span><span class="cx">
</span><ins>+ // For IconDatabase-style loads
</ins><span class="cx"> RefPtr<IconLoadDecisionCallback> m_iconLoadDecisionCallback;
</span><span class="cx"> RefPtr<IconDataCallback> m_iconDataCallback;
</span><span class="cx">
</span><ins>+ // For IconLoadingClient-style loads
+ HashMap<uint64_t, LinkIcon> m_iconsPendingLoadDecision;
+ HashMap<std::unique_ptr<IconLoader>, uint64_t> m_iconLoaders;
+
</ins><span class="cx"> bool m_subresourceLoadersArePageCacheAcceptable;
</span><span class="cx"> ShouldOpenExternalURLsPolicy m_shouldOpenExternalURLsPolicy { ShouldOpenExternalURLsPolicy::ShouldNotAllow };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoaderClient.h        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx">
</span><span class="cx"> #include "FrameLoaderTypes.h"
</span><span class="cx"> #include "LayoutMilestones.h"
</span><ins>+#include "LinkIcon.h"
</ins><span class="cx"> #include "ResourceLoadPriority.h"
</span><span class="cx"> #include <functional>
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="lines">@@ -354,6 +355,10 @@
</span><span class="cx"> virtual void prefetchDNS(const String&) = 0;
</span><span class="cx">
</span><span class="cx"> virtual void didRestoreScrollPosition() { }
</span><ins>+
+ virtual bool useIconLoadingClient() { return false; }
+ virtual void getLoadDecisionForIcon(const LinkIcon&, uint64_t) { }
+ virtual void finishedLoadingIcon(uint64_t, SharedBuffer*) { }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreloadericonIconLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/icon/IconLoader.cpp (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/icon/IconLoader.cpp        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebCore/loader/icon/IconLoader.cpp        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -44,10 +44,17 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> IconLoader::IconLoader(Frame& frame)
</span><del>- : m_frame(frame)
</del><ins>+ : m_frame(&frame)
+ , m_url(frame.loader().icon().url())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+IconLoader::IconLoader(DocumentLoader& documentLoader, const URL& url)
+ : m_documentLoader(&documentLoader)
+ , m_url(url)
+{
+}
+
</ins><span class="cx"> IconLoader::~IconLoader()
</span><span class="cx"> {
</span><span class="cx"> stopLoading();
</span><span class="lines">@@ -55,10 +62,18 @@
</span><span class="cx">
</span><span class="cx"> void IconLoader::startLoading()
</span><span class="cx"> {
</span><del>- if (m_resource || !m_frame.document())
</del><ins>+ ASSERT(m_frame || m_documentLoader);
+
+ if (m_resource)
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- ResourceRequest resourceRequest(m_frame.loader().icon().url());
</del><ins>+ if (m_frame && !m_frame->document())
+ return;
+
+ if (m_documentLoader && !m_documentLoader->frame())
+ return;
+
+ ResourceRequest resourceRequest(m_url);
</ins><span class="cx"> resourceRequest.setPriority(ResourceLoadPriority::Low);
</span><span class="cx">
</span><span class="cx"> // ContentSecurityPolicyImposition::DoPolicyCheck is a placeholder value. It does not affect the request since Content Security Policy does not apply to raw resources.
</span><span class="lines">@@ -66,11 +81,12 @@
</span><span class="cx">
</span><span class="cx"> request.setInitiator(cachedResourceRequestInitiators().icon);
</span><span class="cx">
</span><del>- m_resource = m_frame.document()->cachedResourceLoader().requestRawResource(WTFMove(request));
</del><ins>+ auto* frame = m_frame ? m_frame : m_documentLoader->frame();
+ m_resource = frame->document()->cachedResourceLoader().requestRawResource(WTFMove(request));
</ins><span class="cx"> if (m_resource)
</span><span class="cx"> m_resource->addClient(*this);
</span><span class="cx"> else
</span><del>- LOG_ERROR("Failed to start load for icon at url %s", m_frame.loader().icon().url().string().ascii().data());
</del><ins>+ LOG_ERROR("Failed to start load for icon at url %s", frame->loader().icon().url().string().ascii().data());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IconLoader::stopLoading()
</span><span class="lines">@@ -100,12 +116,19 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LOG(IconDatabase, "IconLoader::finishLoading() - Committing iconURL %s to database", m_resource->url().string().ascii().data());
</span><del>- m_frame.loader().icon().commitToDatabase(m_resource->url());
- // Setting the icon data only after committing to the database ensures that the data is
- // kept in memory (so it does not have to be read from the database asynchronously), since
- // there is a page URL referencing it.
- iconDatabase().setIconDataForIconURL(data, m_resource->url().string());
- m_frame.loader().client().dispatchDidReceiveIcon();
</del><ins>+
+ if (m_frame) {
+ m_frame->loader().icon().commitToDatabase(m_resource->url());
+
+ // Setting the icon data only after committing to the database ensures that the data is
+ // kept in memory (so it does not have to be read from the database asynchronously), since
+ // there is a page URL referencing it.
+ iconDatabase().setIconDataForIconURL(data, m_resource->url().string());
+ m_frame->loader().client().dispatchDidReceiveIcon();
+
+ } else
+ m_documentLoader->finishedLoadingIcon(*this, data);
+
</ins><span class="cx"> stopLoading();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloadericonIconLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/icon/IconLoader.h (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/icon/IconLoader.h        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebCore/loader/icon/IconLoader.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx">
</span><span class="cx"> #include "CachedRawResourceClient.h"
</span><span class="cx"> #include "CachedResourceHandle.h"
</span><ins>+#include "URL.h"
</ins><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/Noncopyable.h>
</span><span class="cx">
</span><span class="lines">@@ -33,6 +34,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class CachedRawResource;
</span><ins>+class DocumentLoader;
</ins><span class="cx"> class Frame;
</span><span class="cx">
</span><span class="cx"> class IconLoader final : private CachedRawResourceClient {
</span><span class="lines">@@ -39,6 +41,7 @@
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(IconLoader); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx"> explicit IconLoader(Frame&);
</span><ins>+ IconLoader(DocumentLoader&, const URL&);
</ins><span class="cx"> virtual ~IconLoader();
</span><span class="cx">
</span><span class="cx"> void startLoading();
</span><span class="lines">@@ -47,7 +50,9 @@
</span><span class="cx"> private:
</span><span class="cx"> void notifyFinished(CachedResource&) final;
</span><span class="cx">
</span><del>- Frame& m_frame;
</del><ins>+ Frame* m_frame { nullptr };
+ DocumentLoader* m_documentLoader { nullptr };
+ URL m_url;
</ins><span class="cx"> CachedResourceHandle<CachedRawResource> m_resource;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformLinkIconhfromrev208864trunkSourceWebCorehtmlLinkIconCollectorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/LinkIcon.h (from rev 208864, trunk/Source/WebCore/html/LinkIconCollector.h) (0 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/LinkIcon.h         (rev 0)
+++ trunk/Source/WebCore/platform/LinkIcon.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#include "LinkIconType.h"
+#include "URL.h"
+#include <wtf/Optional.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+struct LinkIcon {
+ URL url;
+ LinkIconType type;
+ String mimeType;
+ Optional<unsigned> size;
+
+ template<class Encoder> void encode(Encoder&) const;
+ template<class Decoder> static bool decode(Decoder&, LinkIcon&);
+};
+
+template<class Encoder>
+void LinkIcon::encode(Encoder& encoder) const
+{
+ encoder << url << mimeType << size;
+ encoder.encodeEnum(type);
+}
+
+template<class Decoder>
+bool LinkIcon::decode(Decoder& decoder, LinkIcon& result)
+{
+ if (!decoder.decode(result.url))
+ return false;
+
+ if (!decoder.decode(result.mimeType))
+ return false;
+
+ if (!decoder.decode(result.size))
+ return false;
+
+ if (!decoder.decodeEnum(result.type))
+ return false;
+
+ return true;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebKit2/ChangeLog        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -1,3 +1,71 @@
</span><ins>+2016-11-17 Brady Eidson <beidson@apple.com>
+
+ Add _WKIconLoadingDelegate SPI.
+ https://bugs.webkit.org/show_bug.cgi?id=164894
+
+ Reviewed by Alex Christensen.
+
+ With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
+
+ WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
+
+ For icons the app decides to load, WebKit will pass the data to the app without storing locally.
+
+ * UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
+ (API::IconLoadingClient::~IconLoadingClient):
+ (API::IconLoadingClient::getLoadDecisionForIcon):
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _initializeWithConfiguration:]):
+ (-[WKWebView _iconLoadingDelegate]):
+ (-[WKWebView _setIconLoadingDelegate:]):
+ * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+
+ * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
+
+ * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
+ * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
+ (-[_WKLinkIconParameters _initWithLinkIcon:]):
+ (-[_WKLinkIconParameters url]):
+ (-[_WKLinkIconParameters mimeType]):
+ (-[_WKLinkIconParameters size]):
+ (-[_WKLinkIconParameters iconType]):
+ * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
+
+ * UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
+ * UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
+ (WebKit::IconLoadingDelegate::IconLoadingDelegate):
+ (WebKit::IconLoadingDelegate::~IconLoadingDelegate):
+ (WebKit::IconLoadingDelegate::createIconLoadingClient):
+ (WebKit::IconLoadingDelegate::delegate):
+ (WebKit::IconLoadingDelegate::setDelegate):
+ (WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
+ (WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
+ (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setIconLoadingClient):
+ (WebKit::WebPageProxy::getLoadDecisionForIcon):
+ (WebKit::WebPageProxy::finishedLoadingIcon):
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::iconLoadingClient):
+ * UIProcess/WebPageProxy.messages.in:
+
+ * WebKit2.xcodeproj/project.pbxproj:
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::useIconLoadingClient):
+ (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
+ (WebKit::WebFrameLoaderClient::finishedLoadingIcon):
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+ (WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::didGetLoadDecisionForIcon):
+ (WebKit::WebPage::setUseIconLoadingClient):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
</ins><span class="cx"> 2016-11-17 Saam Barati <sbarati@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove async/await compile time flag and enable tests
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIIconLoadingClienthfromrev208864trunkSourceWebCorehtmlLinkIconCollectorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/APIIconLoadingClient.h (from rev 208864, trunk/Source/WebCore/html/LinkIconCollector.h) (0 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIIconLoadingClient.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APIIconLoadingClient.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#include "GenericCallback.h"
+#include <WebCore/LinkIcon.h>
+#include <wtf/Function.h>
+
+namespace IPC {
+class DataReference;
+}
+
+namespace API {
+
+class IconLoadingClient {
+public:
+ virtual ~IconLoadingClient() { }
+
+ virtual void getLoadDecisionForIcon(const WebCore::LinkIcon&, Function<void (std::function<void (API::Data*, WebKit::CallbackBase::Error)>)>&& completionHandler) {
+ completionHandler(nullptr);
+ }
+};
+
+} // namespace API
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #import "DiagnosticLoggingClient.h"
</span><span class="cx"> #import "FindClient.h"
</span><span class="cx"> #import "FullscreenClient.h"
</span><ins>+#import "IconLoadingDelegate.h"
</ins><span class="cx"> #import "LegacySessionStateCoding.h"
</span><span class="cx"> #import "Logging.h"
</span><span class="cx"> #import "NavigationState.h"
</span><span class="lines">@@ -195,6 +196,7 @@
</span><span class="cx"> @implementation WKWebView {
</span><span class="cx"> std::unique_ptr<WebKit::NavigationState> _navigationState;
</span><span class="cx"> std::unique_ptr<WebKit::UIDelegate> _uiDelegate;
</span><ins>+ std::unique_ptr<WebKit::IconLoadingDelegate> _iconLoadingDelegate;
</ins><span class="cx">
</span><span class="cx"> _WKRenderingProgressEvents _observedRenderingProgressEvents;
</span><span class="cx">
</span><span class="lines">@@ -562,6 +564,8 @@
</span><span class="cx"> _page->setFindClient(std::make_unique<WebKit::FindClient>(self));
</span><span class="cx"> _page->setDiagnosticLoggingClient(std::make_unique<WebKit::DiagnosticLoggingClient>(self));
</span><span class="cx">
</span><ins>+ _iconLoadingDelegate = std::make_unique<WebKit::IconLoadingDelegate>(self);
+
</ins><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx"> _page->setFullscreenClient(std::make_unique<WebKit::FullscreenClient>(self));
</span><span class="cx"> #endif
</span><span class="lines">@@ -676,6 +680,17 @@
</span><span class="cx"> _uiDelegate->setDelegate(UIDelegate);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (id <_WKIconLoadingDelegate>)_iconLoadingDelegate
+{
+ return _iconLoadingDelegate->delegate().autorelease();
+}
+
+- (void)_setIconLoadingDelegate:(id<_WKIconLoadingDelegate>)iconLoadingDelegate
+{
+ _page->setIconLoadingClient(_iconLoadingDelegate->createIconLoadingClient());
+ _iconLoadingDelegate->setDelegate(iconLoadingDelegate);
+}
+
</ins><span class="cx"> - (WKNavigation *)loadRequest:(NSURLRequest *)request
</span><span class="cx"> {
</span><span class="cx"> auto navigation = _page->loadRequest(request);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx"> @class WKBrowsingContextHandle;
</span><span class="cx"> @class _WKFrameHandle;
</span><span class="cx"> @class _WKHitTestResult;
</span><ins>+@class _WKIconLoadingDelegate;
</ins><span class="cx"> @class _WKRemoteObjectRegistry;
</span><span class="cx"> @class _WKSessionState;
</span><span class="cx"> @class _WKWebViewPrintFormatter;
</span><span class="lines">@@ -63,6 +64,7 @@
</span><span class="cx"> @protocol WKHistoryDelegatePrivate;
</span><span class="cx"> @protocol _WKDiagnosticLoggingDelegate;
</span><span class="cx"> @protocol _WKFindDelegate;
</span><ins>+@protocol _WKIconLoadingDelegate;
</ins><span class="cx"> @protocol _WKInputDelegate;
</span><span class="cx"> @protocol _WKFullscreenDelegate;
</span><span class="cx">
</span><span class="lines">@@ -75,6 +77,7 @@
</span><span class="cx"> @property (nonatomic, setter=_setObservedRenderingProgressEvents:) _WKRenderingProgressEvents _observedRenderingProgressEvents;
</span><span class="cx">
</span><span class="cx"> @property (nonatomic, weak, setter=_setHistoryDelegate:) id <WKHistoryDelegatePrivate> _historyDelegate;
</span><ins>+@property (nonatomic, weak, setter=_setIconLoadingDelegate:) id <_WKIconLoadingDelegate> _iconLoadingDelegate;
</ins><span class="cx">
</span><span class="cx"> @property (nonatomic, readonly) NSURL *_unreachableURL;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKIconLoadingDelegatehfromrev208864trunkSourceWebCorehtmlLinkIconCollectorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKIconLoadingDelegate.h (from rev 208864, trunk/Source/WebCore/html/LinkIconCollector.h) (0 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKIconLoadingDelegate.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKIconLoadingDelegate.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+/*
+ * Copyright (C) 2016 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 <WebKit/WKFoundation.h>
+
+#if WK_API_ENABLED
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class _WKLinkIconParameters;
+
+@protocol _WKIconLoadingDelegate <NSObject>
+@optional
+
+- (void)webView:(WKWebView *)webView shouldLoadIconWithParameters:(_WKLinkIconParameters *)parameters completionHandler:(void (^)(void (^)(NSData*)))completionHandler;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKLinkIconParametershfromrev208864trunkSourceWebCorehtmlLinkIconCollectorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKLinkIconParameters.h (from rev 208864, trunk/Source/WebCore/html/LinkIconCollector.h) (0 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKLinkIconParameters.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKLinkIconParameters.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+/*
+ * Copyright (C) 2016 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 <WebKit/WKFoundation.h>
+
+#if WK_API_ENABLED
+
+#import <Foundation/Foundation.h>
+
+typedef NS_ENUM(NSInteger, WKLinkIconType) {
+ WKLinkIconTypeFavicon,
+ WKLinkIconTypeTouchIcon,
+ WKLinkIconTypeTouchPrecomposedIcon,
+};
+
+@interface _WKLinkIconParameters : NSObject
+
+@property (nonatomic, readonly, copy) NSURL *url;
+@property (nonatomic, readonly) WKLinkIconType iconType;
+@property (nonatomic, readonly, copy) NSString *mimeType;
+@property (nonatomic, readonly, copy) NSNumber *size;
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKLinkIconParametersmmfromrev208864trunkSourceWebCorehtmlLinkIconCollectorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKLinkIconParameters.mm (from rev 208864, trunk/Source/WebCore/html/LinkIconCollector.h) (0 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKLinkIconParameters.mm         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKLinkIconParameters.mm        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+/*
+ * Copyright (C) 2016 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 "config.h"
+#import "_WKLinkIconParametersInternal.h"
+
+#if WK_API_ENABLED
+
+#import <WebCore/LinkIcon.h>
+
+@implementation _WKLinkIconParameters {
+ RetainPtr<NSURL> _url;
+ WKLinkIconType _iconType;
+ RetainPtr<NSString> _mimeType;
+ RetainPtr<NSNumber> _size;
+}
+
+- (instancetype)_initWithLinkIcon:(const WebCore::LinkIcon&)linkIcon
+{
+ if (!(self = [super init]))
+ return nil;
+
+ _url = adoptNS([(NSURL *)linkIcon.url copy]);
+ _mimeType = adoptNS([(NSString *)linkIcon.mimeType copy]);
+
+ if (linkIcon.size)
+ _size = adoptNS([[NSNumber alloc] initWithUnsignedInt:linkIcon.size.value()]);
+
+ switch (linkIcon.type) {
+ case WebCore::LinkIconType::Favicon:
+ _iconType = WKLinkIconTypeFavicon;
+ break;
+ case WebCore::LinkIconType::TouchIcon:
+ _iconType = WKLinkIconTypeTouchIcon;
+ break;
+ case WebCore::LinkIconType::TouchPrecomposedIcon:
+ _iconType = WKLinkIconTypeTouchPrecomposedIcon;
+ break;
+ }
+
+ return self;
+}
+
+- (NSURL *)url
+{
+ return _url.get();
+}
+
+- (NSString *)mimeType
+{
+ return _mimeType.get();
+}
+
+- (NSNumber *)size
+{
+ return _size.get();
+}
+
+- (WKLinkIconType)iconType
+{
+ return _iconType;
+}
+
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKLinkIconParametersInternalhfromrev208864trunkSourceWebCorehtmlLinkIconCollectorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h (from rev 208864, trunk/Source/WebCore/html/LinkIconCollector.h) (0 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * Copyright (C) 2016 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 "_WKLinkIconParameters.h"
+
+#if WK_API_ENABLED
+
+namespace WebCore {
+struct LinkIcon;
+}
+
+@interface _WKLinkIconParameters ()
+
+- (instancetype)_initWithLinkIcon:(const WebCore::LinkIcon&)linkIcon;
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaIconLoadingDelegatehfromrev208864trunkSourceWebCorehtmlLinkIconCollectorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/Cocoa/IconLoadingDelegate.h (from rev 208864, trunk/Source/WebCore/html/LinkIconCollector.h) (0 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/IconLoadingDelegate.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/IconLoadingDelegate.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#import "WKFoundation.h"
+
+#if WK_API_ENABLED
+
+#import "APIIconLoadingClient.h"
+#import "WeakObjCPtr.h"
+#import <wtf/RetainPtr.h>
+
+@class WKWebView;
+@protocol _WKIconLoadingDelegate;
+
+namespace WebKit {
+
+class IconLoadingDelegate {
+public:
+ explicit IconLoadingDelegate(WKWebView *);
+ ~IconLoadingDelegate();
+
+ std::unique_ptr<API::IconLoadingClient> createIconLoadingClient();
+
+ RetainPtr<id <_WKIconLoadingDelegate> > delegate();
+ void setDelegate(id <_WKIconLoadingDelegate>);
+
+private:
+ class IconLoadingClient : public API::IconLoadingClient {
+ public:
+ explicit IconLoadingClient(IconLoadingDelegate&);
+ ~IconLoadingClient();
+
+ private:
+ void getLoadDecisionForIcon(const WebCore::LinkIcon&, Function<void (std::function<void (API::Data*, WebKit::CallbackBase::Error)>)>&& completionHandler) override;
+
+ IconLoadingDelegate& m_iconLoadingDelegate;
+ };
+
+ WKWebView *m_webView;
+ WeakObjCPtr<id <_WKIconLoadingDelegate> > m_delegate;
+
+ struct {
+ bool webViewShouldLoadIconWithParametersCompletionHandler : 1;
+ } m_delegateMethods;
+};
+
+} // namespace WebKit
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaIconLoadingDelegatemm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/Cocoa/IconLoadingDelegate.mm (0 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/IconLoadingDelegate.mm         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/IconLoadingDelegate.mm        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -0,0 +1,104 @@
</span><ins>+/*
+ * Copyright (C) 2016 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 "config.h"
+#import "IconLoadingDelegate.h"
+
+#if WK_API_ENABLED
+
+#include "WKNSData.h"
+#include "_WKIconLoadingDelegate.h"
+#include "_WKLinkIconParametersInternal.h"
+
+namespace WebKit {
+
+IconLoadingDelegate::IconLoadingDelegate(WKWebView *webView)
+ : m_webView(webView)
+{
+}
+
+IconLoadingDelegate::~IconLoadingDelegate()
+{
+}
+
+std::unique_ptr<API::IconLoadingClient> IconLoadingDelegate::createIconLoadingClient()
+{
+ return std::make_unique<IconLoadingClient>(*this);
+}
+
+RetainPtr<id <_WKIconLoadingDelegate> > IconLoadingDelegate::delegate()
+{
+ return m_delegate.get();
+}
+
+void IconLoadingDelegate::setDelegate(id <_WKIconLoadingDelegate> delegate)
+{
+ m_delegate = delegate;
+
+ m_delegateMethods.webViewShouldLoadIconWithParametersCompletionHandler = [delegate respondsToSelector:@selector(webView:shouldLoadIconWithParameters:completionHandler:)];
+}
+
+IconLoadingDelegate::IconLoadingClient::IconLoadingClient(IconLoadingDelegate& iconLoadingDelegate)
+ : m_iconLoadingDelegate(iconLoadingDelegate)
+{
+}
+
+IconLoadingDelegate::IconLoadingClient::~IconLoadingClient()
+{
+}
+
+typedef void (^IconLoadCompletionHandler)(NSData*);
+
+void IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon(const WebCore::LinkIcon& linkIcon, Function<void (std::function<void (API::Data*, WebKit::CallbackBase::Error)>)>&& completionHandler)
+{
+ if (!m_iconLoadingDelegate.m_delegateMethods.webViewShouldLoadIconWithParametersCompletionHandler) {
+ completionHandler(nullptr);
+ return;
+ }
+
+ auto delegate = m_iconLoadingDelegate.m_delegate.get();
+ if (!delegate) {
+ completionHandler(nullptr);
+ return;
+ }
+
+ RetainPtr<_WKLinkIconParameters> parameters = adoptNS([[_WKLinkIconParameters alloc] _initWithLinkIcon:linkIcon]);
+
+ [delegate webView:m_iconLoadingDelegate.m_webView shouldLoadIconWithParameters:parameters.get() completionHandler:^void (IconLoadCompletionHandler loadCompletionHandler) {
+ if (loadCompletionHandler) {
+ completionHandler([loadCompletionHandler = Block_copy(loadCompletionHandler)](API::Data* data, WebKit::CallbackBase::Error error) {
+ if (error != CallbackBase::Error::None || !data)
+ loadCompletionHandler(nil);
+ else
+ loadCompletionHandler(wrapper(*data));
+ });
+ } else
+ completionHandler(nullptr);
+ }];
+}
+
+} // namespace WebKit
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include "APIGeometry.h"
</span><span class="cx"> #include "APIHistoryClient.h"
</span><span class="cx"> #include "APIHitTestResult.h"
</span><ins>+#include "APIIconLoadingClient.h"
</ins><span class="cx"> #include "APILegacyContextHistoryClient.h"
</span><span class="cx"> #include "APILoaderClient.h"
</span><span class="cx"> #include "APINavigation.h"
</span><span class="lines">@@ -627,6 +628,20 @@
</span><span class="cx"> setCanRunModal(m_uiClient->canRunModal());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebPageProxy::setIconLoadingClient(std::unique_ptr<API::IconLoadingClient> iconLoadingClient)
+{
+ bool hasClient = iconLoadingClient.get();
+ if (!iconLoadingClient)
+ m_iconLoadingClient = std::make_unique<API::IconLoadingClient>();
+ else
+ m_iconLoadingClient = WTFMove(iconLoadingClient);
+
+ if (!isValid())
+ return;
+
+ m_process->send(Messages::WebPage::SetUseIconLoadingClient(hasClient), m_pageID);
+}
+
</ins><span class="cx"> void WebPageProxy::setFindClient(std::unique_ptr<API::FindClient> findClient)
</span><span class="cx"> {
</span><span class="cx"> if (!findClient) {
</span><span class="lines">@@ -6635,6 +6650,30 @@
</span><span class="cx"> m_pageClient.didRestoreScrollPosition();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebPageProxy::getLoadDecisionForIcon(const WebCore::LinkIcon& icon, uint64_t loadIdentifier)
+{
+ if (!m_iconLoadingClient)
+ return;
+
+ m_iconLoadingClient->getLoadDecisionForIcon(icon, [this, protectedThis = Ref<WebPageProxy>(*this), loadIdentifier](std::function<void (API::Data*, CallbackBase::Error)> callbackFunction) {
+ if (!isValid()) {
+ if (callbackFunction)
+ callbackFunction(nullptr, CallbackBase::Error::Unknown);
+ return;
+ }
+
+ bool decision = (bool)callbackFunction;
+ uint64_t newCallbackIdentifier = decision ? m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivityToken()) : 0;
+
+ m_process->send(Messages::WebPage::DidGetLoadDecisionForIcon(decision, loadIdentifier, newCallbackIdentifier), m_pageID);
+ });
+}
+
+void WebPageProxy::finishedLoadingIcon(uint64_t callbackIdentifier, const IPC::DataReference& data)
+{
+ dataCallback(data, callbackIdentifier);
+}
+
</ins><span class="cx"> void WebPageProxy::setResourceCachingDisabled(bool disabled)
</span><span class="cx"> {
</span><span class="cx"> if (m_isResourceCachingDisabled == disabled)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -129,6 +129,7 @@
</span><span class="cx"> class FormClient;
</span><span class="cx"> class FullscreenClient;
</span><span class="cx"> class HistoryClient;
</span><ins>+class IconLoadingClient;
</ins><span class="cx"> class LoaderClient;
</span><span class="cx"> class Navigation;
</span><span class="cx"> class NavigationClient;
</span><span class="lines">@@ -366,6 +367,9 @@
</span><span class="cx"> API::UIClient& uiClient() { return *m_uiClient; }
</span><span class="cx"> void setUIClient(std::unique_ptr<API::UIClient>);
</span><span class="cx">
</span><ins>+ API::IconLoadingClient& iconLoadingClient() { return *m_iconLoadingClient; }
+ void setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>);
+
</ins><span class="cx"> void initializeWebPage();
</span><span class="cx">
</span><span class="cx"> void close();
</span><span class="lines">@@ -1136,6 +1140,9 @@
</span><span class="cx">
</span><span class="cx"> void didRestoreScrollPosition();
</span><span class="cx">
</span><ins>+ void getLoadDecisionForIcon(const WebCore::LinkIcon&, uint64_t callbackID);
+ void finishedLoadingIcon(uint64_t callbackIdentifier, const IPC::DataReference&);
+
</ins><span class="cx"> void setFocus(bool focused);
</span><span class="cx"> void setWindowFrame(const WebCore::FloatRect&);
</span><span class="cx"> void getWindowFrame(WebCore::FloatRect&);
</span><span class="lines">@@ -1583,6 +1590,7 @@
</span><span class="cx"> std::unique_ptr<API::PolicyClient> m_policyClient;
</span><span class="cx"> std::unique_ptr<API::NavigationClient> m_navigationClient;
</span><span class="cx"> std::unique_ptr<API::HistoryClient> m_historyClient;
</span><ins>+ std::unique_ptr<API::IconLoadingClient> m_iconLoadingClient;
</ins><span class="cx"> std::unique_ptr<API::FormClient> m_formClient;
</span><span class="cx"> std::unique_ptr<API::UIClient> m_uiClient;
</span><span class="cx"> std::unique_ptr<API::FindClient> m_findClient;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -478,6 +478,9 @@
</span><span class="cx">
</span><span class="cx"> DidRestoreScrollPosition()
</span><span class="cx">
</span><ins>+ GetLoadDecisionForIcon(struct WebCore::LinkIcon icon, uint64_t callbackID)
+ FinishedLoadingIcon(uint64_t callbackIdentifier, IPC::DataReference data);
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> DidHandleAcceptedCandidate()
</span><span class="cx"> HandleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, String title, double duration, double elapsedTime)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -881,6 +881,9 @@
</span><span class="cx">                 5106D7C418BDBE73000AB166 /* ContextMenuContextData.h in Headers */ = {isa = PBXBuildFile; fileRef = 5106D7C018BDBE73000AB166 /* ContextMenuContextData.h */; };
</span><span class="cx">                 510AFFB916542048001BA05E /* WebResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510AFFB716542048001BA05E /* WebResourceLoader.cpp */; };
</span><span class="cx">                 510AFFBA16542048001BA05E /* WebResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 510AFFB816542048001BA05E /* WebResourceLoader.h */; };
</span><ins>+                510F59101DDE296900412FF5 /* _WKIconLoadingDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5143B25E1DDCDFD10014FAC6 /* _WKIconLoadingDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                510F59111DDE297000412FF5 /* _WKLinkIconParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C0C9791DDD78540032CAD3 /* _WKLinkIconParameters.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                510F59121DDE297700412FF5 /* _WKLinkIconParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51C0C97A1DDD78540032CAD3 /* _WKLinkIconParameters.mm */; };
</ins><span class="cx">                 510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510FBB981288C95E00AFFDF4 /* WebContextMenuItemData.cpp */; };
</span><span class="cx">                 510FBB9B1288C95E00AFFDF4 /* WebContextMenuItemData.h in Headers */ = {isa = PBXBuildFile; fileRef = 510FBB991288C95E00AFFDF4 /* WebContextMenuItemData.h */; };
</span><span class="cx">                 5110AE0C133C16CB0072717A /* WKIconDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5110AE0A133C16CB0072717A /* WKIconDatabase.cpp */; };
</span><span class="lines">@@ -996,6 +999,8 @@
</span><span class="cx">                 51ACBBA1127A8F2C00D203B9 /* WebContextMenuProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */; };
</span><span class="cx">                 51B15A8413843A3900321AD8 /* EnvironmentUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */; };
</span><span class="cx">                 51B15A8513843A3900321AD8 /* EnvironmentUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */; };
</span><ins>+                51C0C9741DDD76000032CAD3 /* IconLoadingDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C0C9721DDD74F00032CAD3 /* IconLoadingDelegate.h */; };
+                51C0C9751DDD76030032CAD3 /* IconLoadingDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51C0C9731DDD74F00032CAD3 /* IconLoadingDelegate.mm */; };
</ins><span class="cx">                 51CD1C5D1B3493AF00142CA5 /* WKSecurityOriginRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51CD1C591B3493A900142CA5 /* WKSecurityOriginRef.cpp */; };
</span><span class="cx">                 51CD1C5E1B3493B400142CA5 /* WKSecurityOriginRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CD1C5A1B3493A900142CA5 /* WKSecurityOriginRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 51CD1C651B34B9D400142CA5 /* WKSecurityOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CD1C5F1B34B9C900142CA5 /* WKSecurityOrigin.h */; settings = {ATTRIBUTES = (Public, ); }; };
</span><span class="lines">@@ -3012,6 +3017,8 @@
</span><span class="cx">                 513E462C1AD837560016234A /* WKSharingServicePickerDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKSharingServicePickerDelegate.mm; sourceTree = "<group>"; };
</span><span class="cx">                 514129911C6428100059E714 /* WebIDBConnectionToServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIDBConnectionToServer.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 514129921C6428100059E714 /* WebIDBConnectionToServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIDBConnectionToServer.h; sourceTree = "<group>"; };
</span><ins>+                5143B25E1DDCDFD10014FAC6 /* _WKIconLoadingDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKIconLoadingDelegate.h; sourceTree = "<group>"; };
+                5143B2611DDD0DA00014FAC6 /* APIIconLoadingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIIconLoadingClient.h; sourceTree = "<group>"; };
</ins><span class="cx">                 514BDED216C98EDD00E4E25E /* StatisticsRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatisticsRequest.h; sourceTree = "<group>"; };
</span><span class="cx">                 514D9F5519119D35000063A7 /* ServicesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServicesController.h; sourceTree = "<group>"; };
</span><span class="cx">                 514D9F5619119D35000063A7 /* ServicesController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ServicesController.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -3081,6 +3088,11 @@
</span><span class="cx">                 51ACC9351628064800342550 /* NetworkProcessMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkProcessMessages.h; sourceTree = "<group>"; };
</span><span class="cx">                 51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EnvironmentUtilities.cpp; path = unix/EnvironmentUtilities.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EnvironmentUtilities.h; path = unix/EnvironmentUtilities.h; sourceTree = "<group>"; };
</span><ins>+                51C0C9721DDD74F00032CAD3 /* IconLoadingDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconLoadingDelegate.h; sourceTree = "<group>"; };
+                51C0C9731DDD74F00032CAD3 /* IconLoadingDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IconLoadingDelegate.mm; sourceTree = "<group>"; };
+                51C0C9791DDD78540032CAD3 /* _WKLinkIconParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKLinkIconParameters.h; sourceTree = "<group>"; };
+                51C0C97A1DDD78540032CAD3 /* _WKLinkIconParameters.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKLinkIconParameters.mm; sourceTree = "<group>"; };
+                51C0C97B1DDD78540032CAD3 /* _WKLinkIconParametersInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKLinkIconParametersInternal.h; sourceTree = "<group>"; };
</ins><span class="cx">                 51CD1C591B3493A900142CA5 /* WKSecurityOriginRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKSecurityOriginRef.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 51CD1C5A1B3493A900142CA5 /* WKSecurityOriginRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKSecurityOriginRef.h; sourceTree = "<group>"; };
</span><span class="cx">                 51CD1C5F1B34B9C900142CA5 /* WKSecurityOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKSecurityOrigin.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -4820,6 +4832,8 @@
</span><span class="cx">                                 00B9661718E25AE100CE1F88 /* FindClient.mm */,
</span><span class="cx">                                 CD78E1121DB7D7ED0014A2DE /* FullscreenClient.mm */,
</span><span class="cx">                                 CD78E1131DB7D7ED0014A2DE /* FullscreenClient.h */,
</span><ins>+                                51C0C9721DDD74F00032CAD3 /* IconLoadingDelegate.h */,
+                                51C0C9731DDD74F00032CAD3 /* IconLoadingDelegate.mm */,
</ins><span class="cx">                                 0F0C365918C0555800F607D7 /* LayerRepresentation.h */,
</span><span class="cx">                                 1ABC3DF41899E437004F0626 /* NavigationState.h */,
</span><span class="cx">                                 1ABC3DF31899E437004F0626 /* NavigationState.mm */,
</span><span class="lines">@@ -5202,8 +5216,12 @@
</span><span class="cx">                                 2E7A94491BBD95C600945547 /* _WKFocusedElementInfo.h */,
</span><span class="cx">                                 37A64E5618F38F4600EB30F1 /* _WKFormInputSession.h */,
</span><span class="cx">                                 CD78E1181DB7E5AD0014A2DE /* _WKFullscreenDelegate.h */,
</span><ins>+                                5143B25E1DDCDFD10014FAC6 /* _WKIconLoadingDelegate.h */,
</ins><span class="cx">                                 37A64E5418F38E3C00EB30F1 /* _WKInputDelegate.h */,
</span><span class="cx">                                 2D790A9C1AD7050D00AB90B3 /* _WKLayoutMode.h */,
</span><ins>+                                51C0C9791DDD78540032CAD3 /* _WKLinkIconParameters.h */,
+                                51C0C97A1DDD78540032CAD3 /* _WKLinkIconParameters.mm */,
+                                51C0C97B1DDD78540032CAD3 /* _WKLinkIconParametersInternal.h */,
</ins><span class="cx">                                 9323611D1B015DA800FA9232 /* _WKOverlayScrollbarStyle.h */,
</span><span class="cx">                                 1A43E828188F3CDC009E4D30 /* _WKProcessPoolConfiguration.h */,
</span><span class="cx">                                 1A43E827188F3CDC009E4D30 /* _WKProcessPoolConfiguration.mm */,
</span><span class="lines">@@ -6290,6 +6308,7 @@
</span><span class="cx">                                 93A88B431BC8828C00ABA5C2 /* APIHitTestResult.h */,
</span><span class="cx">                                 7CE4D2061A46775700C7F152 /* APILegacyContextHistoryClient.h */,
</span><span class="cx">                                 1A2464F21891E45100234C5B /* APILoaderClient.h */,
</span><ins>+                                5143B2611DDD0DA00014FAC6 /* APIIconLoadingClient.h */,
</ins><span class="cx">                                 7CD3A4801A5D02FA009623B8 /* APINavigation.cpp */,
</span><span class="cx">                                 7CD3A4811A5D02FA009623B8 /* APINavigation.h */,
</span><span class="cx">                                 2DF9EEEA1A7836EE00B6CFBE /* APINavigationAction.h */,
</span><span class="lines">@@ -7837,6 +7856,7 @@
</span><span class="cx">                                 1A7865BA16CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h in Headers */,
</span><span class="cx">                                 1A2BB6D114117B4D000F35D4 /* PluginProcessConnectionMessages.h in Headers */,
</span><span class="cx">                                 1A2D90D21281C966001EB962 /* PluginProcessCreationParameters.h in Headers */,
</span><ins>+                                510F59101DDE296900412FF5 /* _WKIconLoadingDelegate.h in Headers */,
</ins><span class="cx">                                 1A0EC603124A9F2C007EF4A5 /* PluginProcessManager.h in Headers */,
</span><span class="cx">                                 1A0EC6C0124BBD9B007EF4A5 /* PluginProcessMessages.h in Headers */,
</span><span class="cx">                                 1A0EC75E124BC7B2007EF4A5 /* PluginProcessProxy.h in Headers */,
</span><span class="lines">@@ -7923,6 +7943,7 @@
</span><span class="cx">                                 4A3CC18D19B0641900D14AEF /* UserMediaPermissionRequestProxy.h in Headers */,
</span><span class="cx">                                 E4E864931B16750700C82F40 /* VersionChecks.h in Headers */,
</span><span class="cx">                                 2D125C5E1857EA05003BA3CB /* ViewGestureController.h in Headers */,
</span><ins>+                                510F59111DDE297000412FF5 /* _WKLinkIconParameters.h in Headers */,
</ins><span class="cx">                                 2D1B5D5E185869C8006C6596 /* ViewGestureControllerMessages.h in Headers */,
</span><span class="cx">                                 2D819BA21862800E001F03D1 /* ViewGestureGeometryCollectorMessages.h in Headers */,
</span><span class="cx">                                 2D6CD119189058A500E5A4A0 /* ViewSnapshotStore.h in Headers */,
</span><span class="lines">@@ -8284,6 +8305,7 @@
</span><span class="cx">                                 1AA13212191D5924009C1489 /* WKNavigationResponsePrivate.h in Headers */,
</span><span class="cx">                                 2D3A65DF1A7C3A7D00CAC637 /* WKNavigationResponseRef.h in Headers */,
</span><span class="cx">                                 318BE17914743E6F00A8FBB2 /* WKNotification.h in Headers */,
</span><ins>+                                51C0C9741DDD76000032CAD3 /* IconLoadingDelegate.h in Headers */,
</ins><span class="cx">                                 318BE17114743DB100A8FBB2 /* WKNotificationManager.h in Headers */,
</span><span class="cx">                                 31A2EC74148D59CA00810D71 /* WKNotificationPermissionRequest.h in Headers */,
</span><span class="cx">                                 312C0C4A146DDC8A0016C911 /* WKNotificationProvider.h in Headers */,
</span><span class="lines">@@ -9511,6 +9533,7 @@
</span><span class="cx">                                 BC1BE1E112D54A410004A228 /* WebGeolocationClient.cpp in Sources */,
</span><span class="cx">                                 BC0E5FE612D697160012A72A /* WebGeolocationManager.cpp in Sources */,
</span><span class="cx">                                 BC0E606112D6BA910012A72A /* WebGeolocationManagerMessageReceiver.cpp in Sources */,
</span><ins>+                                510F59121DDE297700412FF5 /* _WKLinkIconParameters.mm in Sources */,
</ins><span class="cx">                                 BC54CACC12D64291005C67B0 /* WebGeolocationManagerProxy.cpp in Sources */,
</span><span class="cx">                                 BC0E618212D6CB1D0012A72A /* WebGeolocationManagerProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 BC0E607412D6BC200012A72A /* WebGeolocationPosition.cpp in Sources */,
</span><span class="lines">@@ -9608,6 +9631,7 @@
</span><span class="cx">                                 BCD59800112B57BE00EC8C23 /* WebPreferences.cpp in Sources */,
</span><span class="cx">                                 7C85FD7F19341665000177C4 /* WebPreferencesKeys.cpp in Sources */,
</span><span class="cx">                                 BC84EB1812A7100C0083F2DA /* WebPreferencesMac.mm in Sources */,
</span><ins>+                                51C0C9751DDD76030032CAD3 /* IconLoadingDelegate.mm in Sources */,
</ins><span class="cx">                                 BCD598AD112B7FDF00EC8C23 /* WebPreferencesStore.cpp in Sources */,
</span><span class="cx">                                 BC111AE4112F5C2600337BAB /* WebProcess.cpp in Sources */,
</span><span class="cx">                                 7C6E70FB18B2DC7A00F24E2E /* WebProcessCocoa.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -1749,4 +1749,25 @@
</span><span class="cx"> webPage->didRestoreScrollPosition();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool WebFrameLoaderClient::useIconLoadingClient()
+{
+ return m_useIconLoadingClient;
+}
+
+void WebFrameLoaderClient::getLoadDecisionForIcon(const LinkIcon& icon, uint64_t callbackID)
+{
+ if (WebPage* webPage { m_frame->page() })
+ webPage->send(Messages::WebPageProxy::GetLoadDecisionForIcon(icon, callbackID));
+}
+
+void WebFrameLoaderClient::finishedLoadingIcon(uint64_t loadIdentifier, SharedBuffer* data)
+{
+ if (WebPage* webPage { m_frame->page() }) {
+ if (data)
+ webPage->send(Messages::WebPageProxy::FinishedLoadingIcon(loadIdentifier, { reinterpret_cast<const uint8_t*>(data->data()), data->size() }));
+ else
+ webPage->send(Messages::WebPageProxy::FinishedLoadingIcon(loadIdentifier, { nullptr, 0 }));
+ }
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -46,6 +46,8 @@
</span><span class="cx">
</span><span class="cx"> bool frameHasCustomContentProvider() const { return m_frameHasCustomContentProvider; }
</span><span class="cx">
</span><ins>+ void setUseIconLoadingClient(bool useIconLoadingClient) { m_useIconLoadingClient = useIconLoadingClient; }
+
</ins><span class="cx"> private:
</span><span class="cx"> void frameLoaderDestroyed() override;
</span><span class="cx">
</span><span class="lines">@@ -255,6 +257,10 @@
</span><span class="cx">
</span><span class="cx"> void didRestoreScrollPosition() override;
</span><span class="cx">
</span><ins>+ bool useIconLoadingClient() override;
+ void getLoadDecisionForIcon(const WebCore::LinkIcon&, uint64_t callbackID) override;
+ void finishedLoadingIcon(uint64_t loadIdentifier, WebCore::SharedBuffer*) override;
+
</ins><span class="cx"> WebFrame* m_frame;
</span><span class="cx"> RefPtr<PluginView> m_pluginView;
</span><span class="cx"> bool m_hasSentResponseToPluginView;
</span><span class="lines">@@ -261,6 +267,7 @@
</span><span class="cx"> bool m_didCompletePageTransition;
</span><span class="cx"> bool m_frameHasCustomContentProvider;
</span><span class="cx"> bool m_frameCameFromPageCache;
</span><ins>+ bool m_useIconLoadingClient { false };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // As long as EmptyFrameLoaderClient exists in WebCore, this can return 0.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -5663,4 +5663,15 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+void WebPage::didGetLoadDecisionForIcon(bool decision, uint64_t loadIdentifier, uint64_t newCallbackID)
+{
+ if (auto* documentLoader = corePage()->mainFrame().loader().documentLoader())
+ documentLoader->didGetLoadDecisionForIcon(decision, loadIdentifier, newCallbackID);
+}
+
+void WebPage::setUseIconLoadingClient(bool useIconLoadingClient)
+{
+ static_cast<WebFrameLoaderClient&>(corePage()->mainFrame().loader().client()).setUseIconLoadingClient(useIconLoadingClient);
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -968,6 +968,9 @@
</span><span class="cx"> void didLosePointerLock();
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ void didGetLoadDecisionForIcon(bool decision, uint64_t loadIdentifier, uint64_t newCallbackID);
+ void setUseIconLoadingClient(bool);
+
</ins><span class="cx"> private:
</span><span class="cx"> WebPage(uint64_t pageID, const WebPageCreationParameters&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -446,6 +446,9 @@
</span><span class="cx">
</span><span class="cx"> SetUserInterfaceLayoutDirection(uint32_t direction)
</span><span class="cx">
</span><ins>+ DidGetLoadDecisionForIcon(bool decision, uint64_t loadIdentifier, uint64_t newCallbackID)
+ SetUseIconLoadingClient(bool useIconLoadingClient)
+
</ins><span class="cx"> #if ENABLE(GAMEPAD)
</span><span class="cx"> GamepadActivity(Vector<WebKit::GamepadData> gamepadDatas)
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Tools/ChangeLog        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-11-17 Brady Eidson <beidson@apple.com>
+
+ Add _WKIconLoadingDelegate SPI.
+ https://bugs.webkit.org/show_bug.cgi?id=164894
+
+ Reviewed by Alex Christensen.
+
+ Add MiniBrowser support for this new SPI, configurable with a setting.
+
+ * MiniBrowser/mac/SettingsController.h:
+ * MiniBrowser/mac/SettingsController.m:
+ (-[SettingsController _populateMenu]):
+ (-[SettingsController validateMenuItem:]):
+ (-[SettingsController loadsAllSiteIcons]):
+ (-[SettingsController toggleLoadsAllSiteIcons:]):
+ * MiniBrowser/mac/WK2BrowserWindowController.m:
+ (-[WK2BrowserWindowController awakeFromNib]):
+ (-[WK2BrowserWindowController webView:shouldLoadIconWithParameters:completionHandler:]):
+
</ins><span class="cx"> 2016-11-17 Caitlin Potter <caitp@igalia.com>
</span><span class="cx">
</span><span class="cx"> [JSC] remove leftover references to ES2017_ASYNCFUNCTION_SYNTAX flag
</span></span></pre></div>
<a id="trunkToolsMiniBrowsermacSettingsControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/MiniBrowser/mac/SettingsController.h (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/MiniBrowser/mac/SettingsController.h        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Tools/MiniBrowser/mac/SettingsController.h        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx"> @property (nonatomic, readonly) BOOL resourceLoadStatisticsEnabled;
</span><span class="cx"> @property (nonatomic, readonly) BOOL visualViewportEnabled;
</span><span class="cx"> @property (nonatomic, readonly) BOOL asyncImageDecodingEnabled;
</span><ins>+@property (nonatomic, readonly) BOOL loadsAllSiteIcons;
</ins><span class="cx"> @property (nonatomic, readonly) BOOL usesGameControllerFramework;
</span><span class="cx">
</span><span class="cx"> @property (nonatomic, readonly) NSString *defaultURL;
</span></span></pre></div>
<a id="trunkToolsMiniBrowsermacSettingsControllerm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/MiniBrowser/mac/SettingsController.m (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/MiniBrowser/mac/SettingsController.m        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Tools/MiniBrowser/mac/SettingsController.m        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> static NSString * const SimpleLineLayoutDebugBordersEnabledPreferenceKey = @"SimpleLineLayoutDebugBordersEnabled";
</span><span class="cx"> static NSString * const TiledScrollingIndicatorVisiblePreferenceKey = @"TiledScrollingIndicatorVisible";
</span><span class="cx"> static NSString * const ResourceUsageOverlayVisiblePreferenceKey = @"ResourceUsageOverlayVisible";
</span><ins>+static NSString * const LoadsAllSiteIconsKey = @"LoadsAllSiteIcons";
</ins><span class="cx"> static NSString * const UsesGameControllerFrameworkKey = @"UsesGameControllerFramework";
</span><span class="cx"> static NSString * const IncrementalRenderingSuppressedPreferenceKey = @"IncrementalRenderingSuppressed";
</span><span class="cx"> static NSString * const AcceleratedDrawingEnabledPreferenceKey = @"AcceleratedDrawingEnabled";
</span><span class="lines">@@ -135,6 +136,7 @@
</span><span class="cx"> [self _addItemWithTitle:@"Use UI-Side Compositing" action:@selector(toggleUseUISideCompositing:) indented:YES];
</span><span class="cx"> [self _addItemWithTitle:@"Disable Per-Window Web Processes" action:@selector(togglePerWindowWebProcessesDisabled:) indented:YES];
</span><span class="cx"> [self _addItemWithTitle:@"Show Resource Usage Overlay" action:@selector(toggleShowResourceUsageOverlay:) indented:YES];
</span><ins>+ [self _addItemWithTitle:@"Load All Site Icons Per-Page" action:@selector(toggleLoadsAllSiteIcons:) indented:YES];
</ins><span class="cx"> [self _addItemWithTitle:@"Use GameController.framework on macOS (Restart required)" action:@selector(toggleUsesGameControllerFramework:) indented:YES];
</span><span class="cx">
</span><span class="cx"> NSMenuItem *debugOverlaysSubmenuItem = [[NSMenuItem alloc] initWithTitle:@"Debug Overlays" action:nil keyEquivalent:@""];
</span><span class="lines">@@ -209,6 +211,8 @@
</span><span class="cx"> [menuItem setState:[self tiledScrollingIndicatorVisible] ? NSOnState : NSOffState];
</span><span class="cx"> else if (action == @selector(toggleShowResourceUsageOverlay:))
</span><span class="cx"> [menuItem setState:[self resourceUsageOverlayVisible] ? NSOnState : NSOffState];
</span><ins>+ else if (action == @selector(toggleLoadsAllSiteIcons:))
+ [menuItem setState:[self loadsAllSiteIcons] ? NSOnState : NSOffState];
</ins><span class="cx"> else if (action == @selector(toggleUsesGameControllerFramework:))
</span><span class="cx"> [menuItem setState:[self usesGameControllerFramework] ? NSOnState : NSOffState];
</span><span class="cx"> else if (action == @selector(toggleUseUISideCompositing:))
</span><span class="lines">@@ -358,6 +362,16 @@
</span><span class="cx"> [self _toggleBooleanDefault:ResourceUsageOverlayVisiblePreferenceKey];
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (BOOL)loadsAllSiteIcons
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:LoadsAllSiteIconsKey];
+}
+
+- (void)toggleLoadsAllSiteIcons:(id)sender
+{
+ [self _toggleBooleanDefault:LoadsAllSiteIconsKey];
+}
+
</ins><span class="cx"> - (BOOL)usesGameControllerFramework
</span><span class="cx"> {
</span><span class="cx"> return [[NSUserDefaults standardUserDefaults] boolForKey:UsesGameControllerFrameworkKey];
</span></span></pre></div>
<a id="trunkToolsMiniBrowsermacWK2BrowserWindowControllerm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m (208864 => 208865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m        2016-11-18 00:11:18 UTC (rev 208864)
+++ trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m        2016-11-18 00:22:44 UTC (rev 208865)
</span><span class="lines">@@ -38,11 +38,13 @@
</span><span class="cx"> #import <WebKit/WKWebViewPrivate.h>
</span><span class="cx"> #import <WebKit/WKWebsiteDataStorePrivate.h>
</span><span class="cx"> #import <WebKit/WebNSURLExtras.h>
</span><ins>+#import <WebKit/_WKIconLoadingDelegate.h>
+#import <WebKit/_WKLinkIconParameters.h>
</ins><span class="cx"> #import <WebKit/_WKUserInitiatedAction.h>
</span><span class="cx">
</span><span class="cx"> static void* keyValueObservingContext = &keyValueObservingContext;
</span><span class="cx">
</span><del>-@interface WK2BrowserWindowController () <WKNavigationDelegate, WKUIDelegate>
</del><ins>+@interface WK2BrowserWindowController () <WKNavigationDelegate, WKUIDelegate, _WKIconLoadingDelegate>
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> @implementation WK2BrowserWindowController {
</span><span class="lines">@@ -73,6 +75,11 @@
</span><span class="cx">
</span><span class="cx"> _webView.navigationDelegate = self;
</span><span class="cx"> _webView.UIDelegate = self;
</span><ins>+
+ // This setting installs the new WK2 Icon Loading Delegate and tests that mechanism by
+ // telling WebKit to load every icon referenced by the page.
+ if ([[SettingsController shared] loadsAllSiteIcons])
+ _webView._iconLoadingDelegate = self;
</ins><span class="cx">
</span><span class="cx"> _webView._observedRenderingProgressEvents = _WKRenderingProgressEventFirstLayout
</span><span class="cx"> | _WKRenderingProgressEventFirstVisuallyNonEmptyLayout
</span><span class="lines">@@ -649,6 +656,13 @@
</span><span class="cx"> LOG(@"renderingProgressDidChange: %@", @"first paint after suppressed incremental rendering");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (void)webView:(WKWebView *)webView shouldLoadIconWithParameters:(_WKLinkIconParameters *)parameters completionHandler:(void (^)(void (^)(NSData*)))completionHandler
+{
+ completionHandler(^void (NSData *data) {
+ LOG(@"Icon URL %@ received icon data of length %u", parameters.url, (unsigned)data.length);
+ });
+}
+
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> #endif // WK_API_ENABLED
</span></span></pre>
</div>
</div>
</body>
</html>