<!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>[245044] 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/245044">245044</a></dd>
<dt>Author</dt> <dd>ryanhaddad@apple.com</dd>
<dt>Date</dt> <dd>2019-05-07 16:44:52 -0700 (Tue, 07 May 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/245038">r245038</a>.

Breaks internal builds.

Reverted changeset:

"Add SPI to set a list of hosts to which to send custom header
fields cross-origin"
https://bugs.webkit.org/show_bug.cgi?id=197397
https://trac.webkit.org/changeset/245038</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreHeaderscmake">trunk/Source/WebCore/Headers.cmake</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</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="#trunkSourceWebCoreloadercacheCachedResourceLoadercpp">trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharedAPIAPIObjecth">trunk/Source/WebKit/Shared/API/APIObject.h</a></li>
<li><a href="#trunkSourceWebKitSharedCocoaAPIObjectmm">trunk/Source/WebKit/Shared/Cocoa/APIObject.mm</a></li>
<li><a href="#trunkSourceWebKitSharedWebsitePoliciesDatacpp">trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedWebsitePoliciesDatah">trunk/Source/WebKit/Shared/WebsitePoliciesData.h</a></li>
<li><a href="#trunkSourceWebKitSourcesCocoatxt">trunk/Source/WebKit/SourcesCocoa.txt</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIAPIWebsitePoliciescpp">trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIAPIWebsitePoliciesh">trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICWKWebsitePoliciescpp">trunk/Source/WebKit/UIProcess/API/C/WKWebsitePolicies.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoaWKWebpagePreferencesmm">trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoaWKWebpagePreferencesPrivateh">trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoa_WKWebsitePoliciesh">trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoa_WKWebsitePoliciesmm">trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitCocoaWebsitePoliciesmm">trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreloaderCustomHeaderFieldscpp">trunk/Source/WebCore/loader/CustomHeaderFields.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderCustomHeaderFieldsh">trunk/Source/WebCore/loader/CustomHeaderFields.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIAPICustomHeaderFieldsh">trunk/Source/WebKit/UIProcess/API/APICustomHeaderFields.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoa_WKCustomHeaderFieldsh">trunk/Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFields.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoa_WKCustomHeaderFieldsmm">trunk/Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFields.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoa_WKCustomHeaderFieldsInternalh">trunk/Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebCore/ChangeLog      2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r245038.
+
+        Breaks internal builds.
+
+        Reverted changeset:
+
+        "Add SPI to set a list of hosts to which to send custom header
+        fields cross-origin"
+        https://bugs.webkit.org/show_bug.cgi?id=197397
+        https://trac.webkit.org/changeset/245038
+
</ins><span class="cx"> 2019-05-07  Jiewen Tan  <jiewen_tan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [WebAuthN] A new request should always suppress the pending request if any
</span></span></pre></div>
<a id="trunkSourceWebCoreHeaderscmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Headers.cmake (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Headers.cmake       2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebCore/Headers.cmake  2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -654,7 +654,6 @@
</span><span class="cx">     loader/CookieJar.h
</span><span class="cx">     loader/CrossOriginAccessControl.h
</span><span class="cx">     loader/CrossOriginPreflightResultCache.h
</span><del>-    loader/CustomHeaderFields.h
</del><span class="cx">     loader/DocumentLoader.h
</span><span class="cx">     loader/DocumentWriter.h
</span><span class="cx">     loader/EmptyClients.h
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebCore/Sources.txt    2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -1364,7 +1364,6 @@
</span><span class="cx"> loader/CrossOriginAccessControl.cpp
</span><span class="cx"> loader/CrossOriginPreflightChecker.cpp
</span><span class="cx"> loader/CrossOriginPreflightResultCache.cpp
</span><del>-loader/CustomHeaderFields.cpp @no-unify
</del><span class="cx"> loader/DocumentLoader.cpp
</span><span class="cx"> loader/DocumentThreadableLoader.cpp
</span><span class="cx"> loader/DocumentWriter.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -1872,7 +1872,6 @@
</span><span class="cx">          5C4304B0191AC908000E2BC0 /* EXTShaderTextureLOD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C4304AD191AC908000E2BC0 /* EXTShaderTextureLOD.cpp */; };
</span><span class="cx">          5C4304B1191AC908000E2BC0 /* EXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304AE191AC908000E2BC0 /* EXTShaderTextureLOD.h */; };
</span><span class="cx">          5C4304B6191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304B4191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h */; };
</span><del>-               5C5D2385227A0652000B9BDA /* CustomHeaderFields.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C5D2383227A063A000B9BDA /* CustomHeaderFields.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">           5C7C88D81D0F1F4A009D2F6D /* SocketProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7C88D71D0F1F2B009D2F6D /* SocketProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5C9C2DB52241A67B00996B0B /* ContentRuleListResults.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C9C2DB32241A67300996B0B /* ContentRuleListResults.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5C9EF2F321F06190003BDC56 /* StorageSessionProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C9EF2F221F06171003BDC56 /* StorageSessionProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -1879,7 +1878,6 @@
</span><span class="cx">          5CA1DEC61F71F1C700E71BD3 /* HTTPHeaderField.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CA1DEC41F71E68700E71BD3 /* HTTPHeaderField.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5CB37FFF1C62D2A100F20188 /* ScrollAnimatorMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CB37FFD1C62D27800F20188 /* ScrollAnimatorMock.h */; };
</span><span class="cx">          5CBC8DAD1AAA302200E1C803 /* MediaAccessibilitySoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CBC8DAB1AAA302200E1C803 /* MediaAccessibilitySoftLink.h */; };
</span><del>-               5CBD59592280E926002B22AA /* CustomHeaderFields.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D2386227A077C000B9BDA /* CustomHeaderFields.cpp */; };
</del><span class="cx">           5CD9F5661AA0F73C00DA45FF /* DFABytecode.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C39305D1AA0F6A90029C816 /* DFABytecode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5CD9F5671AA0F74200DA45FF /* DFABytecodeCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C39305F1AA0F6A90029C816 /* DFABytecodeCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5CD9F5681AA0F74600DA45FF /* DFABytecodeInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C3930611AA0F6A90029C816 /* DFABytecodeInterpreter.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -8832,8 +8830,6 @@
</span><span class="cx">          5C5381B11D87D45700E2EBE6 /* URLSearchParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLSearchParams.h; sourceTree = "<group>"; };
</span><span class="cx">          5C5381B31D87E08100E2EBE6 /* JSURLSearchParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSURLSearchParams.cpp; sourceTree = "<group>"; };
</span><span class="cx">          5C5381B41D87E08100E2EBE6 /* JSURLSearchParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSURLSearchParams.h; sourceTree = "<group>"; };
</span><del>-               5C5D2383227A063A000B9BDA /* CustomHeaderFields.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomHeaderFields.h; sourceTree = "<group>"; };
-               5C5D2386227A077C000B9BDA /* CustomHeaderFields.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomHeaderFields.cpp; sourceTree = "<group>"; };
</del><span class="cx">           5C668E641E7C6C3500D32B3B /* SocketStreamHandleImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketStreamHandleImpl.cpp; sourceTree = "<group>"; };
</span><span class="cx">          5C688AA01D380509000B54FA /* ThreadableWebSocketChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadableWebSocketChannel.cpp; sourceTree = "<group>"; };
</span><span class="cx">          5C688AA21D38126F000B54FA /* SocketProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketProvider.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -25013,8 +25009,6 @@
</span><span class="cx">                          41ABE67A1D0580D5006D862D /* CrossOriginPreflightChecker.h */,
</span><span class="cx">                          E1C415DD0F655D7C0092D2FB /* CrossOriginPreflightResultCache.cpp */,
</span><span class="cx">                          E1C415D90F655D6F0092D2FB /* CrossOriginPreflightResultCache.h */,
</span><del>-                               5C5D2386227A077C000B9BDA /* CustomHeaderFields.cpp */,
-                               5C5D2383227A063A000B9BDA /* CustomHeaderFields.h */,
</del><span class="cx">                           93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */,
</span><span class="cx">                          656D371E0ADBA5DE00A4554D /* DocumentLoader.h */,
</span><span class="cx">                          0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */,
</span><span class="lines">@@ -28687,7 +28681,6 @@
</span><span class="cx">                          93D437A01D57B19A00AB85EA /* CustomElementReactionQueue.h in Headers */,
</span><span class="cx">                          9BD4E91B1C462CFC005065BC /* CustomElementRegistry.h in Headers */,
</span><span class="cx">                          62CD325A1157E57C0063B0A7 /* CustomEvent.h in Headers */,
</span><del>-                               5C5D2385227A0652000B9BDA /* CustomHeaderFields.h in Headers */,
</del><span class="cx">                           4B1E13E721790D660042CF98 /* CustomPaintCanvas.h in Headers */,
</span><span class="cx">                          4B7AE4932177B56F00C59959 /* CustomPaintImage.h in Headers */,
</span><span class="cx">                          A8CB413E0E8633FD0032C4F0 /* DashArray.h in Headers */,
</span><span class="lines">@@ -32612,7 +32605,6 @@
</span><span class="cx">                          07AFF4231EFB144900B545B3 /* CoreAudioCaptureSourceIOS.mm in Sources */,
</span><span class="cx">                          46C696CC1E7205FC00597937 /* CPUMonitor.cpp in Sources */,
</span><span class="cx">                          1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */,
</span><del>-                               5CBD59592280E926002B22AA /* CustomHeaderFields.cpp in Sources */,
</del><span class="cx">                           BE23480C18A9870B00E4B6E8 /* DataCue.cpp in Sources */,
</span><span class="cx">                          4463CF682212FA68001A8577 /* DataDetectorsCoreSoftLink.mm in Sources */,
</span><span class="cx">                          E58B45BB20AD07DD00991025 /* DataListButtonElement.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderCustomHeaderFieldscpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/loader/CustomHeaderFields.cpp (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/CustomHeaderFields.cpp       2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebCore/loader/CustomHeaderFields.cpp  2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -1,52 +0,0 @@
</span><del>-/*
- * Copyright (C) 2019 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "CustomHeaderFields.h"
-
-#include "HTTPHeaderField.h"
-#include "RegistrableDomain.h"
-
-namespace WebCore {
-
-bool CustomHeaderFields::thirdPartyDomainsMatch(const URL& url) const
-{
-    if (thirdPartyDomains.isEmpty())
-        return false;
-
-    auto registrableDomainLength = RegistrableDomain(url).string().length();
-    for (const auto& domainOrPattern : thirdPartyDomains) {
-        if (domainOrPattern == url.host())
-            return true;
-        if (domainOrPattern.startsWith("*.")
-            && url.host().endsWith(StringView(domainOrPattern).substring(1))
-            && domainOrPattern.length() > registrableDomainLength)
-            return true;
-    }
-
-    return false;
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreloaderCustomHeaderFieldsh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/loader/CustomHeaderFields.h (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/CustomHeaderFields.h 2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebCore/loader/CustomHeaderFields.h    2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -1,67 +0,0 @@
</span><del>-/*
- * Copyright (C) 2019 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. ``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
- * 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 "HTTPHeaderField.h"
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-struct WEBCORE_EXPORT CustomHeaderFields {
-    Vector<HTTPHeaderField> fields;
-    Vector<String> thirdPartyDomains;
-
-    bool thirdPartyDomainsMatch(const URL&) const;
-
-    template<class Encoder> void encode(Encoder&) const;
-    template<class Decoder> static Optional<CustomHeaderFields> decode(Decoder&);
-};
-
-template<class Encoder>
-void CustomHeaderFields::encode(Encoder& encoder) const
-{
-    encoder << fields;
-    encoder << thirdPartyDomains;
-}
-
-template<class Decoder>
-Optional<CustomHeaderFields> CustomHeaderFields::decode(Decoder& decoder)
-{
-    Optional<Vector<HTTPHeaderField>> fields;
-    decoder >> fields;
-    if (!fields)
-        return WTF::nullopt;
-    
-    Optional<Vector<String>> thirdPartyDomains;
-    decoder >> thirdPartyDomains;
-    if (!thirdPartyDomains)
-        return WTF::nullopt;
-    
-    return {{ WTFMove(*fields), WTFMove(*thirdPartyDomains) }};
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp   2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp      2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx"> #include "CachedResourceLoader.h"
</span><span class="cx"> #include "ContentExtensionError.h"
</span><span class="cx"> #include "ContentSecurityPolicy.h"
</span><del>-#include "CustomHeaderFields.h"
</del><span class="cx"> #include "DOMWindow.h"
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "DocumentParser.h"
</span><span class="lines">@@ -54,6 +53,7 @@
</span><span class="cx"> #include "FrameTree.h"
</span><span class="cx"> #include "HTMLFormElement.h"
</span><span class="cx"> #include "HTMLFrameOwnerElement.h"
</span><ins>+#include "HTTPHeaderField.h"
</ins><span class="cx"> #include "HTTPHeaderNames.h"
</span><span class="cx"> #include "HistoryItem.h"
</span><span class="cx"> #include "HistoryController.h"
</span><span class="lines">@@ -1322,6 +1322,11 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+void DocumentLoader::setCustomHeaderFields(Vector<HTTPHeaderField>&& fields)
+{
+    m_customHeaderFields = WTFMove(fields);
+}
+
</ins><span class="cx"> bool DocumentLoader::isLoadingInAPISense() const
</span><span class="cx"> {
</span><span class="cx">     // Once a frame has loaded, we no longer need to consider subresources,
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.h (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.h     2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebCore/loader/DocumentLoader.h        2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -76,10 +76,10 @@
</span><span class="cx"> class CachedRawResource;
</span><span class="cx"> class CachedResourceLoader;
</span><span class="cx"> class ContentFilter;
</span><del>-struct CustomHeaderFields;
</del><span class="cx"> class FormState;
</span><span class="cx"> class Frame;
</span><span class="cx"> class FrameLoader;
</span><ins>+class HTTPHeaderField;
</ins><span class="cx"> class IconLoader;
</span><span class="cx"> class Page;
</span><span class="cx"> class PreviewConverter;
</span><span class="lines">@@ -371,8 +371,8 @@
</span><span class="cx">     void finishedLoadingApplicationManifest(ApplicationManifestLoader&);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void setCustomHeaderFields(Vector<CustomHeaderFields>&& fields) { m_customHeaderFields = WTFMove(fields); }
-    const Vector<CustomHeaderFields>& customHeaderFields() const { return m_customHeaderFields; }
</del><ins>+    WEBCORE_EXPORT void setCustomHeaderFields(Vector<HTTPHeaderField>&& fields);
+    const Vector<HTTPHeaderField>& customHeaderFields() { return m_customHeaderFields; }
</ins><span class="cx"> 
</span><span class="cx">     void setAllowsWebArchiveForMainFrame(bool allowsWebArchiveForMainFrame) { m_allowsWebArchiveForMainFrame = allowsWebArchiveForMainFrame; }
</span><span class="cx">     bool allowsWebArchiveForMainFrame() const { return m_allowsWebArchiveForMainFrame; }
</span><span class="lines">@@ -564,7 +564,7 @@
</span><span class="cx">     HashMap<std::unique_ptr<ApplicationManifestLoader>, uint64_t> m_applicationManifestLoaders;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    Vector<CustomHeaderFields> m_customHeaderFields;
</del><ins>+    Vector<HTTPHeaderField> m_customHeaderFields;
</ins><span class="cx">     
</span><span class="cx">     bool m_subresourceLoadersArePageCacheAcceptable { false };
</span><span class="cx">     ShouldOpenExternalURLsPolicy m_shouldOpenExternalURLsPolicy { ShouldOpenExternalURLsPolicy::ShouldNotAllow };
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp       2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp  2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -43,7 +43,6 @@
</span><span class="cx"> #include "ContentRuleListResults.h"
</span><span class="cx"> #include "ContentSecurityPolicy.h"
</span><span class="cx"> #include "CrossOriginAccessControl.h"
</span><del>-#include "CustomHeaderFields.h"
</del><span class="cx"> #include "DOMWindow.h"
</span><span class="cx"> #include "DiagnosticLoggingClient.h"
</span><span class="cx"> #include "DiagnosticLoggingKeys.h"
</span><span class="lines">@@ -859,11 +858,9 @@
</span><span class="cx">             sameOriginRequest = document()->topDocument().securityOrigin().isSameSchemeHostPort(requestedOrigin.get())
</span><span class="cx">                 && document()->securityOrigin().isSameSchemeHostPort(requestedOrigin.get());
</span><span class="cx">         }
</span><del>-        for (auto& fields : m_documentLoader->customHeaderFields()) {
-            if (sameOriginRequest || fields.thirdPartyDomainsMatch(url)) {
-                for (auto& field : fields.fields)
-                    request.resourceRequest().setHTTPHeaderField(field.name(), field.value());
-            }
</del><ins>+        if (sameOriginRequest) {
+            for (auto& field : m_documentLoader->customHeaderFields())
+                request.resourceRequest().setHTTPHeaderField(field.name(), field.value());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/ChangeLog       2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r245038.
+
+        Breaks internal builds.
+
+        Reverted changeset:
+
+        "Add SPI to set a list of hosts to which to send custom header
+        fields cross-origin"
+        https://bugs.webkit.org/show_bug.cgi?id=197397
+        https://trac.webkit.org/changeset/245038
+
</ins><span class="cx"> 2019-05-07  Jiewen Tan  <jiewen_tan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [WebAuthN] A new request should always suppress the pending request if any
</span></span></pre></div>
<a id="trunkSourceWebKitSharedAPIAPIObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/API/APIObject.h (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/API/APIObject.h       2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/Shared/API/APIObject.h  2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -111,7 +111,6 @@
</span><span class="cx">         ContentRuleListStore,
</span><span class="cx">         ContextMenuListener,
</span><span class="cx">         CookieManager,
</span><del>-        CustomHeaderFields,
</del><span class="cx">         InternalDebugFeature,
</span><span class="cx">         Download,
</span><span class="cx">         ExperimentalFeature,
</span></span></pre></div>
<a id="trunkSourceWebKitSharedCocoaAPIObjectmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/Cocoa/APIObject.mm (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/Cocoa/APIObject.mm    2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/Shared/Cocoa/APIObject.mm       2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -70,7 +70,6 @@
</span><span class="cx"> #import "_WKAttachmentInternal.h"
</span><span class="cx"> #import "_WKAutomationSessionInternal.h"
</span><span class="cx"> #import "_WKContentRuleListActionInternal.h"
</span><del>-#import "_WKCustomHeaderFieldsInternal.h"
</del><span class="cx"> #import "_WKDownloadInternal.h"
</span><span class="cx"> #import "_WKExperimentalFeatureInternal.h"
</span><span class="cx"> #import "_WKFrameHandleInternal.h"
</span><span class="lines">@@ -313,10 +312,6 @@
</span><span class="cx">         wrapper = [WKContentRuleListStore alloc];
</span><span class="cx">         break;
</span><span class="cx"> 
</span><del>-    case Type::CustomHeaderFields:
-        wrapper = [_WKCustomHeaderFields alloc];
-        break;
-
</del><span class="cx">     case Type::UserContentWorld:
</span><span class="cx">         wrapper = [_WKUserContentWorld alloc];
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebsitePoliciesDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp       2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp  2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include "ArgumentCoders.h"
</span><span class="cx"> #include "WebProcess.h"
</span><del>-#include <WebCore/CustomHeaderFields.h>
</del><span class="cx"> #include <WebCore/DocumentLoader.h>
</span><span class="cx"> #include <WebCore/Frame.h>
</span><span class="cx"> #include <WebCore/Page.h>
</span><span class="lines">@@ -78,7 +77,7 @@
</span><span class="cx">     if (!allowedAutoplayQuirks)
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx">     
</span><del>-    Optional<Vector<WebCore::CustomHeaderFields>> customHeaderFields;
</del><ins>+    Optional<Vector<WebCore::HTTPHeaderField>> customHeaderFields;
</ins><span class="cx">     decoder >> customHeaderFields;
</span><span class="cx">     if (!customHeaderFields)
</span><span class="cx">         return WTF::nullopt;
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebsitePoliciesDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebsitePoliciesData.h (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebsitePoliciesData.h 2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/Shared/WebsitePoliciesData.h    2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -32,8 +32,8 @@
</span><span class="cx"> #include "WebsiteMetaViewportPolicy.h"
</span><span class="cx"> #include "WebsitePopUpPolicy.h"
</span><span class="cx"> #include "WebsiteSimulatedMouseEventsDispatchPolicy.h"
</span><del>-#include <WebCore/CustomHeaderFields.h>
</del><span class="cx"> #include <WebCore/DeviceOrientationOrMotionPermissionState.h>
</span><ins>+#include <WebCore/HTTPHeaderField.h>
</ins><span class="cx"> #include <wtf/OptionSet.h>
</span><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> #if ENABLE(DEVICE_ORIENTATION)
</span><span class="cx">     WebCore::DeviceOrientationOrMotionPermissionState deviceOrientationAndMotionAccessState;
</span><span class="cx"> #endif
</span><del>-    Vector<WebCore::CustomHeaderFields> customHeaderFields;
</del><ins>+    Vector<WebCore::HTTPHeaderField> customHeaderFields;
</ins><span class="cx">     WebsitePopUpPolicy popUpPolicy { WebsitePopUpPolicy::Default };
</span><span class="cx">     Optional<WebsiteDataStoreParameters> websiteDataStoreParameters;
</span><span class="cx">     String customUserAgent;
</span></span></pre></div>
<a id="trunkSourceWebKitSourcesCocoatxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/SourcesCocoa.txt (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/SourcesCocoa.txt     2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/SourcesCocoa.txt        2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -241,7 +241,6 @@
</span><span class="cx"> UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm
</span><span class="cx"> UIProcess/API/Cocoa/_WKContentRuleListAction.mm
</span><span class="cx"> UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm
</span><del>-UIProcess/API/Cocoa/_WKCustomHeaderFields.mm @no-unify
</del><span class="cx"> UIProcess/API/Cocoa/_WKDownload.mm
</span><span class="cx"> UIProcess/API/Cocoa/_WKElementAction.mm
</span><span class="cx"> UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.mm
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIAPICustomHeaderFieldsh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/UIProcess/API/APICustomHeaderFields.h (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/APICustomHeaderFields.h        2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/UIProcess/API/APICustomHeaderFields.h   2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -1,57 +0,0 @@
</span><del>-/*
- * Copyright (C) 2019 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 "APIObject.h"
-#include <WebCore/CustomHeaderFields.h>
-
-namespace API {
-
-class CustomHeaderFields final : public ObjectImpl<Object::Type::CustomHeaderFields> {
-public:
-    template<typename... Args> static Ref<CustomHeaderFields> create(Args&&... args)
-    {
-        return adoptRef(*new CustomHeaderFields(std::forward<Args>(args)...));
-    }
-
-    CustomHeaderFields() = default;
-
-    const Vector<WebCore::HTTPHeaderField>& fields() const { return m_fields.fields; }
-    void setFields(Vector<WebCore::HTTPHeaderField>&& fields) { m_fields.fields = WTFMove(fields); }
-
-    const Vector<WTF::String> thirdPartyDomains() const { return m_fields.thirdPartyDomains; }
-    void setThirdPartyDomains(Vector<WTF::String>&& domains) { m_fields.thirdPartyDomains = WTFMove(domains); }
-
-    const WebCore::CustomHeaderFields& coreFields() const { return m_fields; }
-
-private:
-    CustomHeaderFields(const WebCore::CustomHeaderFields& fields)
-        : m_fields(fields) { }
-
-    WebCore::CustomHeaderFields m_fields;
-};
-
-} // namespace API
</del></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIAPIWebsitePoliciescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp 2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp    2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -33,11 +33,10 @@
</span><span class="cx"> 
</span><span class="cx"> WebsitePolicies::WebsitePolicies() = default;
</span><span class="cx"> 
</span><del>-WebsitePolicies::WebsitePolicies(bool contentBlockersEnabled, OptionSet<WebKit::WebsiteAutoplayQuirk> allowedAutoplayQuirks, WebKit::WebsiteAutoplayPolicy autoplayPolicy, Vector<WebCore::HTTPHeaderField>&& legacyCustomHeaderFields, Vector<WebCore::CustomHeaderFields>&& customHeaderFields, WebKit::WebsitePopUpPolicy popUpPolicy, RefPtr<WebsiteDataStore>&& websiteDataStore)
</del><ins>+WebsitePolicies::WebsitePolicies(bool contentBlockersEnabled, OptionSet<WebKit::WebsiteAutoplayQuirk> allowedAutoplayQuirks, WebKit::WebsiteAutoplayPolicy autoplayPolicy, Vector<WebCore::HTTPHeaderField>&& customHeaderFields, WebKit::WebsitePopUpPolicy popUpPolicy, RefPtr<WebsiteDataStore>&& websiteDataStore)
</ins><span class="cx">     : m_contentBlockersEnabled(contentBlockersEnabled)
</span><span class="cx">     , m_allowedAutoplayQuirks(allowedAutoplayQuirks)
</span><span class="cx">     , m_autoplayPolicy(autoplayPolicy)
</span><del>-    , m_legacyCustomHeaderFields(WTFMove(legacyCustomHeaderFields))
</del><span class="cx">     , m_customHeaderFields(WTFMove(customHeaderFields))
</span><span class="cx">     , m_popUpPolicy(popUpPolicy)
</span><span class="cx">     , m_websiteDataStore(WTFMove(websiteDataStore))
</span><span class="lines">@@ -61,17 +60,10 @@
</span><span class="cx">     policies->setMetaViewportPolicy(m_metaViewportPolicy);
</span><span class="cx">     policies->setMediaSourcePolicy(m_mediaSourcePolicy);
</span><span class="cx">     policies->setSimulatedMouseEventsDispatchPolicy(m_simulatedMouseEventsDispatchPolicy);
</span><del>-    
-    Vector<WebCore::HTTPHeaderField> legacyCustomHeaderFields;
-    legacyCustomHeaderFields.reserveInitialCapacity(m_legacyCustomHeaderFields.size());
-    for (auto& field : m_legacyCustomHeaderFields)
-        legacyCustomHeaderFields.uncheckedAppend(field);
-    policies->setLegacyCustomHeaderFields(WTFMove(legacyCustomHeaderFields));
-
-    Vector<WebCore::CustomHeaderFields> customHeaderFields;
</del><ins>+    Vector<WebCore::HTTPHeaderField> customHeaderFields;
</ins><span class="cx">     customHeaderFields.reserveInitialCapacity(m_customHeaderFields.size());
</span><span class="cx">     for (auto& field : m_customHeaderFields)
</span><del>-        customHeaderFields.uncheckedAppend(field);
</del><ins>+        customHeaderFields.append(WebCore::HTTPHeaderField(field));
</ins><span class="cx">     policies->setCustomHeaderFields(WTFMove(customHeaderFields));
</span><span class="cx">     policies->setAllowSiteSpecificQuirksToOverrideCompatibilityMode(m_allowSiteSpecificQuirksToOverrideCompatibilityMode);
</span><span class="cx">     return policies;
</span><span class="lines">@@ -88,14 +80,6 @@
</span><span class="cx"> 
</span><span class="cx"> WebKit::WebsitePoliciesData WebsitePolicies::data()
</span><span class="cx"> {
</span><del>-    bool hasLegacyCustomHeaderFields = legacyCustomHeaderFields().size();
-    Vector<WebCore::CustomHeaderFields> customHeaderFields;
-    customHeaderFields.reserveInitialCapacity(this->customHeaderFields().size() + hasLegacyCustomHeaderFields);
-    for (auto& field : this->customHeaderFields())
-        customHeaderFields.uncheckedAppend(field);
-    if (hasLegacyCustomHeaderFields)
-        customHeaderFields.uncheckedAppend({ legacyCustomHeaderFields(), { }});
-
</del><span class="cx">     return {
</span><span class="cx">         contentBlockersEnabled(),
</span><span class="cx">         allowedAutoplayQuirks(),
</span><span class="lines">@@ -103,7 +87,7 @@
</span><span class="cx"> #if ENABLE(DEVICE_ORIENTATION)
</span><span class="cx">         deviceOrientationAndMotionAccessState(),
</span><span class="cx"> #endif
</span><del>-        WTFMove(customHeaderFields),
</del><ins>+        customHeaderFields(),
</ins><span class="cx">         popUpPolicy(),
</span><span class="cx">         m_websiteDataStore ? Optional<WebKit::WebsiteDataStoreParameters> { m_websiteDataStore->websiteDataStore().parameters() } : WTF::nullopt,
</span><span class="cx">         m_customUserAgent,
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIAPIWebsitePoliciesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.h (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.h   2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.h      2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include "WebsiteMetaViewportPolicy.h"
</span><span class="cx"> #include "WebsitePopUpPolicy.h"
</span><span class="cx"> #include "WebsiteSimulatedMouseEventsDispatchPolicy.h"
</span><del>-#include <WebCore/CustomHeaderFields.h>
</del><span class="cx"> #include <WebCore/DeviceOrientationOrMotionPermissionState.h>
</span><span class="cx"> #include <WebCore/HTTPHeaderField.h>
</span><span class="cx"> #include <wtf/OptionSet.h>
</span><span class="lines">@@ -69,12 +68,10 @@
</span><span class="cx">     void setDeviceOrientationAndMotionAccessState(WebCore::DeviceOrientationOrMotionPermissionState state) { m_deviceOrientationAndMotionAccessState = state; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    const Vector<WebCore::HTTPHeaderField>& legacyCustomHeaderFields() const { return m_legacyCustomHeaderFields; }
-    void setLegacyCustomHeaderFields(Vector<WebCore::HTTPHeaderField>&& fields) { m_legacyCustomHeaderFields = WTFMove(fields); }
</del><ins>+    const Vector<WebCore::HTTPHeaderField>& customHeaderFields() const { return m_customHeaderFields; }
+    Vector<WebCore::HTTPHeaderField>&& takeCustomHeaderFields() { return WTFMove(m_customHeaderFields); }
+    void setCustomHeaderFields(Vector<WebCore::HTTPHeaderField>&& fields) { m_customHeaderFields = WTFMove(fields); }
</ins><span class="cx"> 
</span><del>-    const Vector<WebCore::CustomHeaderFields>& customHeaderFields() const { return m_customHeaderFields; }
-    void setCustomHeaderFields(Vector<WebCore::CustomHeaderFields>&& fields) { m_customHeaderFields = WTFMove(fields); }
-
</del><span class="cx">     WebKit::WebsitePopUpPolicy popUpPolicy() const { return m_popUpPolicy; }
</span><span class="cx">     void setPopUpPolicy(WebKit::WebsitePopUpPolicy policy) { m_popUpPolicy = policy; }
</span><span class="cx"> 
</span><span class="lines">@@ -108,7 +105,7 @@
</span><span class="cx">     void setAllowSiteSpecificQuirksToOverrideCompatibilityMode(bool value) { m_allowSiteSpecificQuirksToOverrideCompatibilityMode = value; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    WebsitePolicies(bool contentBlockersEnabled, OptionSet<WebKit::WebsiteAutoplayQuirk>, WebKit::WebsiteAutoplayPolicy, Vector<WebCore::HTTPHeaderField>&&, Vector<WebCore::CustomHeaderFields>&&, WebKit::WebsitePopUpPolicy, RefPtr<WebsiteDataStore>&&);
</del><ins>+    WebsitePolicies(bool contentBlockersEnabled, OptionSet<WebKit::WebsiteAutoplayQuirk>, WebKit::WebsiteAutoplayPolicy, Vector<WebCore::HTTPHeaderField>&&, WebKit::WebsitePopUpPolicy, RefPtr<WebsiteDataStore>&&);
</ins><span class="cx"> 
</span><span class="cx">     bool m_contentBlockersEnabled { true };
</span><span class="cx">     OptionSet<WebKit::WebsiteAutoplayQuirk> m_allowedAutoplayQuirks;
</span><span class="lines">@@ -116,8 +113,7 @@
</span><span class="cx"> #if ENABLE(DEVICE_ORIENTATION)
</span><span class="cx">     WebCore::DeviceOrientationOrMotionPermissionState m_deviceOrientationAndMotionAccessState { WebCore::DeviceOrientationOrMotionPermissionState::Prompt };
</span><span class="cx"> #endif
</span><del>-    Vector<WebCore::HTTPHeaderField> m_legacyCustomHeaderFields;
-    Vector<WebCore::CustomHeaderFields> m_customHeaderFields;
</del><ins>+    Vector<WebCore::HTTPHeaderField> m_customHeaderFields;
</ins><span class="cx">     WebKit::WebsitePopUpPolicy m_popUpPolicy { WebKit::WebsitePopUpPolicy::Default };
</span><span class="cx">     RefPtr<WebsiteDataStore> m_websiteDataStore;
</span><span class="cx">     WTF::String m_customUserAgent;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICWKWebsitePoliciescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/C/WKWebsitePolicies.cpp (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/C/WKWebsitePolicies.cpp        2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/UIProcess/API/C/WKWebsitePolicies.cpp   2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> WK_EXPORT WKDictionaryRef WKWebsitePoliciesCopyCustomHeaderFields(WKWebsitePoliciesRef websitePolicies)
</span><span class="cx"> {
</span><span class="cx">     HashMap<WTF::String, RefPtr<API::Object>> fields;
</span><del>-    for (const auto& field : toImpl(websitePolicies)->legacyCustomHeaderFields())
</del><ins>+    for (const auto& field : toImpl(websitePolicies)->customHeaderFields())
</ins><span class="cx">         fields.add(field.name(), API::String::create(field.value()));
</span><span class="cx">     return toAPI(API::Dictionary::create(WTFMove(fields)).ptr());
</span><span class="cx"> }
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">         if (field && startsWithLettersIgnoringASCIICase(field->name(), "x-"))
</span><span class="cx">             fields.uncheckedAppend(WTFMove(*field));
</span><span class="cx">     }
</span><del>-    toImpl(websitePolicies)->setLegacyCustomHeaderFields(WTFMove(fields));
</del><ins>+    toImpl(websitePolicies)->setCustomHeaderFields(WTFMove(fields));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WKWebsitePoliciesSetAllowedAutoplayQuirks(WKWebsitePoliciesRef websitePolicies, WKWebsiteAutoplayQuirk allowedQuirks)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoaWKWebpagePreferencesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm  2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm     2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -26,11 +26,9 @@
</span><span class="cx"> #import "config.h"
</span><span class="cx"> #import "WKWebpagePreferences.h"
</span><span class="cx"> 
</span><del>-#import "APICustomHeaderFields.h"
</del><span class="cx"> #import "WKWebpagePreferencesInternal.h"
</span><span class="cx"> #import "WKWebsiteDataStoreInternal.h"
</span><span class="cx"> #import "WebCompatibilityMode.h"
</span><del>-#import "_WKCustomHeaderFieldsInternal.h"
</del><span class="cx"> #import "_WKWebsitePoliciesInternal.h"
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx"> 
</span><span class="lines">@@ -216,22 +214,26 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (NSArray<_WKCustomHeaderFields *> *)_customHeaderFields
</del><ins>+- (NSDictionary<NSString *, NSString *> *)_customHeaderFields
</ins><span class="cx"> {
</span><span class="cx">     const auto& fields = _websitePolicies->customHeaderFields();
</span><del>-    NSMutableArray *array = [[[NSMutableArray alloc] initWithCapacity:fields.size()] autorelease];
</del><ins>+    auto dictionary = adoptNS([[NSMutableDictionary alloc] initWithCapacity:fields.size()]);
</ins><span class="cx">     for (const auto& field : fields)
</span><del>-        [array addObject:wrapper(API::CustomHeaderFields::create(field))];
-    return array;
</del><ins>+        [dictionary setObject:field.value() forKey:field.name()];
+    return dictionary.autorelease();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_setCustomHeaderFields:(NSArray<_WKCustomHeaderFields *> *)fields
</del><ins>+- (void)_setCustomHeaderFields:(NSDictionary<NSString *, NSString *> *)fields
</ins><span class="cx"> {
</span><del>-    Vector<WebCore::CustomHeaderFields> vector;
-    vector.reserveInitialCapacity(fields.count);
-    for (_WKCustomHeaderFields *element in fields)
-        vector.uncheckedAppend(static_cast<API::CustomHeaderFields&>([element _apiObject]).coreFields());
-    _websitePolicies->setCustomHeaderFields(WTFMove(vector));
</del><ins>+    Vector<WebCore::HTTPHeaderField> parsedFields;
+    parsedFields.reserveInitialCapacity(fields.count);
+
+    for (NSString *name in fields) {
+        auto field = WebCore::HTTPHeaderField::create(name, [fields objectForKey:name]);
+        if (field && startsWithLettersIgnoringASCIICase(field->name(), "x-"))
+            parsedFields.uncheckedAppend(WTFMove(*field));
+    }
+    _websitePolicies->setCustomHeaderFields(WTFMove(parsedFields));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (WKWebsiteDataStore *)_websiteDataStore
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoaWKWebpagePreferencesPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h    2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h       2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -55,14 +55,12 @@
</span><span class="cx">     _WKWebsiteDeviceOrientationAndMotionAccessPolicyDeny,
</span><span class="cx"> } WK_API_AVAILABLE(macos(10.14), ios(12.0));
</span><span class="cx"> 
</span><del>-@class _WKCustomHeaderFields;
-
</del><span class="cx"> @interface WKWebpagePreferences (WKPrivate)
</span><span class="cx"> 
</span><span class="cx"> @property (nonatomic, setter=_setContentBlockersEnabled:) BOOL _contentBlockersEnabled;
</span><span class="cx"> @property (nonatomic, setter=_setAllowedAutoplayQuirks:) _WKWebsiteAutoplayQuirk _allowedAutoplayQuirks;
</span><span class="cx"> @property (nonatomic, setter=_setAutoplayPolicy:) _WKWebsiteAutoplayPolicy _autoplayPolicy;
</span><del>-@property (nonatomic, copy, setter=_setCustomHeaderFields:) NSArray<_WKCustomHeaderFields *> *_customHeaderFields;
</del><ins>+@property (nonatomic, copy, setter=_setCustomHeaderFields:) NSDictionary<NSString *, NSString *> *_customHeaderFields;
</ins><span class="cx"> @property (nonatomic, setter=_setPopUpPolicy:) _WKWebsitePopUpPolicy _popUpPolicy;
</span><span class="cx"> @property (nonatomic, strong, setter=_setWebsiteDataStore:) WKWebsiteDataStore *_websiteDataStore;
</span><span class="cx"> @property (nonatomic, copy, setter=_setCustomUserAgent:) NSString *_customUserAgent;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoa_WKCustomHeaderFieldsh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFields.h (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFields.h  2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFields.h     2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -1,38 +0,0 @@
</span><del>-/*
- * Copyright (C) 2019 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>
-
-NS_ASSUME_NONNULL_BEGIN
-
-WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
-@interface _WKCustomHeaderFields : NSObject
-
-@property (nonatomic, copy) NSDictionary<NSString *, NSString *> *fields;
-@property (nonatomic, copy) NSArray<NSString *> *thirdPartyDomains;
-
-@end
-
-NS_ASSUME_NONNULL_END
</del></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoa_WKCustomHeaderFieldsmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFields.mm (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFields.mm 2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFields.mm    2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -1,92 +0,0 @@
</span><del>-/*
- * Copyright (C) 2019 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 "_WKCustomHeaderFields.h"
-
-#import "_WKCustomHeaderFieldsInternal.h"
-#import <wtf/BlockPtr.h>
-
-@implementation _WKCustomHeaderFields
-
-- (instancetype)init
-{
-    if (!(self = [super init]))
-        return nil;
-    
-    API::Object::constructInWrapper<API::CustomHeaderFields>(self);
-    return self;
-}
-
-- (void)dealloc
-{
-    _fields->API::CustomHeaderFields::~CustomHeaderFields();
-    [super dealloc];
-}
-
-- (NSDictionary<NSString *, NSString *> *)fields
-{
-    auto& vector = _fields->fields();
-    NSMutableDictionary<NSString *, NSString *> *dictionary = [NSMutableDictionary dictionaryWithCapacity:vector.size()];
-    for (auto& field : vector)
-        [dictionary setObject:field.value() forKey:field.name()];
-    return dictionary;
-}
-
-- (void)setFields:(NSDictionary<NSString *, NSString *> *)fields
-{
-    Vector<WebCore::HTTPHeaderField> vector;
-    vector.reserveInitialCapacity(fields.count);
-    [fields enumerateKeysAndObjectsUsingBlock:makeBlockPtr([&](id key, id value, BOOL* stop) {
-        if (auto field = WebCore::HTTPHeaderField::create((NSString *)key, (NSString *)value); field && startsWithLettersIgnoringASCIICase(field->name(), "x-"))
-            vector.uncheckedAppend(WTFMove(*field));
-    }).get()];
-    _fields->setFields(WTFMove(vector));
-}
-
-- (NSArray<NSString *> *)thirdPartyDomains
-{
-    auto& domains = _fields->thirdPartyDomains();
-    NSMutableArray *array = [NSMutableArray arrayWithCapacity:domains.size()];
-    for (auto& domain : domains)
-        [array addObject:domain];
-    return array;
-}
-
-- (void)setThirdPartyDomains:(NSArray<NSString *> *)thirdPartyDomains
-{
-    Vector<String> domains;
-    domains.reserveInitialCapacity(thirdPartyDomains.count);
-    for (NSString *domain in thirdPartyDomains)
-        domains.uncheckedAppend(domain);
-    _fields->setThirdPartyDomains(WTFMove(domains));
-}
-
-- (API::Object&)_apiObject
-{
-    return *_fields;
-}
-
-@end
</del></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoa_WKCustomHeaderFieldsInternalh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h  2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h     2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-/*
- * Copyright (C) 2019 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 "APICustomHeaderFields.h"
-#import "WKObject.h"
-#import "_WKCustomHeaderFields.h"
-
-namespace WebKit {
-
-template<> struct WrapperTraits<API::CustomHeaderFields> {
-    using WrapperClass = _WKCustomHeaderFields;
-};
-
-}
-
-@interface _WKCustomHeaderFields () <WKObject> {
-@package
-    API::ObjectStorage<API::CustomHeaderFields> _fields;
-}
-@end
</del></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoa_WKWebsitePoliciesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.h (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.h     2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.h        2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> @property (nonatomic) BOOL contentBlockersEnabled;
</span><span class="cx"> @property (nonatomic) _WKWebsiteAutoplayQuirk allowedAutoplayQuirks WK_API_AVAILABLE(macos(10.13), ios(11.0));
</span><span class="cx"> @property (nonatomic) _WKWebsiteAutoplayPolicy autoplayPolicy WK_API_AVAILABLE(macos(10.13), ios(11.0));
</span><ins>+@property (nonatomic, copy) NSDictionary<NSString *, NSString *> *customHeaderFields WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
</ins><span class="cx"> @property (nonatomic) _WKWebsitePopUpPolicy popUpPolicy WK_API_AVAILABLE(macos(10.14), ios(12.0));
</span><span class="cx"> @property (nonatomic, strong) WKWebsiteDataStore *websiteDataStore WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
</span><span class="cx"> @property (nonatomic, copy) NSString *customUserAgent WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoa_WKWebsitePoliciesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm    2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm       2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -95,6 +95,16 @@
</span><span class="cx">     return [_webpagePreferences _popUpPolicy];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (NSDictionary<NSString *, NSString *> *)customHeaderFields
+{
+    return [_webpagePreferences _customHeaderFields];
+}
+
+- (void)setCustomHeaderFields:(NSDictionary<NSString *, NSString *> *)fields
+{
+    [_webpagePreferences _setCustomHeaderFields:fields];
+}
+
</ins><span class="cx"> - (WKWebsiteDataStore *)websiteDataStore
</span><span class="cx"> {
</span><span class="cx">     return [_webpagePreferences _websiteDataStore];
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj     2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -1077,7 +1077,6 @@
</span><span class="cx">          5C5CEC33220912B300D6BBB0 /* AuxiliaryProcessMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C5CEC31220912AF00D6BBB0 /* AuxiliaryProcessMain.cpp */; };
</span><span class="cx">          5C5CEC34220912B400D6BBB0 /* AuxiliaryProcessMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C5CEC31220912AF00D6BBB0 /* AuxiliaryProcessMain.cpp */; };
</span><span class="cx">          5C5CEC35220912B400D6BBB0 /* AuxiliaryProcessMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C5CEC31220912AF00D6BBB0 /* AuxiliaryProcessMain.cpp */; };
</span><del>-               5C5D238C227A2CDA000B9BDA /* _WKCustomHeaderFields.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C5D2389227A1892000B9BDA /* _WKCustomHeaderFields.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">           5C62FDF91EFC271C00CE072E /* WKURLSchemeTaskPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C62FDF81EFC263C00CE072E /* WKURLSchemeTaskPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5C7FB47021E97DC5009E3241 /* WebCookieJar.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7FB46F21E97C0C009E3241 /* WebCookieJar.h */; };
</span><span class="cx">          5C8BC797218CBB4800813886 /* SafeBrowsing.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5C8BC796218CB58A00813886 /* SafeBrowsing.xcassets */; };
</span><span class="lines">@@ -1092,7 +1091,6 @@
</span><span class="cx">          5CB2378C1DF0DE6E00117AA3 /* _WKWebsitePolicies.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CB237891DF0DD4300117AA3 /* _WKWebsitePolicies.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5CB2378E1DF0E0D300117AA3 /* _WKWebsitePoliciesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CB2378D1DF0E0C200117AA3 /* _WKWebsitePoliciesInternal.h */; };
</span><span class="cx">          5CBC9B8E1C652CA000A8FDCF /* NetworkDataTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CBC9B891C6524A500A8FDCF /* NetworkDataTask.h */; };
</span><del>-               5CBD595C2280EDF4002B22AA /* _WKCustomHeaderFields.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D2388227A1892000B9BDA /* _WKCustomHeaderFields.mm */; };
</del><span class="cx">           5CD286511E7235990094FDC8 /* WKContentRuleListStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CD2864D1E722F440094FDC8 /* WKContentRuleListStore.h */; settings = {ATTRIBUTES = (Public, ); }; };
</span><span class="cx">          5CD286531E7235AA0094FDC8 /* _WKUserContentFilterPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CD286491E722F440094FDC8 /* _WKUserContentFilterPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5CD286541E7235B10094FDC8 /* WKContentRuleList.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CD2864A1E722F440094FDC8 /* WKContentRuleList.h */; settings = {ATTRIBUTES = (Public, ); }; };
</span><span class="lines">@@ -3526,10 +3524,6 @@
</span><span class="cx">          5C5CEC31220912AF00D6BBB0 /* AuxiliaryProcessMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AuxiliaryProcessMain.cpp; path = Cocoa/AuxiliaryProcessMain.cpp; sourceTree = "<group>"; };
</span><span class="cx">          5C5CEC382209583200D6BBB0 /* DaemonEntryPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DaemonEntryPoint.h; sourceTree = "<group>"; };
</span><span class="cx">          5C5CEC392209583200D6BBB0 /* DaemonEntryPoint.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DaemonEntryPoint.mm; sourceTree = "<group>"; };
</span><del>-               5C5D2387227A1891000B9BDA /* _WKCustomHeaderFieldsInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKCustomHeaderFieldsInternal.h; sourceTree = "<group>"; };
-               5C5D2388227A1892000B9BDA /* _WKCustomHeaderFields.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKCustomHeaderFields.mm; sourceTree = "<group>"; };
-               5C5D2389227A1892000B9BDA /* _WKCustomHeaderFields.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKCustomHeaderFields.h; sourceTree = "<group>"; };
-               5C5D238A227A1D9B000B9BDA /* APICustomHeaderFields.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APICustomHeaderFields.h; sourceTree = "<group>"; };
</del><span class="cx">           5C62FDF81EFC263C00CE072E /* WKURLSchemeTaskPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKURLSchemeTaskPrivate.h; sourceTree = "<group>"; };
</span><span class="cx">          5C6CE6D01F59BC460007C6CB /* PageClientImplCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageClientImplCocoa.mm; sourceTree = "<group>"; };
</span><span class="cx">          5C6CE6D31F59EA350007C6CB /* PageClientImplCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageClientImplCocoa.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -6138,9 +6132,6 @@
</span><span class="cx">                          5C4609E422430E4D009943C2 /* _WKContentRuleListActionInternal.h */,
</span><span class="cx">                          1A5704F61BE01FF400874AF1 /* _WKContextMenuElementInfo.h */,
</span><span class="cx">                          1A5704F51BE01FF400874AF1 /* _WKContextMenuElementInfo.mm */,
</span><del>-                               5C5D2389227A1892000B9BDA /* _WKCustomHeaderFields.h */,
-                               5C5D2388227A1892000B9BDA /* _WKCustomHeaderFields.mm */,
-                               5C5D2387227A1891000B9BDA /* _WKCustomHeaderFieldsInternal.h */,
</del><span class="cx">                           83891B681A68BEBC0030F386 /* _WKDiagnosticLoggingDelegate.h */,
</span><span class="cx">                          A1A4FE5718DCE9FA00B5EA8A /* _WKDownload.h */,
</span><span class="cx">                          A1A4FE5818DCE9FA00B5EA8A /* _WKDownload.mm */,
</span><span class="lines">@@ -7703,7 +7694,6 @@
</span><span class="cx">                          7C3A06A51AAB903E009D74BA /* APIContentRuleListStore.cpp */,
</span><span class="cx">                          7C3A06A61AAB903E009D74BA /* APIContentRuleListStore.h */,
</span><span class="cx">                          076E884D1A13CADF005E90FC /* APIContextMenuClient.h */,
</span><del>-                               5C5D238A227A1D9B000B9BDA /* APICustomHeaderFields.h */,
</del><span class="cx">                           7A821F4F1E2F7A5C00604577 /* APICustomProtocolManagerClient.h */,
</span><span class="cx">                          83891B621A68B3420030F386 /* APIDiagnosticLoggingClient.h */,
</span><span class="cx">                          1F7D36C018DA513F00D9D659 /* APIDownloadClient.h */,
</span><span class="lines">@@ -9015,7 +9005,6 @@
</span><span class="cx">                          5C4609E7224317B4009943C2 /* _WKContentRuleListAction.h in Headers */,
</span><span class="cx">                          5C4609E8224317BB009943C2 /* _WKContentRuleListActionInternal.h in Headers */,
</span><span class="cx">                          1A5704F81BE01FF400874AF1 /* _WKContextMenuElementInfo.h in Headers */,
</span><del>-                               5C5D238C227A2CDA000B9BDA /* _WKCustomHeaderFields.h in Headers */,
</del><span class="cx">                           83891B691A68BEBC0030F386 /* _WKDiagnosticLoggingDelegate.h in Headers */,
</span><span class="cx">                          A1A4FE5A18DCE9FA00B5EA8A /* _WKDownload.h in Headers */,
</span><span class="cx">                          A1A4FE6118DD54A400B5EA8A /* _WKDownloadDelegate.h in Headers */,
</span><span class="lines">@@ -10952,7 +10941,6 @@
</span><span class="cx">                  isa = PBXSourcesBuildPhase;
</span><span class="cx">                  buildActionMask = 2147483647;
</span><span class="cx">                  files = (
</span><del>-                               5CBD595C2280EDF4002B22AA /* _WKCustomHeaderFields.mm in Sources */,
</del><span class="cx">                           99E7189A21F79D9E0055E975 /* _WKTouchEventGenerator.mm in Sources */,
</span><span class="cx">                          2D92A784212B6AB100F493FD /* ActivityAssertion.cpp in Sources */,
</span><span class="cx">                          2D92A77B212B6A7100F493FD /* ArgumentCoders.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Tools/ChangeLog       2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r245038.
+
+        Breaks internal builds.
+
+        Reverted changeset:
+
+        "Add SPI to set a list of hosts to which to send custom header
+        fields cross-origin"
+        https://bugs.webkit.org/show_bug.cgi?id=197397
+        https://trac.webkit.org/changeset/245038
+
</ins><span class="cx"> 2019-05-07  Joonghun Park  <pjh0718@gmail.com>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed. Add myself as a committer.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitCocoaWebsitePoliciesmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm (245043 => 245044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm   2019-05-07 23:43:18 UTC (rev 245043)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm      2019-05-07 23:44:52 UTC (rev 245044)
</span><span class="lines">@@ -28,12 +28,10 @@
</span><span class="cx"> #import "PlatformUtilities.h"
</span><span class="cx"> #import "TestNavigationDelegate.h"
</span><span class="cx"> #import "TestWKWebView.h"
</span><del>-#import <WebKit/WKMutableDictionary.h>
</del><span class="cx"> #import <WebKit/WKNavigationDelegatePrivate.h>
</span><span class="cx"> #import <WebKit/WKPagePrivate.h>
</span><span class="cx"> #import <WebKit/WKPreferencesPrivate.h>
</span><span class="cx"> #import <WebKit/WKPreferencesRefPrivate.h>
</span><del>-#import <WebKit/WKString.h>
</del><span class="cx"> #import <WebKit/WKUIDelegatePrivate.h>
</span><span class="cx"> #import <WebKit/WKURLSchemeTaskPrivate.h>
</span><span class="cx"> #import <WebKit/WKUserContentControllerPrivate.h>
</span><span class="lines">@@ -40,7 +38,6 @@
</span><span class="cx"> #import <WebKit/WKWebViewPrivate.h>
</span><span class="cx"> #import <WebKit/WKWebsiteDataStorePrivate.h>
</span><span class="cx"> #import <WebKit/WKWebsitePolicies.h>
</span><del>-#import <WebKit/_WKCustomHeaderFields.h>
</del><span class="cx"> #import <WebKit/_WKUserContentExtensionStorePrivate.h>
</span><span class="cx"> #import <WebKit/_WKWebsiteDataStoreConfiguration.h>
</span><span class="cx"> #import <WebKit/_WKWebsitePolicies.h>
</span><span class="lines">@@ -910,9 +907,9 @@
</span><span class="cx"> 
</span><span class="cx"> TEST(WebKit, InvalidCustomHeaders)
</span><span class="cx"> {
</span><del>-    auto customHeaderFields = adoptNS([[_WKCustomHeaderFields alloc] init]);
-    [customHeaderFields setFields:@{@"invalidheader" : @"", @"noncustom" : @"header", @"    x-Custom ":@"  Needs Canonicalization\t ", @"x-other" : @"other value"}];
-    NSDictionary<NSString *, NSString *> *canonicalized = [customHeaderFields fields];
</del><ins>+    auto websitePolicies = adoptNS([[_WKWebsitePolicies alloc] init]);
+    [websitePolicies setCustomHeaderFields:@{@"invalidheader" : @"", @"noncustom" : @"header", @"    x-Custom ":@"  Needs Canonicalization\t ", @"x-other" : @"other value"}];
+    NSDictionary<NSString *, NSString *> *canonicalized = [websitePolicies customHeaderFields];
</ins><span class="cx">     EXPECT_EQ(canonicalized.count, 2u);
</span><span class="cx">     EXPECT_STREQ([canonicalized objectForKey:@"x-Custom"].UTF8String, "Needs Canonicalization");
</span><span class="cx">     EXPECT_STREQ([canonicalized objectForKey:@"x-other"].UTF8String, "other value");
</span><span class="lines">@@ -922,9 +919,8 @@
</span><span class="cx"> static bool secondTestDone;
</span><span class="cx"> static bool thirdTestDone;
</span><span class="cx"> static bool fourthTestDone;
</span><del>-static bool fifthTestDone;
</del><span class="cx"> 
</span><del>-static void expectLegacyHeaders(id <WKURLSchemeTask> task, bool expected)
</del><ins>+static void expectHeaders(id <WKURLSchemeTask> task, bool expected)
</ins><span class="cx"> {
</span><span class="cx">     NSURLRequest *request = task.request;
</span><span class="cx">     if (expected) {
</span><span class="lines">@@ -936,18 +932,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void expectHeaders(id <WKURLSchemeTask> task, bool expected)
-{
-    NSURLRequest *request = task.request;
-    if (expected) {
-        EXPECT_STREQ([[request valueForHTTPHeaderField:@"X-key3"] UTF8String], "value3");
-        EXPECT_STREQ([[request valueForHTTPHeaderField:@"X-key4"] UTF8String], "value4");
-    } else {
-        EXPECT_TRUE([request valueForHTTPHeaderField:@"X-key3"] == nil);
-        EXPECT_TRUE([request valueForHTTPHeaderField:@"X-key4"] == nil);
-    }
-}
-
</del><span class="cx"> static void respond(id <WKURLSchemeTask>task, NSString *html = nil)
</span><span class="cx"> {
</span><span class="cx">     [task didReceiveResponse:[[[NSURLResponse alloc] initWithURL:task.request.URL MIMEType:@"text/html" expectedContentLength:html.length textEncodingName:nil] autorelease]];
</span><span class="lines">@@ -960,29 +944,18 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation CustomHeaderFieldsDelegate
</span><span class="cx"> 
</span><del>-- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction preferences:(WKWebpagePreferences *)preferences decisionHandler:(void (^)(WKNavigationActionPolicy, WKWebpagePreferences *))decisionHandler
</del><ins>+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
+- (void)_webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy, _WKWebsitePolicies *))decisionHandler
+IGNORE_WARNINGS_END
</ins><span class="cx"> {
</span><del>-    auto legacyHeaderFieldDictionary = adoptWK(WKMutableDictionaryCreate());
-    WKDictionarySetItem(legacyHeaderFieldDictionary.get(), adoptWK(WKStringCreateWithUTF8CString("X-key1")).get(), adoptWK(WKStringCreateWithUTF8CString("value1")).get());
-    WKDictionarySetItem(legacyHeaderFieldDictionary.get(), adoptWK(WKStringCreateWithUTF8CString("X-key2")).get(), adoptWK(WKStringCreateWithUTF8CString("value2")).get());
-    WKWebsitePoliciesSetCustomHeaderFields((WKWebsitePoliciesRef)preferences, legacyHeaderFieldDictionary.get());
-
-    _WKCustomHeaderFields *headerFields = [[[_WKCustomHeaderFields alloc] init] autorelease];
-    [headerFields setFields:@{@"X-key3": @"value3", @"X-key4": @"value4"}];
-    [headerFields setThirdPartyDomains:@[
-        @"*.hostwithasterisk.com",
-        @"hostwithoutasterisk.com",
-        @"*.com" // should be ignored.
-    ]];
-    
-    [preferences _setCustomHeaderFields:@[headerFields]];
-    
</del><ins>+    _WKWebsitePolicies *websitePolicies = [[[_WKWebsitePolicies alloc] init] autorelease];
+    [websitePolicies setCustomHeaderFields:@{@"X-key1": @"value1", @"X-key2": @"value2"}];
</ins><span class="cx">     if ([navigationAction.request.URL.path isEqualToString:@"/mainresource"]) {
</span><span class="cx">         dispatch_async(dispatch_get_main_queue(), ^{
</span><del>-            decisionHandler(WKNavigationActionPolicyAllow, preferences);
</del><ins>+            decisionHandler(WKNavigationActionPolicyAllow, websitePolicies);
</ins><span class="cx">         });
</span><span class="cx">     } else
</span><del>-        decisionHandler(WKNavigationActionPolicyAllow, preferences);
</del><ins>+        decisionHandler(WKNavigationActionPolicyAllow, websitePolicies);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask
</span><span class="lines">@@ -989,63 +962,43 @@
</span><span class="cx"> {
</span><span class="cx">     NSString *path = urlSchemeTask.request.URL.path;
</span><span class="cx">     if ([path isEqualToString:@"/mainresource"]) {
</span><del>-        expectLegacyHeaders(urlSchemeTask, true);
</del><ins>+        expectHeaders(urlSchemeTask, true);
</ins><span class="cx">         respond(urlSchemeTask, @"<script>fetch('subresource').then(function(response){fetch('test://differentsecurityorigin/crossoriginsubresource',{mode:'no-cors'})})</script>");
</span><span class="cx">     } else if ([path isEqualToString:@"/subresource"]) {
</span><del>-        expectLegacyHeaders(urlSchemeTask, true);
</del><ins>+        expectHeaders(urlSchemeTask, true);
</ins><span class="cx">         respond(urlSchemeTask);
</span><span class="cx">     } else if ([path isEqualToString:@"/crossoriginsubresource"]) {
</span><del>-        expectLegacyHeaders(urlSchemeTask, false);
</del><ins>+        expectHeaders(urlSchemeTask, false);
</ins><span class="cx">         respond(urlSchemeTask);
</span><span class="cx">         firstTestDone = true;
</span><span class="cx">     } else if ([path isEqualToString:@"/mainresourcewithiframe"]) {
</span><del>-        expectLegacyHeaders(urlSchemeTask, true);
</del><ins>+        expectHeaders(urlSchemeTask, true);
</ins><span class="cx">         respond(urlSchemeTask, @"<iframe src='test://iframeorigin/iframemainresource'></iframe>");
</span><span class="cx">     } else if ([path isEqualToString:@"/iframemainresource"]) {
</span><del>-        expectLegacyHeaders(urlSchemeTask, false);
</del><ins>+        expectHeaders(urlSchemeTask, false);
</ins><span class="cx">         respond(urlSchemeTask, @"<script>fetch('iframesubresource').then(function(response){fetch('test://mainframeorigin/originaloriginsubresource',{mode:'no-cors'})})</script>");
</span><span class="cx">     } else if ([path isEqualToString:@"/iframesubresource"]) {
</span><del>-        expectLegacyHeaders(urlSchemeTask, false);
</del><ins>+        expectHeaders(urlSchemeTask, false);
</ins><span class="cx">         respond(urlSchemeTask);
</span><span class="cx">     } else if ([path isEqualToString:@"/originaloriginsubresource"]) {
</span><del>-        expectLegacyHeaders(urlSchemeTask, false);
</del><ins>+        expectHeaders(urlSchemeTask, false);
</ins><span class="cx">         respond(urlSchemeTask);
</span><span class="cx">         secondTestDone = true;
</span><span class="cx">     } else if ([path isEqualToString:@"/nestedtop"]) {
</span><del>-        expectLegacyHeaders(urlSchemeTask, true);
</del><ins>+        expectHeaders(urlSchemeTask, true);
</ins><span class="cx">         respond(urlSchemeTask, @"<iframe src='test://otherorigin/nestedmid'></iframe>");
</span><span class="cx">     } else if ([path isEqualToString:@"/nestedmid"]) {
</span><del>-        expectLegacyHeaders(urlSchemeTask, false);
</del><ins>+        expectHeaders(urlSchemeTask, false);
</ins><span class="cx">         respond(urlSchemeTask, @"<iframe src='test://toporigin/nestedbottom'></iframe>");
</span><span class="cx">     } else if ([path isEqualToString:@"/nestedbottom"]) {
</span><del>-        expectLegacyHeaders(urlSchemeTask, true);
</del><ins>+        expectHeaders(urlSchemeTask, true);
</ins><span class="cx">         respond(urlSchemeTask);
</span><span class="cx">         thirdTestDone = true;
</span><span class="cx">     } else if ([path isEqualToString:@"/requestfromaboutblank"]) {
</span><del>-        expectLegacyHeaders(urlSchemeTask, true);
</del><ins>+        expectHeaders(urlSchemeTask, true);
</ins><span class="cx">         respond(urlSchemeTask);
</span><span class="cx">         fourthTestDone = true;
</span><del>-    } else if ([path isEqualToString:@"/testcustomheaderfieldhosts"]) {
-        expectHeaders(urlSchemeTask, true);
-        NSString *html = @"<script>fetch('test://a.b.c.sub.hostwithasterisk.com/hosttest1',{mode:'no-cors'})"
-            ".then(function(response){fetch('test://subhostwithasterisk.com/hosttest2',{mode:'no-cors'})})"
-            ".then(function(response){fetch('test://hostwithoutasterisk.com/hosttest3',{mode:'no-cors'})})"
-            ".then(function(response){fetch('test://a.b.c.sub.hostwithoutasterisk.com/hosttest4',{mode:'no-cors'})})</script>";
-        respond(urlSchemeTask, html);
-    } else if ([path isEqualToString:@"/hosttest1"]) {
-        expectHeaders(urlSchemeTask, true);
-        respond(urlSchemeTask);
-    } else if ([path isEqualToString:@"/hosttest2"]) {
-        expectHeaders(urlSchemeTask, false);
-        respond(urlSchemeTask);
-    } else if ([path isEqualToString:@"/hosttest3"]) {
-        expectHeaders(urlSchemeTask, true);
-        respond(urlSchemeTask);
-    } else if ([path isEqualToString:@"/hosttest4"]) {
-        expectHeaders(urlSchemeTask, false);
-        respond(urlSchemeTask);
-        fifthTestDone = true;
-    } else if ([path isEqualToString:@"/testcustomheaderfieldhosts"])
</del><ins>+    } else
</ins><span class="cx">         EXPECT_TRUE(false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1070,9 +1023,6 @@
</span><span class="cx"> 
</span><span class="cx">     [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"test://toporigin/nestedtop"]]];
</span><span class="cx">     TestWebKitAPI::Util::run(&thirdTestDone);
</span><del>-
-    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"test://host/testcustomheaderfieldhosts"]]];
-    TestWebKitAPI::Util::run(&fifthTestDone);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static unsigned loadCount;
</span></span></pre>
</div>
</div>

</body>
</html>