<!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>[190766] branches/safari-601-branch</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/190766">190766</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2015-10-08 18:33:05 -0700 (Thu, 08 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/188150">r188150</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/188517">r188517</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/188844">r188844</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/188845">r188845</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/188851">r188851</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/188852">r188852</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/188880">r188880</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/188881">r188881</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/188988">r188988</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/189193">r189193</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/189289">r189289</a>, and <a href="http://trac.webkit.org/projects/webkit/changeset/190133">r190133</a>.

Source/WebCore:

    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;

    [Content Filtering] Determine navigation and content policy before continuing to filter a load
    https://bugs.webkit.org/show_bug.cgi?id=148506

    Reviewed by Brady Eidson.

    Prior to this change, ContentFilter would hide from DocumentLoader all CachedRawResourceClient callbacks until
    a decision was made, then replay the missed callbacks. This approach interacted poorly with some features of
    the loader, notably appcache and downloads. In the case of appcache, DocumentLoader might not have a chance to
    check for substitute data until the original load has finished, wasting bandwidth, and might receive duplicate
    or out-of-order callbacks. In the case of downloads, it would often be too late to convert the existing
    connection to a download, leading to restarted downloads or outright failures.

    Bandaids were put in place for these issues in <a href="http://trac.webkit.org/projects/webkit/changeset/188150">r188150</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/188486">r188486</a>, and <a href="http://trac.webkit.org/projects/webkit/changeset/188851">r188851</a> to fix crashes or serious
    regressions in behavior, but these weren't complete fixes. They did not solve any of the duplicate data loading
    problems, and they did not make downloads work reliably in all cases.

    This patch rolls out the bandaids (but keeps their tests) and replaces them with a more robust fix. Instead of
    hiding callbacks from DocumentLoader, ContentFilter now delivers willSendRequest(), redirectReceived(), and
    responseReceived() to DocumentLoader immediately, and cancels filtering if DocumentLoader decides to ignore the
    load, download it, or load substitute data. ContentFilter continues to buffer incoming data to prevent partial
    rendering of blocked content.

    The existing tests for <a href="http://trac.webkit.org/projects/webkit/changeset/188150">r188150</a> and <a href="http://trac.webkit.org/projects/webkit/changeset/188851">r188851</a> were kept, the test for <a href="http://trac.webkit.org/projects/webkit/changeset/188486">r188486</a> was rewritten to be specific to
    content filtering, and new tests were added to cover the case where ContentFilter is still undecided after a
    load finishes.

    Tests: contentfiltering/allow-never.html
           contentfiltering/block-never.html
           ContentFiltering.AllowDownloadAfterAddData
           ContentFiltering.AllowDownloadAfterFinishedAddingData
           ContentFiltering.AllowDownloadAfterRedirect
           ContentFiltering.AllowDownloadAfterResponse
           ContentFiltering.AllowDownloadAfterWillSendRequest
           ContentFiltering.AllowDownloadNever
           ContentFiltering.BlockDownloadAfterAddData
           ContentFiltering.BlockDownloadAfterFinishedAddingData
           ContentFiltering.BlockDownloadAfterRedirect
           ContentFiltering.BlockDownloadAfterResponse
           ContentFiltering.BlockDownloadAfterWillSendRequest
           ContentFiltering.BlockDownloadNever

    * bindings/js/JSMockContentFilterSettingsCustom.cpp:
    (WebCore::JSMockContentFilterSettings::decisionPoint): Taught to handle DecisionPoint::Never, and rewrote to
    not need a set of const uint8_ts that mirror the DecisionPoint enum.
    (WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
    (WebCore::toJSValue): Rewrote to not need a set of const uint8_ts that mirror the Decision enum.
    (WebCore::toDecision): Ditto.
    * loader/ContentFilter.cpp:
    (WebCore::ContentFilter::createIfEnabled): Renamed from createIfNeeded, and changed to take a DocumentLoader&amp;
    instead of a DecisionFunction.
    (WebCore::ContentFilter::ContentFilter):
    (WebCore::ContentFilter::responseReceived): If m_state != Blocked after filtering, call DocumentLoader::responseReceived().
    (WebCore::ContentFilter::dataReceived): If m_state == Allowed after filtering, deliver buffered data to DocumentLoader.
    If no filtering was necessary, call DocumentLoader::dataReceived() directly.
    (WebCore::ContentFilter::redirectReceived): If m_state != Blocked after filtering, call DocumentLoader::redirectReceived().
    (WebCore::ContentFilter::notifyFinished): If an error occured, call DocumentLoader::notifyFinished() immediately and return.
    If m_state != Blocked after filtering, deliver buffered data to DocumentLoader and call DocumentLoader::notifyFinished().
    If no filtering was necessary and m_state != Blocked, call DocumentLoader::notifyFinished() directly.
    (WebCore::ContentFilter::didDecide): Called DocumentLoader::contentFilterDidDecide() instead of m_decisionFunction().
    (WebCore::ContentFilter::deliverResourceData): Added a helper function to deliver buffered data to DocumentLoader.
    (WebCore::ContentFilter::createIfNeeded): Renamed to createIfEnabled().
    * loader/ContentFilter.h:
    * loader/DocumentLoader.cpp:
    (WebCore::DocumentLoader::DocumentLoader):
    (WebCore::DocumentLoader::willSendRequest): Stopped asserting that redirectResponse is null and made it part of
    the if condition instead, since willSendRequest() will now be called on redirects when there is an active ContentFilter.
    (WebCore::DocumentLoader::startLoadingMainResource): Called becomeMainResourceClient() instead of becomeMainResourceClientIfFilterAllows().
    (WebCore::DocumentLoader::becomeMainResourceClient): Renamed from becomeMainResourceClientIfFilterAllows().
    Only called ContentFilter::startFilteringMainResource() if the filter state is Initialized, since ContentFilter
    might have already made a decision in willSendRequest().
    (WebCore::DocumentLoader::contentFilterDidDecide): Stopped deleting m_contentFilter, since it will continue to deliver callbacks
    even after making a decision. Fixed a bug where we were creating two copies of ContentFilter's replacement data.
    (WebCore::DocumentLoader::syntheticRedirectReceived): Deleted.
    (WebCore::DocumentLoader::becomeMainResourceClientIfFilterAllows): Renamed to becomeMainResourceClient().
    * loader/DocumentLoader.h:
    * loader/EmptyClients.h:
    * loader/FrameLoaderClient.h:
    * loader/ResourceLoader.cpp:
    (WebCore::ResourceLoader::willSendRequestInternal): Removed part of <a href="http://trac.webkit.org/projects/webkit/changeset/188851">r188851</a>.
    * loader/SubresourceLoader.cpp:
    (WebCore::SubresourceLoader::didReceiveResponse): Removed part of <a href="http://trac.webkit.org/projects/webkit/changeset/188486">r188486</a>.
    * loader/SubresourceLoader.h:
    * loader/cache/CachedRawResource.cpp:
    (WebCore::CachedRawResource::didAddClient): Removed part of <a href="http://trac.webkit.org/projects/webkit/changeset/188150">r188150</a>.
    * loader/cache/CachedRawResourceClient.h:
    (WebCore::CachedRawResourceClient::syntheticRedirectReceived): Removed part of <a href="http://trac.webkit.org/projects/webkit/changeset/188150">r188150</a>.
    * testing/MockContentFilterSettings.h: Defined DecisionPoint::Never.
    * testing/MockContentFilterSettings.idl: Defined DECISION_POINT_NEVER.

Source/WebKit/mac:

    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;

    [Content Filtering] Determine navigation and content policy before continuing to filter a load
    https://bugs.webkit.org/show_bug.cgi?id=148506

    Reviewed by Brady Eidson.

    Deleted parts of <a href="http://trac.webkit.org/projects/webkit/changeset/188486">r188486</a> and <a href="http://trac.webkit.org/projects/webkit/changeset/188851">r188851</a>.

    * WebCoreSupport/WebFrameLoaderClient.h:
    * WebCoreSupport/WebFrameLoaderClient.mm:
    (WebFrameLoaderClient::convertMainResourceLoadToDownload):
    (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):

Source/WebKit2:

    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;

    [Content Filtering] Determine navigation and content policy before continuing to filter a load
    https://bugs.webkit.org/show_bug.cgi?id=148506

    Reviewed by Brady Eidson.

    Deleted parts of <a href="http://trac.webkit.org/projects/webkit/changeset/188486">r188486</a> and <a href="http://trac.webkit.org/projects/webkit/changeset/188851">r188851</a>.

    * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
    (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
    * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
    * WebProcess/WebPage/WebFrame.cpp:
    (WebKit::WebFrame::convertMainResourceLoadToDownload):

    2015-08-11  Andy Estes  &lt;aestes@apple.com&gt;

    [Cocoa] Add redirect support to CustomProtocolManager
    https://bugs.webkit.org/show_bug.cgi?id=147871

    Reviewed by Dan Bernstein.

    NSURLProtocols have the ability to generate redirect responses. This change teaches CustomProtocolManager how to handle them.

    * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
    (WebKit::CustomProtocolManager::wasRedirectedToRequest): Called -URLProtocol:wasRedirectedToRequest:redirectResponse: on the NSURLProtocolClient.
    * Shared/Network/CustomProtocols/CustomProtocolManager.h:
    * Shared/Network/CustomProtocols/CustomProtocolManager.messages.in: Defined WasRedirectedToRequest.
    * Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
    (WebKit::CustomProtocolManager::wasRedirectedToRequest): Defined empty function.
    * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
    (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]): If a redirect response is received, send WasRedirectedToRequest and return nil to ignore the redirect.

Tools:

    2015-09-22  Andy Estes  &lt;aestes@apple.com&gt;

    ContentFiltering.AllowDownloadAfterAddData is very flaky
    https://bugs.webkit.org/show_bug.cgi?id=148885
    &lt;rdar://problem/22729563&gt;

    Reviewed by Alexey Proskuryakov.

    The AllowDownload* tests were relying on -_downloadDidStart: being called before -webView:didFinishNavigation:,
    but there is no guarantee of this. For tests that should allow a download, spin the runloop until
    -_downloadDidStart: is called. The test will now timeout on failure, but will no longer produce false failures.

    * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm:
    (downloadTest):

    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;

    [Content Filtering] Determine navigation and content policy before continuing to filter a load
    https://bugs.webkit.org/show_bug.cgi?id=148506

    Reviewed by Brady Eidson.

    Added download API tests covering every decision and decision point.
    Removed _WKDownload.AsynchronousDownloadPolicy in favor of these new tests.

    * TestWebKitAPI/Configurations/Base.xcconfig: Added $(BUILT_PRODUCTS_DIR)/WebCoreTestSupport to the header search path.
    * TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig: Removed it from here.
    * TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm:
    (-[BundleParametersPlugIn observeValueForKeyPath:ofObject:change:context:]): Called -valueForKeyPath:, which
    returns an id, instead of -valueForKey:, which always returns an NSString even if the object is of another type.
    * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm: Added a class that can send a MockContentFilter
    decision and decision point as a bundle parameter.
    (+[MockContentFilterEnabler supportsSecureCoding]):
    (-[MockContentFilterEnabler copyWithZone:]):
    (-[MockContentFilterEnabler initWithCoder:]):
    (-[MockContentFilterEnabler initWithDecision:decisionPoint:]):
    (-[MockContentFilterEnabler encodeWithCoder:]):
    (configurationWithContentFilterSettings): Added a helper function to create a WKWebViewConfiguration with MockConentFilter settings.
    (TEST): Renamed ContentFiltering.ServerRedirect to ContentFiltering.URLAfterServerRedirect.
    (-[BecomeDownloadDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]): Decided _WKNavigationResponsePolicyBecomeDownload.
    (-[BecomeDownloadDelegate webView:didFailProvisionalNavigation:withError:]): Set isDone to true.
    (-[BecomeDownloadDelegate webView:didFinishNavigation:]): Ditto.
    (-[ContentFilteringDownloadDelegate _downloadDidStart:]): Set downloadDidStart to true.
    (downloadTest): Added a helper function to test downloads with a given decision and decision point.
    * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFilteringPlugIn.mm: Added a corresponding bundle class that decodes
    the MockContentFilter decision and decision point, and sets these values in the MockContentFilterSettings
    singleton. This class is duplicated in the bundle to prevent TestWebKitAPI from having to link to WebCoreTestSupport.
    (+[MockContentFilterEnabler supportsSecureCoding]):
    (-[MockContentFilterEnabler copyWithZone:]):
    (-[MockContentFilterEnabler initWithCoder:]):
    (-[MockContentFilterEnabler dealloc]):
    (-[MockContentFilterEnabler encodeWithCoder:]):
    (-[ContentFilteringPlugIn webProcessPlugIn:initializeWithObject:]): Start observing changes to the MockContentFilterEnabler key path.
    (-[ContentFilteringPlugIn dealloc]): Stop observing.
    (-[ContentFilteringPlugIn observeValueForKeyPath:ofObject:change:context:]): Store a MockContentFilterEnabler in _contentFilterEnabler.
    (+[ServerRedirectPlugIn initialize]): Deleted.
    * TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm:
    (-[AsynchronousDownloadNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]): Deleted.
    (-[AsynchronousDownloadDelegate _downloadDidStart:]): Deleted.
    (TEST): Deleted.

    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;

    Crash when following a Google search link to Twitter with Limit Adult Content enabled
    https://bugs.webkit.org/show_bug.cgi?id=147651

    Rubber-stamped by Brady Eidson.

    Taught TestRunner how to decide the navigation policy after a delay.

    * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
    * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
    (WTR::InjectedBundlePage::decidePolicyForNavigationAction):
    * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
    (WTR::TestRunner::setShouldDecideNavigationPolicyAfterDelay):
    * WebKitTestRunner/InjectedBundle/TestRunner.h:
    (WTR::TestRunner::shouldDecideNavigationPolicyAfterDelay):
    * WebKitTestRunner/TestController.cpp:
    (WTR::TestController::initialize):
    (WTR::TestController::resetStateToConsistentValues):
    (WTR::TestController::decidePolicyForNavigationAction):
    * WebKitTestRunner/TestController.h:
    (WTR::TestController::setShouldDecideNavigationPolicyAfterDelay):
    * WebKitTestRunner/TestInvocation.cpp:
    (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):

    2015-08-24  Andy Estes  &lt;aestes@apple.com&gt;

    REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/188851">r188851</a>): WebKit2.BundleParameters fails on iOS

    * TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig: Specify LD_RUNPATH_SEARCH_PATHS correctly for iOS.

    2015-08-23  Andy Estes  &lt;aestes@apple.com&gt;

    Addressed a missed piece of review feedback from <a href="http://trac.webkit.org/projects/webkit/changeset/188851">r188851</a>.

    * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm:

    2015-08-23  Andy Estes  &lt;aestes@apple.com&gt;

    [Content Filtering] REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/182356">r182356</a>): Provisional URL is incorrect in didReceiveServerRedirectForProvisionalLoadForFrame when Content Filtering is enabled
    https://bugs.webkit.org/show_bug.cgi?id=147872
    rdar://problem/22044000

    Reviewed by Dan Bernstein.

    Added an API test.

    * TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig: Linked libWebCoreTestSupport in order to use MockContentFilter.
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm: Added.
    (-[ServerRedirectNavigationDelegate webView:didStartProvisionalNavigation:]): Expect the initial request URL.
    (-[ServerRedirectNavigationDelegate webView:didReceiveServerRedirectForProvisionalNavigation:]): Expect the redirect URL.
    (-[ServerRedirectNavigationDelegate webView:didCommitNavigation:]):
    (TEST): Tested that -[WKWebView URL] is updated after a redirect when content filtering is enabled.
    * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFilteringPlugIn.mm: Added.
    (+[ServerRedirectPlugIn initialize]): Enable MockContentFilter.
    * TestWebKitAPI/cocoa/TestProtocol.h: Renamed from Tools/TestWebKitAPI/mac/TestProtocol.h.
    * TestWebKitAPI/cocoa/TestProtocol.mm: Renamed from Tools/TestWebKitAPI/mac/TestProtocol.mm.

    2015-08-23  Andy Estes  &lt;aestes@apple.com&gt;

    Fixed the 32-bit Mac build after <a href="http://trac.webkit.org/projects/webkit/changeset/188844">r188844</a>.

    * TestWebKitAPI/WKWebViewConfigurationExtras.h:
    * TestWebKitAPI/WKWebViewConfigurationExtras.mm:

    2015-08-22  Andy Estes  &lt;aestes@apple.com&gt;

    [Cocoa] API tests using the Modern WebKit API should be able to create web process plug-ins
    https://bugs.webkit.org/show_bug.cgi?id=148317

    Reviewed by Dan Bernstein.

    Added the ability for Modern WebKit API tests to create WKWebProcessPlugIns. A test can create a plug-in by
    creating a class that conforms to WKWebProcessPlugIn, adding it to the WebProcessPlugIn target, and using the
    WKWebViewConfiguration returned by +[WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:]
    when creating WKWebViews.

    Since TestWebKitAPI relies on a bundle parameter to know which test class to instantiate in the plug-in, I also
    added a new API test for bundle parameters.

    * TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig: Added. Named the bundle TestWebKitAPI.wkbundle and
    named its executable TestWebKitAPI.bundle.
    * TestWebKitAPI/PlatformUtilities.h: Declared TestPlugInClassNameParameter.
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added the WebProcessPlugIn target.
    * TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm: Added.
    (TEST): Tested bundle parameters by verifying that parameter changes in the UI process are observed in the bundle.
    * TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm: Added.
    (-[BundleParametersPlugIn webProcessPlugIn:didCreateBrowserContextController:]): Started observing changes to a
    bundle parameter and asked for an initial notification.
    (-[BundleParametersPlugIn dealloc]): Stopped observing changes to a bundle parameter.
    (-[BundleParametersPlugIn observeValueForKeyPath:ofObject:change:context:]): When a bundle parameter changes,
    mirror its value in the main frame's JSContext.
    * TestWebKitAPI/WKWebViewConfigurationExtras.h: Added.
    * TestWebKitAPI/WKWebViewConfigurationExtras.mm: Added.
    (+[WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:]): Created a configuration with
    TestWebKitAPI's bundle URL and set a bundle parameter indicating the test plug-in's class name.
    * TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm: Defined TestPlugInClassNameParameter.
    * TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist: Added. Set the principal class to WebProcessPlugIn.
    * TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm: Added.
    (-[WebProcessPlugIn webProcessPlugIn:initializeWithObject:]): Forwarded to a newly-created test class instance.
    (-[WebProcessPlugIn respondsToSelector:]): Returned YES if the test class instance response.
    (-[WebProcessPlugIn forwardingTargetForSelector:]): Forwarded unimplemented methods to the test class instance.

    2015-08-11  Andy Estes  &lt;aestes@apple.com&gt;

    [Cocoa] Add redirect support to CustomProtocolManager
    https://bugs.webkit.org/show_bug.cgi?id=147871

    Reviewed by Dan Bernstein.

    Updated WebKit2CustomProtocolsTest.MainResource to generate a redirect response.

    * TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:
    (TestWebKitAPI::TEST): Unregesitered TestProtocol.
    * TestWebKitAPI/Tests/WebKit2/custom-protocol-sync-xhr.html: Changed scheme to http.
    * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:
    (-[CustomProtocolsLoadDelegate browsingContextControllerDidStartProvisionalLoad:]): Expected a certain provisional URL.
    (-[CustomProtocolsLoadDelegate browsingContextControllerDidReceiveServerRedirectForProvisionalLoad:]): Ditto.
    (-[CustomProtocolsLoadDelegate browsingContextControllerDidCommitLoad:]): Expected a certain committed URL.
    (-[CustomProtocolsLoadDelegate browsingContextControllerDidFinishLoad:]): Expected isLoading to be false.
    (TestWebKitAPI::TEST): Used the new load delegate and unregistered TestProtocol.
    * TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm:
    (TestWebKitAPI::TEST): Unregistered TestProtocol.
    * TestWebKitAPI/mac/TestProtocol.mm: Changed scheme to http.
    (+[TestProtocol canInitWithRequest:]): Changed to use property syntax.
    (-[TestProtocol startLoading]): Taught to handle redirect responses.

    2015-08-13  Andy Estes  &lt;aestes@apple.com&gt;

    [Cocoa] Downloads do not start if policy decision is made asynchronously
    https://bugs.webkit.org/show_bug.cgi?id=147985

    Reviewed by Brady Eidson.

    Added a new API test.

    * TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm:
    (-[AsynchronousDownloadNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
    (-[AsynchronousDownloadDelegate _downloadDidStart:]):
    (TEST):

LayoutTests:

    2015-09-03  Andy Estes  &lt;aestes@apple.com&gt;

    REGRESSION: http/tests/contentfiltering/block-after-redirect.html is flaky
    https://bugs.webkit.org/show_bug.cgi?id=148684

    Reviewed by Alexey Proskuryakov.

    Wait for the iframe to load the blocked page before finishing the test.

    * http/tests/contentfiltering/block-after-redirect.html:
    * platform/mac-wk2/TestExpectations:

    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;

    [Content Filtering] Determine navigation and content policy before continuing to filter a load
    https://bugs.webkit.org/show_bug.cgi?id=148506

    Reviewed by Brady Eidson.

    Added tests for what happens if the content filter does not make a decision when the load finishes.

    * contentfiltering/allow-never-expected.html: Added.
    * contentfiltering/allow-never.html: Added.
    * contentfiltering/block-never-expected.html: Added.
    * contentfiltering/block-never.html: Added.
    * contentfiltering/resources/contentfiltering.js:

    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;

    Crash when following a Google search link to Twitter with Limit Adult Content enabled
    https://bugs.webkit.org/show_bug.cgi?id=147651

    Rubber-stamped by Brady Eidson.

    Added a layout test.

    * http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt: Added.
    * http/tests/contentfiltering/load-substitute-data-from-appcache.html: Added.
    * http/tests/contentfiltering/resources/appcache.html: Added.
    * http/tests/contentfiltering/resources/appcache.manifest: Added.
    * platform/mac-wk1/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601branchLayoutTestsChangeLog">branches/safari-601-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601branchLayoutTestscontentfilteringresourcescontentfilteringjs">branches/safari-601-branch/LayoutTests/contentfiltering/resources/contentfiltering.js</a></li>
<li><a href="#branchessafari601branchLayoutTestshttptestscontentfilteringblockafterredirecthtml">branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/block-after-redirect.html</a></li>
<li><a href="#branchessafari601branchLayoutTestsplatformmacwk1TestExpectations">branches/safari-601-branch/LayoutTests/platform/mac-wk1/TestExpectations</a></li>
<li><a href="#branchessafari601branchSourceWebCoreChangeLog">branches/safari-601-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebCoreWebCorexcodeprojprojectpbxproj">branches/safari-601-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchessafari601branchSourceWebCorebindingsjsJSMockContentFilterSettingsCustomcpp">branches/safari-601-branch/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCoreloaderContentFiltercpp">branches/safari-601-branch/Source/WebCore/loader/ContentFilter.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCoreloaderContentFilterh">branches/safari-601-branch/Source/WebCore/loader/ContentFilter.h</a></li>
<li><a href="#branchessafari601branchSourceWebCoreloaderDocumentLoadercpp">branches/safari-601-branch/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCoreloaderDocumentLoaderh">branches/safari-601-branch/Source/WebCore/loader/DocumentLoader.h</a></li>
<li><a href="#branchessafari601branchSourceWebCoreloaderSubresourceLoadercpp">branches/safari-601-branch/Source/WebCore/loader/SubresourceLoader.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCoreloaderSubresourceLoaderh">branches/safari-601-branch/Source/WebCore/loader/SubresourceLoader.h</a></li>
<li><a href="#branchessafari601branchSourceWebCoretestingInternalscpp">branches/safari-601-branch/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCoretestingMockContentFilterSettingscpp">branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCoretestingMockContentFilterSettingsh">branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.h</a></li>
<li><a href="#branchessafari601branchSourceWebCoretestingMockContentFilterSettingsidl">branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.idl</a></li>
<li><a href="#branchessafari601branchSourceWebKitmacChangeLog">branches/safari-601-branch/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm">branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm</a></li>
<li><a href="#branchessafari601branchSourceWebKit2ChangeLog">branches/safari-601-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebKit2SharedNetworkCustomProtocolsCocoaCustomProtocolManagerCocoamm">branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm</a></li>
<li><a href="#branchessafari601branchSourceWebKit2SharedNetworkCustomProtocolsCustomProtocolManagerh">branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.h</a></li>
<li><a href="#branchessafari601branchSourceWebKit2SharedNetworkCustomProtocolsCustomProtocolManagermessagesin">branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.messages.in</a></li>
<li><a href="#branchessafari601branchSourceWebKit2SharedNetworkCustomProtocolssoupCustomProtocolManagerSoupcpp">branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebKit2UIProcessNetworkCustomProtocolsmacCustomProtocolManagerProxyMacmm">branches/safari-601-branch/Source/WebKit2/UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm</a></li>
<li><a href="#branchessafari601branchSourceWebKit2WebProcessWebPageWebFramecpp">branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp</a></li>
<li><a href="#branchessafari601branchToolsChangeLog">branches/safari-601-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPIConfigurationsBasexcconfig">branches/safari-601-branch/Tools/TestWebKitAPI/Configurations/Base.xcconfig</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPIPlatformUtilitiesh">branches/safari-601-branch/Tools/TestWebKitAPI/PlatformUtilities.h</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">branches/safari-601-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPITestsCustomProtocolsSyncXHRTestmm">branches/safari-601-branch/Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPITestsWebKit2customprotocolsyncxhrhtml">branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2/custom-protocol-sync-xhr.html</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPITestsWebKit2CocoaDownloadmm">branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPITestsWebKit2ObjCCustomProtocolsTestmm">branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPITestsWebKit2ObjCPreventImageLoadWithAutoResizingmm">branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPIcocoaPlatformUtilitiesCocoamm">branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm</a></li>
<li><a href="#branchessafari601branchToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl">branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl</a></li>
<li><a href="#branchessafari601branchToolsWebKitTestRunnerInjectedBundleInjectedBundlePagecpp">branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp</a></li>
<li><a href="#branchessafari601branchToolsWebKitTestRunnerInjectedBundleTestRunnercpp">branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp</a></li>
<li><a href="#branchessafari601branchToolsWebKitTestRunnerInjectedBundleTestRunnerh">branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h</a></li>
<li><a href="#branchessafari601branchToolsWebKitTestRunnerTestControllercpp">branches/safari-601-branch/Tools/WebKitTestRunner/TestController.cpp</a></li>
<li><a href="#branchessafari601branchToolsWebKitTestRunnerTestControllerh">branches/safari-601-branch/Tools/WebKitTestRunner/TestController.h</a></li>
<li><a href="#branchessafari601branchToolsWebKitTestRunnerTestInvocationcpp">branches/safari-601-branch/Tools/WebKitTestRunner/TestInvocation.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari601branchLayoutTestscontentfilteringallowneverexpectedhtml">branches/safari-601-branch/LayoutTests/contentfiltering/allow-never-expected.html</a></li>
<li><a href="#branchessafari601branchLayoutTestscontentfilteringallowneverhtml">branches/safari-601-branch/LayoutTests/contentfiltering/allow-never.html</a></li>
<li><a href="#branchessafari601branchLayoutTestscontentfilteringblockneverexpectedhtml">branches/safari-601-branch/LayoutTests/contentfiltering/block-never-expected.html</a></li>
<li><a href="#branchessafari601branchLayoutTestscontentfilteringblockneverhtml">branches/safari-601-branch/LayoutTests/contentfiltering/block-never.html</a></li>
<li><a href="#branchessafari601branchLayoutTestshttptestscontentfilteringloadsubstitutedatafromappcacheexpectedtxt">branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt</a></li>
<li><a href="#branchessafari601branchLayoutTestshttptestscontentfilteringloadsubstitutedatafromappcachehtml">branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html</a></li>
<li><a href="#branchessafari601branchLayoutTestshttptestscontentfilteringresourcesappcachehtml">branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/resources/appcache.html</a></li>
<li><a href="#branchessafari601branchLayoutTestshttptestscontentfilteringresourcesappcachemanifest">branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/resources/appcache.manifest</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPIConfigurationsWebProcessPlugInxcconfig">branches/safari-601-branch/Tools/TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPITestsWebKit2CocoaBundleParametersmm">branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPITestsWebKit2CocoaBundleParametersPlugInmm">branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPITestsWebKit2CocoaContentFilteringmm">branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPITestsWebKit2CocoaContentFilteringPlugInmm">branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ContentFilteringPlugIn.mm</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPIWKWebViewConfigurationExtrash">branches/safari-601-branch/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.h</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPIWKWebViewConfigurationExtrasmm">branches/safari-601-branch/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.mm</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPIcocoaTestProtocolh">branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/TestProtocol.h</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPIcocoaTestProtocolmm">branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/TestProtocol.mm</a></li>
<li>branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/</li>
<li><a href="#branchessafari601branchToolsTestWebKitAPIcocoaWebProcessPlugInInfoplist">branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPIcocoaWebProcessPlugInWebProcessPlugInmm">branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#branchessafari601branchToolsTestWebKitAPImacTestProtocolh">branches/safari-601-branch/Tools/TestWebKitAPI/mac/TestProtocol.h</a></li>
<li><a href="#branchessafari601branchToolsTestWebKitAPImacTestProtocolmm">branches/safari-601-branch/Tools/TestWebKitAPI/mac/TestProtocol.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/LayoutTests/ChangeLog (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/ChangeLog        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/LayoutTests/ChangeLog        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2015-10-08  Andy Estes  &lt;aestes@apple.com&gt;
+
+        Merge r188150, r188517, r188844, r188845, r188851, r188852, r188880, r188881, r188988, r189193, r189289, and r190133.
+
+    2015-09-03  Andy Estes  &lt;aestes@apple.com&gt;
+
+            REGRESSION: http/tests/contentfiltering/block-after-redirect.html is flaky
+            https://bugs.webkit.org/show_bug.cgi?id=148684
+
+            Reviewed by Alexey Proskuryakov.
+
+            Wait for the iframe to load the blocked page before finishing the test.
+
+            * http/tests/contentfiltering/block-after-redirect.html:
+            * platform/mac-wk2/TestExpectations:
+
+    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;
+
+            [Content Filtering] Determine navigation and content policy before continuing to filter a load
+            https://bugs.webkit.org/show_bug.cgi?id=148506
+
+            Reviewed by Brady Eidson.
+
+            Added tests for what happens if the content filter does not make a decision when the load finishes.
+
+            * contentfiltering/allow-never-expected.html: Added.
+            * contentfiltering/allow-never.html: Added.
+            * contentfiltering/block-never-expected.html: Added.
+            * contentfiltering/block-never.html: Added.
+            * contentfiltering/resources/contentfiltering.js:
+
+    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;
+
+            Crash when following a Google search link to Twitter with Limit Adult Content enabled
+            https://bugs.webkit.org/show_bug.cgi?id=147651
+
+            Rubber-stamped by Brady Eidson.
+
+            Added a layout test.
+
+            * http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt: Added.
+            * http/tests/contentfiltering/load-substitute-data-from-appcache.html: Added.
+            * http/tests/contentfiltering/resources/appcache.html: Added.
+            * http/tests/contentfiltering/resources/appcache.manifest: Added.
+            * platform/mac-wk1/TestExpectations:
+
</ins><span class="cx"> 2015-10-08  Lucas Forschler  &lt;lforschler@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r188148. rdar://problem/22802036
</span></span></pre></div>
<a id="branchessafari601branchLayoutTestscontentfilteringallowneverexpectedhtml"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/contentfiltering/allow-never-expected.html (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/contentfiltering/allow-never-expected.html                                (rev 0)
+++ branches/safari-601-branch/LayoutTests/contentfiltering/allow-never-expected.html        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;iframe src=&quot;resources/pass.html&quot;&gt;&lt;/iframe&gt;
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestscontentfilteringallowneverhtml"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/contentfiltering/allow-never.html (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/contentfiltering/allow-never.html                                (rev 0)
+++ branches/safari-601-branch/LayoutTests/contentfiltering/allow-never.html        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;script src=&quot;resources/contentfiltering.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.internals) {
+    var settings = window.internals.mockContentFilterSettings;
+    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_NEVER, /* decision */settings.DECISION_ALLOW);
+}
+&lt;/script&gt;
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestscontentfilteringblockneverexpectedhtml"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/contentfiltering/block-never-expected.html (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/contentfiltering/block-never-expected.html                                (rev 0)
+++ branches/safari-601-branch/LayoutTests/contentfiltering/block-never-expected.html        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;iframe src=&quot;resources/pass.html&quot;&gt;&lt;/iframe&gt;
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestscontentfilteringblockneverhtml"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/contentfiltering/block-never.html (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/contentfiltering/block-never.html                                (rev 0)
+++ branches/safari-601-branch/LayoutTests/contentfiltering/block-never.html        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;script src=&quot;resources/contentfiltering.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.internals) {
+    var settings = window.internals.mockContentFilterSettings;
+    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_NEVER, /* decision */settings.DECISION_BLOCK);
+}
+&lt;/script&gt;
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestscontentfilteringresourcescontentfilteringjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/LayoutTests/contentfiltering/resources/contentfiltering.js (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/contentfiltering/resources/contentfiltering.js        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/LayoutTests/contentfiltering/resources/contentfiltering.js        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -5,7 +5,12 @@
</span><span class="cx">     settings.decisionPoint = decisionPoint;
</span><span class="cx">     settings.decision = (decideAfterUnblockRequest ? settings.DECISION_BLOCK : decision);
</span><span class="cx">     
</span><del>-    var blockedStringText = (decision === settings.DECISION_ALLOW ? &quot;FAIL&quot; : &quot;PASS&quot;);
</del><ins>+    var blockedStringText;
+    if (decisionPoint === settings.DECISION_POINT_NEVER || decision === settings.DECISION_ALLOW)
+        blockedStringText = &quot;FAIL&quot;;
+    else
+        blockedStringText =  &quot;PASS&quot;;
+
</ins><span class="cx">     if (decideAfterUnblockRequest) {
</span><span class="cx">         settings.unblockRequestDecision = decision;
</span><span class="cx">         settings.blockedString = &quot;&lt;!DOCTYPE html&gt;&lt;script&gt;function unblockRequestDenied() { window.top.postMessage('unblockrequestdenied', '*'); }&lt;/script&gt;&lt;body&gt;&quot; + blockedStringText;
</span></span></pre></div>
<a id="branchessafari601branchLayoutTestshttptestscontentfilteringblockafterredirecthtml"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/block-after-redirect.html (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/block-after-redirect.html        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/block-after-redirect.html        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -1,4 +1,5 @@
</span><span class="cx"> &lt;!DOCTYPE html&gt;
</span><ins>+&lt;body&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> if (window.internals) {
</span><span class="cx">     var settings = window.internals.mockContentFilterSettings;
</span><span class="lines">@@ -7,6 +8,15 @@
</span><span class="cx">     settings.decision = settings.DECISION_BLOCK;
</span><span class="cx">     settings.blockedString = &quot;&lt;!DOCTYPE html&gt;&lt;body&gt;PASS&quot;;
</span><span class="cx"> }
</span><ins>+
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+var iframe = document.createElement(&quot;iframe&quot;);
+document.body.appendChild(iframe);
+iframe.addEventListener(&quot;load&quot;, function(event) {
+    if (window.testRunner)
+        testRunner.notifyDone();
+}, false);
+iframe.src = &quot;/resources/redirect.php?url=/contentfiltering/resources/fail.html&quot;;
</ins><span class="cx"> &lt;/script&gt;
</span><del>-&lt;body&gt;
-&lt;iframe src=&quot;/resources/redirect.php?url=/contentfiltering/resources/fail.html&quot;&gt;&lt;/iframe&gt;
</del></span></pre></div>
<a id="branchessafari601branchLayoutTestshttptestscontentfilteringloadsubstitutedatafromappcacheexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt                                (rev 0)
+++ branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+This is a regression test for webkit.org/b/147651. The test passes if it does not crash.
+
+
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestshttptestscontentfilteringloadsubstitutedatafromappcachehtml"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html                                (rev 0)
+++ branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;script&gt;
+if (window.internals) {
+    var settings = window.internals.mockContentFilterSettings;
+    settings.enabled = true;
+    settings.decisionPoint = settings.DECISION_POINT_AFTER_ADD_DATA;
+    settings.decision = settings.DECISION_ALLOW;
+}
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+    testRunner.setShouldDecideNavigationPolicyAfterDelay(true);
+}
+
+window.addEventListener(&quot;message&quot;, function() {
+    frames[0].location = &quot;/resources/redirect.php?url=/contentfiltering/resources/appcache.html&quot;;
+});
+&lt;/script&gt;
+&lt;body&gt;
+&lt;p&gt;This is a regression test for &lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=147651&quot;&gt;webkit.org/b/147651&lt;/a&gt;. The test passes if it does not crash.&lt;/p&gt;
+&lt;iframe src=&quot;/contentfiltering/resources/appcache.html&quot;&gt;&lt;/iframe&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestshttptestscontentfilteringresourcesappcachehtml"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/resources/appcache.html (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/resources/appcache.html                                (rev 0)
+++ branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/resources/appcache.html        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html manifest=&quot;appcache.manifest&quot;&gt;
+&lt;script&gt;
+applicationCache.onnoupdate = function() {
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+applicationCache.oncached = function() {
+    parent.postMessage(&quot;cached&quot;, &quot;*&quot;);
+}
+&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestshttptestscontentfilteringresourcesappcachemanifest"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/resources/appcache.manifest (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/resources/appcache.manifest                                (rev 0)
+++ branches/safari-601-branch/LayoutTests/http/tests/contentfiltering/resources/appcache.manifest        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+CACHE MANIFEST
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsplatformmacwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/LayoutTests/platform/mac-wk1/TestExpectations (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/platform/mac-wk1/TestExpectations        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/LayoutTests/platform/mac-wk1/TestExpectations        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -129,3 +129,6 @@
</span><span class="cx"> 
</span><span class="cx"> ### END OF (2) Failures without bug reports
</span><span class="cx"> ########################################
</span><ins>+
+# This test is WebKit2-only
+http/tests/contentfiltering/load-substitute-data-from-appcache.html
</ins></span></pre></div>
<a id="branchessafari601branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/ChangeLog        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -1,3 +1,98 @@
</span><ins>+2015-10-08  Andy Estes  &lt;aestes@apple.com&gt;
+
+        Merge r188150, r188517, r188844, r188845, r188851, r188852, r188880, r188881, r188988, r189193, r189289, and r190133.
+
+    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;
+
+            [Content Filtering] Determine navigation and content policy before continuing to filter a load
+            https://bugs.webkit.org/show_bug.cgi?id=148506
+
+            Reviewed by Brady Eidson.
+
+            Prior to this change, ContentFilter would hide from DocumentLoader all CachedRawResourceClient callbacks until
+            a decision was made, then replay the missed callbacks. This approach interacted poorly with some features of
+            the loader, notably appcache and downloads. In the case of appcache, DocumentLoader might not have a chance to
+            check for substitute data until the original load has finished, wasting bandwidth, and might receive duplicate
+            or out-of-order callbacks. In the case of downloads, it would often be too late to convert the existing
+            connection to a download, leading to restarted downloads or outright failures.
+
+            Bandaids were put in place for these issues in r188150, r188486, and r188851 to fix crashes or serious
+            regressions in behavior, but these weren't complete fixes. They did not solve any of the duplicate data loading
+            problems, and they did not make downloads work reliably in all cases.
+
+            This patch rolls out the bandaids (but keeps their tests) and replaces them with a more robust fix. Instead of
+            hiding callbacks from DocumentLoader, ContentFilter now delivers willSendRequest(), redirectReceived(), and
+            responseReceived() to DocumentLoader immediately, and cancels filtering if DocumentLoader decides to ignore the
+            load, download it, or load substitute data. ContentFilter continues to buffer incoming data to prevent partial
+            rendering of blocked content.
+
+            The existing tests for r188150 and r188851 were kept, the test for r188486 was rewritten to be specific to
+            content filtering, and new tests were added to cover the case where ContentFilter is still undecided after a
+            load finishes.
+
+            Tests: contentfiltering/allow-never.html
+                   contentfiltering/block-never.html
+                   ContentFiltering.AllowDownloadAfterAddData
+                   ContentFiltering.AllowDownloadAfterFinishedAddingData
+                   ContentFiltering.AllowDownloadAfterRedirect
+                   ContentFiltering.AllowDownloadAfterResponse
+                   ContentFiltering.AllowDownloadAfterWillSendRequest
+                   ContentFiltering.AllowDownloadNever
+                   ContentFiltering.BlockDownloadAfterAddData
+                   ContentFiltering.BlockDownloadAfterFinishedAddingData
+                   ContentFiltering.BlockDownloadAfterRedirect
+                   ContentFiltering.BlockDownloadAfterResponse
+                   ContentFiltering.BlockDownloadAfterWillSendRequest
+                   ContentFiltering.BlockDownloadNever
+
+            * bindings/js/JSMockContentFilterSettingsCustom.cpp:
+            (WebCore::JSMockContentFilterSettings::decisionPoint): Taught to handle DecisionPoint::Never, and rewrote to
+            not need a set of const uint8_ts that mirror the DecisionPoint enum.
+            (WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
+            (WebCore::toJSValue): Rewrote to not need a set of const uint8_ts that mirror the Decision enum.
+            (WebCore::toDecision): Ditto.
+            * loader/ContentFilter.cpp:
+            (WebCore::ContentFilter::createIfEnabled): Renamed from createIfNeeded, and changed to take a DocumentLoader&amp;
+            instead of a DecisionFunction.
+            (WebCore::ContentFilter::ContentFilter):
+            (WebCore::ContentFilter::responseReceived): If m_state != Blocked after filtering, call DocumentLoader::responseReceived().
+            (WebCore::ContentFilter::dataReceived): If m_state == Allowed after filtering, deliver buffered data to DocumentLoader.
+            If no filtering was necessary, call DocumentLoader::dataReceived() directly.
+            (WebCore::ContentFilter::redirectReceived): If m_state != Blocked after filtering, call DocumentLoader::redirectReceived().
+            (WebCore::ContentFilter::notifyFinished): If an error occured, call DocumentLoader::notifyFinished() immediately and return.
+            If m_state != Blocked after filtering, deliver buffered data to DocumentLoader and call DocumentLoader::notifyFinished().
+            If no filtering was necessary and m_state != Blocked, call DocumentLoader::notifyFinished() directly.
+            (WebCore::ContentFilter::didDecide): Called DocumentLoader::contentFilterDidDecide() instead of m_decisionFunction().
+            (WebCore::ContentFilter::deliverResourceData): Added a helper function to deliver buffered data to DocumentLoader.
+            (WebCore::ContentFilter::createIfNeeded): Renamed to createIfEnabled().
+            * loader/ContentFilter.h:
+            * loader/DocumentLoader.cpp:
+            (WebCore::DocumentLoader::DocumentLoader):
+            (WebCore::DocumentLoader::willSendRequest): Stopped asserting that redirectResponse is null and made it part of
+            the if condition instead, since willSendRequest() will now be called on redirects when there is an active ContentFilter.
+            (WebCore::DocumentLoader::startLoadingMainResource): Called becomeMainResourceClient() instead of becomeMainResourceClientIfFilterAllows().
+            (WebCore::DocumentLoader::becomeMainResourceClient): Renamed from becomeMainResourceClientIfFilterAllows().
+            Only called ContentFilter::startFilteringMainResource() if the filter state is Initialized, since ContentFilter
+            might have already made a decision in willSendRequest().
+            (WebCore::DocumentLoader::contentFilterDidDecide): Stopped deleting m_contentFilter, since it will continue to deliver callbacks
+            even after making a decision. Fixed a bug where we were creating two copies of ContentFilter's replacement data.
+            (WebCore::DocumentLoader::syntheticRedirectReceived): Deleted.
+            (WebCore::DocumentLoader::becomeMainResourceClientIfFilterAllows): Renamed to becomeMainResourceClient().
+            * loader/DocumentLoader.h:
+            * loader/EmptyClients.h:
+            * loader/FrameLoaderClient.h:
+            * loader/ResourceLoader.cpp:
+            (WebCore::ResourceLoader::willSendRequestInternal): Removed part of r188851.
+            * loader/SubresourceLoader.cpp:
+            (WebCore::SubresourceLoader::didReceiveResponse): Removed part of r188486.
+            * loader/SubresourceLoader.h:
+            * loader/cache/CachedRawResource.cpp:
+            (WebCore::CachedRawResource::didAddClient): Removed part of r188150.
+            * loader/cache/CachedRawResourceClient.h:
+            (WebCore::CachedRawResourceClient::syntheticRedirectReceived): Removed part of r188150.
+            * testing/MockContentFilterSettings.h: Defined DecisionPoint::Never.
+            * testing/MockContentFilterSettings.idl: Defined DECISION_POINT_NEVER.
+
</ins><span class="cx"> 2015-10-08  Lucas Forschler  &lt;lforschler@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r188148. rdar://problem/22802036
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -3895,7 +3895,7 @@
</span><span class="cx">                 A19D934A1AA11B1E00B46C24 /* NetworkExtensionContentFilter.mm in Sources */ = {isa = PBXBuildFile; fileRef = A19D93481AA11B1E00B46C24 /* NetworkExtensionContentFilter.mm */; };
</span><span class="cx">                 A19D934B1AA11B1E00B46C24 /* NetworkExtensionContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A19D93491AA11B1E00B46C24 /* NetworkExtensionContentFilter.h */; };
</span><span class="cx">                 A1B5B29E1AAA846E008B6042 /* MockContentFilterSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1B5B29C1AAA846E008B6042 /* MockContentFilterSettings.cpp */; };
</span><del>-                A1B5B29F1AAA846F008B6042 /* MockContentFilterSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = A1B5B29D1AAA846E008B6042 /* MockContentFilterSettings.h */; };
</del><ins>+                A1B5B29F1AAA846F008B6042 /* MockContentFilterSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = A1B5B29D1AAA846E008B6042 /* MockContentFilterSettings.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 A1BF6B821AA96C7D00AF4A8A /* MockContentFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1BF6B801AA96C7D00AF4A8A /* MockContentFilter.cpp */; };
</span><span class="cx">                 A1BF6B831AA96C7D00AF4A8A /* MockContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A1BF6B811AA96C7D00AF4A8A /* MockContentFilter.h */; };
</span><span class="cx">                 A1C797181883DD82000F5E1F /* DOMGestureEvent.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 0F54DCDD1880F901003EEDBB /* DOMGestureEvent.h */; };
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCorebindingsjsJSMockContentFilterSettingsCustomcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -38,28 +38,17 @@
</span><span class="cx"> using Decision = MockContentFilterSettings::Decision;
</span><span class="cx"> using DecisionPoint = MockContentFilterSettings::DecisionPoint;
</span><span class="cx"> 
</span><del>-// Must be kept in sync with values in MockContentFilterSettings.idl.
-const uint8_t decisionPointAfterWillSendRequest = 0;
-const uint8_t decisionPointAfterRedirect = 1;
-const uint8_t decisionPointAfterResponse = 2;
-const uint8_t decisionPointAfterAddData = 3;
-const uint8_t decisionPointAfterFinishedAddingData = 4;
-const uint8_t decisionAllow = 0;
-const uint8_t decisionBlock = 1;
-
</del><span class="cx"> JSValue JSMockContentFilterSettings::decisionPoint(ExecState*) const
</span><span class="cx"> {
</span><del>-    switch (impl().decisionPoint()) {
</del><ins>+    DecisionPoint decisionPoint = impl().decisionPoint();
+    switch (decisionPoint) {
</ins><span class="cx">     case DecisionPoint::AfterWillSendRequest:
</span><del>-        return jsNumber(decisionPointAfterWillSendRequest);
</del><span class="cx">     case DecisionPoint::AfterRedirect:
</span><del>-        return jsNumber(decisionPointAfterRedirect);
</del><span class="cx">     case DecisionPoint::AfterResponse:
</span><del>-        return jsNumber(decisionPointAfterResponse);
</del><span class="cx">     case DecisionPoint::AfterAddData:
</span><del>-        return jsNumber(decisionPointAfterAddData);
</del><span class="cx">     case DecisionPoint::AfterFinishedAddingData:
</span><del>-        return jsNumber(decisionPointAfterFinishedAddingData);
</del><ins>+    case DecisionPoint::Never:
+        return jsNumber(static_cast&lt;uint8_t&gt;(decisionPoint));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="lines">@@ -72,22 +61,16 @@
</span><span class="cx">     if (exec-&gt;hadException())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    switch (nativeValue) {
-    case decisionPointAfterWillSendRequest:
-        impl().setDecisionPoint(DecisionPoint::AfterWillSendRequest);
</del><ins>+    DecisionPoint decisionPoint { static_cast&lt;DecisionPoint&gt;(nativeValue) };
+    switch (decisionPoint) {
+    case DecisionPoint::AfterWillSendRequest:
+    case DecisionPoint::AfterRedirect:
+    case DecisionPoint::AfterResponse:
+    case DecisionPoint::AfterAddData:
+    case DecisionPoint::AfterFinishedAddingData:
+    case DecisionPoint::Never:
+        impl().setDecisionPoint(decisionPoint);
</ins><span class="cx">         return;
</span><del>-    case decisionPointAfterRedirect:
-        impl().setDecisionPoint(DecisionPoint::AfterRedirect);
-        return;
-    case decisionPointAfterResponse:
-        impl().setDecisionPoint(DecisionPoint::AfterResponse);
-        return;
-    case decisionPointAfterAddData:
-        impl().setDecisionPoint(DecisionPoint::AfterAddData);
-        return;
-    case decisionPointAfterFinishedAddingData:
-        impl().setDecisionPoint(DecisionPoint::AfterFinishedAddingData);
-        return;
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     throwTypeError(exec, String::format(&quot;%u is not a valid decisionPoint value.&quot;, nativeValue));
</span><span class="lines">@@ -97,9 +80,8 @@
</span><span class="cx"> {
</span><span class="cx">     switch (decision) {
</span><span class="cx">     case Decision::Allow:
</span><del>-        return jsNumber(decisionAllow);
</del><span class="cx">     case Decision::Block:
</span><del>-        return jsNumber(decisionBlock);
</del><ins>+        return jsNumber(static_cast&lt;uint8_t&gt;(decision));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="lines">@@ -112,11 +94,11 @@
</span><span class="cx">     if (exec-&gt;hadException())
</span><span class="cx">         return Decision::Allow;
</span><span class="cx"> 
</span><del>-    switch (nativeValue) {
-    case decisionAllow:
-        return Decision::Allow;
-    case decisionBlock:
-        return Decision::Block;
</del><ins>+    Decision decision { static_cast&lt;Decision&gt;(nativeValue) };
+    switch (decision) {
+    case Decision::Allow:
+    case Decision::Block:
+        return decision;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     throwTypeError(exec, String::format(&quot;%u is not a valid decision value.&quot;, nativeValue));
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreloaderContentFiltercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/loader/ContentFilter.cpp (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/loader/ContentFilter.cpp        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/loader/ContentFilter.cpp        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CachedRawResource.h&quot;
</span><span class="cx"> #include &quot;ContentFilterUnblockHandler.h&quot;
</span><ins>+#include &quot;DocumentLoader.h&quot;
</ins><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;NetworkExtensionContentFilter.h&quot;
</span><span class="cx"> #include &quot;ParentalControlsContentFilter.h&quot;
</span><span class="lines">@@ -58,7 +59,7 @@
</span><span class="cx">     return types;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr&lt;ContentFilter&gt; ContentFilter::createIfNeeded(DecisionFunction decisionFunction)
</del><ins>+std::unique_ptr&lt;ContentFilter&gt; ContentFilter::createIfEnabled(DocumentLoader&amp; documentLoader)
</ins><span class="cx"> {
</span><span class="cx">     Container filters;
</span><span class="cx">     for (auto&amp; type : types()) {
</span><span class="lines">@@ -73,12 +74,12 @@
</span><span class="cx">     if (filters.isEmpty())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    return std::make_unique&lt;ContentFilter&gt;(WTF::move(filters), WTF::move(decisionFunction));
</del><ins>+    return std::make_unique&lt;ContentFilter&gt;(WTF::move(filters), documentLoader);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-ContentFilter::ContentFilter(Container contentFilters, DecisionFunction decisionFunction)
</del><ins>+ContentFilter::ContentFilter(Container contentFilters, DocumentLoader&amp; documentLoader)
</ins><span class="cx">     : m_contentFilters { WTF::move(contentFilters) }
</span><del>-    , m_decisionFunction { WTF::move(decisionFunction) }
</del><ins>+    , m_documentLoader { documentLoader }
</ins><span class="cx"> {
</span><span class="cx">     LOG(ContentFiltering, &quot;Creating ContentFilter with %zu platform content filter(s).\n&quot;, m_contentFilters.size());
</span><span class="cx">     ASSERT(!m_contentFilters.isEmpty());
</span><span class="lines">@@ -147,39 +148,78 @@
</span><span class="cx"> 
</span><span class="cx"> void ContentFilter::responseReceived(CachedResource* resource, const ResourceResponse&amp; response)
</span><span class="cx"> {
</span><ins>+    ASSERT(resource);
+    ASSERT(resource == m_mainResource);
+    ASSERT(m_state != State::Initialized);
</ins><span class="cx">     LOG(ContentFiltering, &quot;ContentFilter received response from &lt;%s&gt;.\n&quot;, response.url().string().ascii().data());
</span><del>-    ASSERT(m_state == State::Filtering);
-    ASSERT_UNUSED(resource, resource == m_mainResource.get());
-    forEachContentFilterUntilBlocked([&amp;response](PlatformContentFilter&amp; contentFilter) {
-        contentFilter.responseReceived(response);
-    });
</del><ins>+
+    if (m_state == State::Filtering) {
+        forEachContentFilterUntilBlocked([&amp;response](PlatformContentFilter&amp; contentFilter) {
+            contentFilter.responseReceived(response);
+        });
+    }
+
+    if (m_state != State::Blocked)
+        m_documentLoader.responseReceived(resource, response);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ContentFilter::dataReceived(CachedResource* resource, const char* data, int length)
</span><span class="cx"> {
</span><ins>+    ASSERT(resource);
+    ASSERT(resource == m_mainResource);
+    ASSERT(m_state != State::Initialized);
</ins><span class="cx">     LOG(ContentFiltering, &quot;ContentFilter received %d bytes of data from &lt;%s&gt;.\n&quot;, length, resource-&gt;url().string().ascii().data());
</span><del>-    ASSERT(m_state == State::Filtering);
-    ASSERT_UNUSED(resource, resource == m_mainResource.get());
-    forEachContentFilterUntilBlocked([data, length](PlatformContentFilter&amp; contentFilter) {
-        contentFilter.addData(data, length);
-    });
</del><ins>+
+    if (m_state == State::Filtering) {
+        forEachContentFilterUntilBlocked([data, length](PlatformContentFilter&amp; contentFilter) {
+            contentFilter.addData(data, length);
+        });
+
+        if (m_state == State::Allowed)
+            deliverResourceData(*resource);
+        return;
+    }
+
+    if (m_state == State::Allowed)
+        m_documentLoader.dataReceived(resource, data, length);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ContentFilter::redirectReceived(CachedResource* resource, ResourceRequest&amp; request, const ResourceResponse&amp; redirectResponse)
</span><span class="cx"> {
</span><del>-    ASSERT(m_state == State::Filtering);
-    ASSERT_UNUSED(resource, resource == m_mainResource.get());
-    willSendRequest(request, redirectResponse);
</del><ins>+    ASSERT(resource);
+    ASSERT(resource == m_mainResource);
+    ASSERT(m_state != State::Initialized);
+
+    if (m_state == State::Filtering)
+        willSendRequest(request, redirectResponse);
+
+    if (m_state != State::Blocked)
+        m_documentLoader.redirectReceived(resource, request, redirectResponse);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ContentFilter::notifyFinished(CachedResource* resource)
</span><span class="cx"> {
</span><ins>+    ASSERT(resource);
+    ASSERT(resource == m_mainResource);
+    ASSERT(m_state != State::Initialized);
</ins><span class="cx">     LOG(ContentFiltering, &quot;ContentFilter will finish filtering main resource at &lt;%s&gt;.\n&quot;, resource-&gt;url().string().ascii().data());
</span><del>-    ASSERT(m_state == State::Filtering);
-    ASSERT_UNUSED(resource, resource == m_mainResource.get());
-    forEachContentFilterUntilBlocked([](PlatformContentFilter&amp; contentFilter) {
-        contentFilter.finishedAddingData();
-    });
</del><ins>+
+    if (resource-&gt;errorOccurred()) {
+        m_documentLoader.notifyFinished(resource);
+        return;
+    }
+
+    if (m_state == State::Filtering) {
+        forEachContentFilterUntilBlocked([](PlatformContentFilter&amp; contentFilter) {
+            contentFilter.finishedAddingData();
+        });
+
+        if (m_state != State::Blocked)
+            deliverResourceData(*resource);
+    }
+
+    if (m_state != State::Blocked)
+        m_documentLoader.notifyFinished(resource);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ContentFilter::forEachContentFilterUntilBlocked(std::function&lt;void(PlatformContentFilter&amp;)&gt; function)
</span><span class="lines">@@ -213,10 +253,14 @@
</span><span class="cx">     ASSERT(state == State::Allowed || state == State::Blocked);
</span><span class="cx">     LOG(ContentFiltering, &quot;ContentFilter decided load should be %s for main resource at &lt;%s&gt;.\n&quot;, state == State::Allowed ? &quot;allowed&quot; : &quot;blocked&quot;, m_mainResource ? m_mainResource-&gt;url().string().ascii().data() : &quot;&quot;);
</span><span class="cx">     m_state = state;
</span><ins>+    m_documentLoader.contentFilterDidDecide();
+}
</ins><span class="cx"> 
</span><del>-    // Calling m_decisionFunction might delete |this|.
-    if (m_decisionFunction)
-        m_decisionFunction();
</del><ins>+void ContentFilter::deliverResourceData(CachedResource&amp; resource)
+{
+    ASSERT(resource.dataBufferingPolicy() == BufferData);
+    const SharedBuffer&amp; resourceBuffer = *resource.resourceBuffer();
+    m_documentLoader.dataReceived(&amp;resource, resourceBuffer.data(), resourceBuffer.size());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreloaderContentFilterh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/loader/ContentFilter.h (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/loader/ContentFilter.h        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/loader/ContentFilter.h        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> 
</span><span class="cx"> class CachedRawResource;
</span><span class="cx"> class ContentFilterUnblockHandler;
</span><ins>+class DocumentLoader;
</ins><span class="cx"> class PlatformContentFilter;
</span><span class="cx"> class SharedBuffer;
</span><span class="cx"> 
</span><span class="lines">@@ -47,8 +48,7 @@
</span><span class="cx"> public:
</span><span class="cx">     template &lt;typename T&gt; static void addType() { types().append(type&lt;T&gt;()); }
</span><span class="cx"> 
</span><del>-    using DecisionFunction = std::function&lt;void()&gt;;
-    static std::unique_ptr&lt;ContentFilter&gt; createIfNeeded(DecisionFunction);
</del><ins>+    static std::unique_ptr&lt;ContentFilter&gt; createIfEnabled(DocumentLoader&amp;);
</ins><span class="cx">     ~ContentFilter() override;
</span><span class="cx"> 
</span><span class="cx">     static const char* urlScheme() { return &quot;x-apple-content-filter&quot;; }
</span><span class="lines">@@ -76,8 +76,8 @@
</span><span class="cx">     WEBCORE_EXPORT static Vector&lt;Type&gt;&amp; types();
</span><span class="cx"> 
</span><span class="cx">     using Container = Vector&lt;std::unique_ptr&lt;PlatformContentFilter&gt;&gt;;
</span><del>-    friend std::unique_ptr&lt;ContentFilter&gt; std::make_unique&lt;ContentFilter&gt;(Container&amp;&amp;, DecisionFunction&amp;&amp;);
-    ContentFilter(Container, DecisionFunction);
</del><ins>+    friend std::unique_ptr&lt;ContentFilter&gt; std::make_unique&lt;ContentFilter&gt;(Container&amp;&amp;, DocumentLoader&amp;);
+    ContentFilter(Container, DocumentLoader&amp;);
</ins><span class="cx"> 
</span><span class="cx">     // CachedRawResourceClient
</span><span class="cx">     void responseReceived(CachedResource*, const ResourceResponse&amp;) override;
</span><span class="lines">@@ -89,9 +89,10 @@
</span><span class="cx"> 
</span><span class="cx">     void forEachContentFilterUntilBlocked(std::function&lt;void(PlatformContentFilter&amp;)&gt;);
</span><span class="cx">     void didDecide(State);
</span><ins>+    void deliverResourceData(CachedResource&amp;);
</ins><span class="cx"> 
</span><span class="cx">     const Container m_contentFilters;
</span><del>-    const DecisionFunction m_decisionFunction;
</del><ins>+    DocumentLoader&amp; m_documentLoader;
</ins><span class="cx">     CachedResourceHandle&lt;CachedRawResource&gt; m_mainResource;
</span><span class="cx">     PlatformContentFilter* m_blockingContentFilter { nullptr };
</span><span class="cx">     State m_state { State::Initialized };
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/loader/DocumentLoader.cpp (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/loader/DocumentLoader.cpp        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/loader/DocumentLoader.cpp        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx">     , m_subresourceLoadersArePageCacheAcceptable(false)
</span><span class="cx">     , m_applicationCacheHost(std::make_unique&lt;ApplicationCacheHost&gt;(*this))
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span><del>-    , m_contentFilter(!substituteData.isValid() ? ContentFilter::createIfNeeded(std::bind(&amp;DocumentLoader::contentFilterDidDecide, this)) : nullptr)
</del><ins>+    , m_contentFilter(!substituteData.isValid() ? ContentFilter::createIfEnabled(*this) : nullptr)
</ins><span class="cx"> #endif
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -536,8 +536,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span><del>-    if (m_contentFilter) {
-        ASSERT(redirectResponse.isNull());
</del><ins>+    if (m_contentFilter &amp;&amp; redirectResponse.isNull()) {
</ins><span class="cx">         m_contentFilter-&gt;willSendRequest(newRequest, redirectResponse);
</span><span class="cx">         if (newRequest.isNull())
</span><span class="cx">             return;
</span><span class="lines">@@ -1454,11 +1453,7 @@
</span><span class="cx">         frameLoader()-&gt;notifier().dispatchWillSendRequest(this, m_identifierForLoadWithoutResourceLoader, request, ResourceResponse());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if ENABLE(CONTENT_FILTERING)
-    becomeMainResourceClientIfFilterAllows();
-#else
-    m_mainResource-&gt;addClient(this);
-#endif
</del><ins>+    becomeMainResourceClient();
</ins><span class="cx"> 
</span><span class="cx">     // A bunch of headers are set when the underlying ResourceLoader is created, and m_request needs to include those.
</span><span class="cx">     if (mainResourceLoader())
</span><span class="lines">@@ -1594,6 +1589,18 @@
</span><span class="cx">     return m_shouldOpenExternalURLsPolicy;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void DocumentLoader::becomeMainResourceClient()
+{
+#if ENABLE(CONTENT_FILTERING)
+    if (m_contentFilter &amp;&amp; m_contentFilter-&gt;state() == ContentFilter::State::Initialized) {
+        // ContentFilter will synthesize CachedRawResourceClient callbacks.
+        m_contentFilter-&gt;startFilteringMainResource(*m_mainResource);
+        return;
+    }
+#endif
+    m_mainResource-&gt;addClient(this);
+}
+
</ins><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx"> void DocumentLoader::addPendingContentExtensionSheet(const String&amp; identifier, StyleSheetContents&amp; sheet)
</span><span class="cx"> {
</span><span class="lines">@@ -1610,16 +1617,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span><del>-void DocumentLoader::becomeMainResourceClientIfFilterAllows()
-{
-    ASSERT(m_mainResource);
-    if (m_contentFilter) {
-        ASSERT(m_contentFilter-&gt;state() == ContentFilter::State::Initialized);
-        m_contentFilter-&gt;startFilteringMainResource(*m_mainResource);
-    } else
-        m_mainResource-&gt;addClient(this);
-}
-
</del><span class="cx"> void DocumentLoader::installContentFilterUnblockHandler(ContentFilter&amp; contentFilter)
</span><span class="cx"> {
</span><span class="cx">     ContentFilterUnblockHandler unblockHandler { contentFilter.unblockHandler() };
</span><span class="lines">@@ -1642,21 +1639,17 @@
</span><span class="cx">     using State = ContentFilter::State;
</span><span class="cx">     ASSERT(m_contentFilter);
</span><span class="cx">     ASSERT(m_contentFilter-&gt;state() == State::Blocked || m_contentFilter-&gt;state() == State::Allowed);
</span><del>-    std::unique_ptr&lt;ContentFilter&gt; contentFilter;
-    std::swap(contentFilter, m_contentFilter);
-    if (contentFilter-&gt;state() == State::Allowed) {
-        if (m_mainResource)
-            m_mainResource-&gt;addClient(this);
</del><ins>+    if (m_contentFilter-&gt;state() == State::Allowed)
</ins><span class="cx">         return;
</span><del>-    }
</del><span class="cx"> 
</span><del>-    installContentFilterUnblockHandler(*contentFilter);
</del><ins>+    installContentFilterUnblockHandler(*m_contentFilter);
</ins><span class="cx"> 
</span><span class="cx">     URL blockedURL;
</span><span class="cx">     blockedURL.setProtocol(ContentFilter::urlScheme());
</span><span class="cx">     blockedURL.setHost(ASCIILiteral(&quot;blocked-page&quot;));
</span><del>-    ResourceResponse response(URL(), ASCIILiteral(&quot;text/html&quot;), contentFilter-&gt;replacementData()-&gt;size(), ASCIILiteral(&quot;UTF-8&quot;));
-    SubstituteData substituteData { contentFilter-&gt;replacementData(), documentURL(), response, SubstituteData::SessionHistoryVisibility::Hidden };
</del><ins>+    auto replacementData = m_contentFilter-&gt;replacementData();
+    ResourceResponse response(URL(), ASCIILiteral(&quot;text/html&quot;), replacementData-&gt;size(), ASCIILiteral(&quot;UTF-8&quot;));
+    SubstituteData substituteData { adoptRef(&amp;replacementData.leakRef()), documentURL(), response, SubstituteData::SessionHistoryVisibility::Hidden };
</ins><span class="cx">     frame()-&gt;navigationScheduler().scheduleSubstituteDataLoad(blockedURL, substituteData);
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreloaderDocumentLoaderh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/loader/DocumentLoader.h (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/loader/DocumentLoader.h        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/loader/DocumentLoader.h        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -338,9 +338,10 @@
</span><span class="cx">         void clearMainResource();
</span><span class="cx"> 
</span><span class="cx">         void cancelPolicyCheckIfNeeded();
</span><ins>+        void becomeMainResourceClient();
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span><del>-        void becomeMainResourceClientIfFilterAllows();
</del><ins>+        friend class ContentFilter;
</ins><span class="cx">         void installContentFilterUnblockHandler(ContentFilter&amp;);
</span><span class="cx">         void contentFilterDidDecide();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreloaderSubresourceLoadercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/loader/SubresourceLoader.cpp (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/loader/SubresourceLoader.cpp        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/loader/SubresourceLoader.cpp        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -207,8 +207,6 @@
</span><span class="cx">     // anything including removing the last reference to this object; one example of this is 3266216.
</span><span class="cx">     Ref&lt;SubresourceLoader&gt; protect(*this);
</span><span class="cx"> 
</span><del>-    TemporaryChange&lt;bool&gt; callingDidReceiveResponse(m_callingDidReceiveResponse, true);
-
</del><span class="cx">     if (shouldIncludeCertificateInfo())
</span><span class="cx">         response.includeCertificateInfo();
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreloaderSubresourceLoaderh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/loader/SubresourceLoader.h (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/loader/SubresourceLoader.h        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/loader/SubresourceLoader.h        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -58,8 +58,6 @@
</span><span class="cx">     virtual const ResourceRequest&amp; iOSOriginalRequest() const override { return m_iOSOriginalRequest; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    bool callingDidReceiveResponse() const { return m_callingDidReceiveResponse; }
-
</del><span class="cx"> private:
</span><span class="cx">     SubresourceLoader(Frame*, CachedResource*, const ResourceLoaderOptions&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -123,7 +121,6 @@
</span><span class="cx">     bool m_loadingMultipartContent;
</span><span class="cx">     SubresourceLoaderState m_state;
</span><span class="cx">     std::unique_ptr&lt;RequestCountTracker&gt; m_requestCountTracker;
</span><del>-    bool m_callingDidReceiveResponse { false };
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/testing/Internals.cpp (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/testing/Internals.cpp        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/testing/Internals.cpp        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span><del>-#include &quot;MockContentFilter.h&quot;
</del><ins>+#include &quot;MockContentFilterSettings.h&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_AUDIO)
</span><span class="lines">@@ -351,10 +351,6 @@
</span><span class="cx">     enableMockRTCPeerConnectionHandler();
</span><span class="cx">     WebCore::provideUserMediaTo(document-&gt;page(), new UserMediaClientMock());
</span><span class="cx"> #endif
</span><del>-
-#if ENABLE(CONTENT_FILTERING)
-    MockContentFilter::ensureInstalled();
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Document* Internals::contextDocument() const
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoretestingMockContentFilterSettingscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.cpp (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.cpp        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.cpp        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ContentFilter.h&quot;
</span><span class="cx"> #include &quot;ContentFilterUnblockHandler.h&quot;
</span><ins>+#include &quot;MockContentFilter.h&quot;
</ins><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -45,6 +46,12 @@
</span><span class="cx">     singleton() = MockContentFilterSettings();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MockContentFilterSettings::setEnabled(bool enabled)
+{
+    MockContentFilter::ensureInstalled();
+    m_enabled = enabled;
+}
+
</ins><span class="cx"> const String&amp; MockContentFilterSettings::unblockRequestURL() const
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;String&gt; unblockRequestURL = makeString(ContentFilter::urlScheme(), &quot;://&quot;, unblockURLHost());
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoretestingMockContentFilterSettingsh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.h (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.h        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.h        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -40,7 +40,8 @@
</span><span class="cx">         AfterRedirect,
</span><span class="cx">         AfterResponse,
</span><span class="cx">         AfterAddData,
</span><del>-        AfterFinishedAddingData
</del><ins>+        AfterFinishedAddingData,
+        Never
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     enum class Decision {
</span><span class="lines">@@ -48,7 +49,7 @@
</span><span class="cx">         Block
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    static MockContentFilterSettings&amp; singleton();
</del><ins>+    WTF_EXPORT_PRIVATE static MockContentFilterSettings&amp; singleton();
</ins><span class="cx">     static void reset();
</span><span class="cx">     static const char* unblockURLHost() { return &quot;mock-unblock&quot;; }
</span><span class="cx"> 
</span><span class="lines">@@ -57,7 +58,7 @@
</span><span class="cx">     void deref() { }
</span><span class="cx"> 
</span><span class="cx">     bool enabled() const { return m_enabled; }
</span><del>-    void setEnabled(bool enabled) { m_enabled = enabled; }
</del><ins>+    WTF_EXPORT_PRIVATE void setEnabled(bool);
</ins><span class="cx"> 
</span><span class="cx">     const String&amp; blockedString() const { return m_blockedString; }
</span><span class="cx">     void setBlockedString(const String&amp; blockedString) { m_blockedString = blockedString; }
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoretestingMockContentFilterSettingsidl"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.idl (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.idl        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.idl        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx">     const octet DECISION_POINT_AFTER_RESPONSE = 2;
</span><span class="cx">     const octet DECISION_POINT_AFTER_ADD_DATA = 3;
</span><span class="cx">     const octet DECISION_POINT_AFTER_FINISHED_ADDING_DATA = 4;
</span><ins>+    const octet DECISION_POINT_NEVER = 5;
</ins><span class="cx">     [Custom] attribute octet decisionPoint;
</span><span class="cx"> 
</span><span class="cx">     const octet DECISION_ALLOW = 0;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit/mac/ChangeLog (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit/mac/ChangeLog        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebKit/mac/ChangeLog        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-10-08  Andy Estes  &lt;aestes@apple.com&gt;
+
+        Merge r188150, r188517, r188844, r188845, r188851, r188852, r188880, r188881, r188988, r189193, r189289, and r190133.
+
+    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;
+
+            [Content Filtering] Determine navigation and content policy before continuing to filter a load
+            https://bugs.webkit.org/show_bug.cgi?id=148506
+
+            Reviewed by Brady Eidson.
+
+            Deleted parts of r188486 and r188851.
+
+            * WebCoreSupport/WebFrameLoaderClient.h:
+            * WebCoreSupport/WebFrameLoaderClient.mm:
+            (WebFrameLoaderClient::convertMainResourceLoadToDownload):
+            (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
+
</ins><span class="cx"> 2015-10-08  Lucas Forschler  &lt;lforschler@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rollout r190745
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -288,7 +288,7 @@
</span><span class="cx">     WebView *webView = getWebView(m_webFrame.get());
</span><span class="cx">     SubresourceLoader* mainResourceLoader = documentLoader-&gt;mainResourceLoader();
</span><span class="cx"> 
</span><del>-    if (!mainResourceLoader || !mainResourceLoader-&gt;callingDidReceiveResponse()) {
</del><ins>+    if (!mainResourceLoader) {
</ins><span class="cx">         // The resource has already been cached, or the conversion is being attmpted when not calling SubresourceLoader::didReceiveResponse().
</span><span class="cx"> #pragma clang diagnostic push
</span><span class="cx"> #pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit2/ChangeLog (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit2/ChangeLog        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebKit2/ChangeLog        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2015-10-08  Andy Estes  &lt;aestes@apple.com&gt;
+
+        Merge r188150, r188517, r188844, r188845, r188851, r188852, r188880, r188881, r188988, r189193, r189289, and r190133.
+
+    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;
+
+            [Content Filtering] Determine navigation and content policy before continuing to filter a load
+            https://bugs.webkit.org/show_bug.cgi?id=148506
+
+            Reviewed by Brady Eidson.
+
+            Deleted parts of r188486 and r188851.
+
+            * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+            (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
+            * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+            * WebProcess/WebPage/WebFrame.cpp:
+            (WebKit::WebFrame::convertMainResourceLoadToDownload):
+
+    2015-08-11  Andy Estes  &lt;aestes@apple.com&gt;
+
+            [Cocoa] Add redirect support to CustomProtocolManager
+            https://bugs.webkit.org/show_bug.cgi?id=147871
+
+            Reviewed by Dan Bernstein.
+            
+            NSURLProtocols have the ability to generate redirect responses. This change teaches CustomProtocolManager how to handle them.
+
+            * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
+            (WebKit::CustomProtocolManager::wasRedirectedToRequest): Called -URLProtocol:wasRedirectedToRequest:redirectResponse: on the NSURLProtocolClient.
+            * Shared/Network/CustomProtocols/CustomProtocolManager.h:
+            * Shared/Network/CustomProtocols/CustomProtocolManager.messages.in: Defined WasRedirectedToRequest.
+            * Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
+            (WebKit::CustomProtocolManager::wasRedirectedToRequest): Defined empty function.
+            * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
+            (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]): If a redirect response is received, send WasRedirectedToRequest and return nil to ignore the redirect.
+
</ins><span class="cx"> 2015-10-08  Lucas Forschler  &lt;lforschler@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rollout r190745
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKit2SharedNetworkCustomProtocolsCocoaCustomProtocolManagerCocoamm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -259,6 +259,20 @@
</span><span class="cx">     removeCustomProtocol(protocol.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CustomProtocolManager::wasRedirectedToRequest(uint64_t customProtocolID, const WebCore::ResourceRequest&amp; request, const WebCore::ResourceResponse&amp; redirectResponse)
+{
+    RetainPtr&lt;WKCustomProtocol&gt; protocol = protocolForID(customProtocolID);
+    if (!protocol)
+        return;
+
+    RetainPtr&lt;NSURLRequest&gt; nsRequest = request.nsURLRequest(WebCore::DoNotUpdateHTTPBody);
+    RetainPtr&lt;NSURLResponse&gt; nsRedirectResponse = redirectResponse.nsURLResponse();
+
+    dispatchOnResourceLoaderRunLoop([protocol, nsRequest, nsRedirectResponse]() {
+        [[protocol client] URLProtocol:protocol.get() wasRedirectedToRequest:nsRequest.get() redirectResponse:nsRedirectResponse.get()];
+    });
+}
+
</ins><span class="cx"> RetainPtr&lt;WKCustomProtocol&gt; CustomProtocolManager::protocolForID(uint64_t customProtocolID)
</span><span class="cx"> {
</span><span class="cx">     MutexLocker locker(m_customProtocolMapMutex);
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKit2SharedNetworkCustomProtocolsCustomProtocolManagerh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.h (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.h        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.h        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class ResourceError;
</span><ins>+class ResourceRequest;
</ins><span class="cx"> class ResourceResponse;
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="lines">@@ -94,6 +95,7 @@
</span><span class="cx">     void didLoadData(uint64_t customProtocolID, const IPC::DataReference&amp;);
</span><span class="cx">     void didReceiveResponse(uint64_t customProtocolID, const WebCore::ResourceResponse&amp;, uint32_t cacheStoragePolicy);
</span><span class="cx">     void didFinishLoading(uint64_t customProtocolID);
</span><ins>+    void wasRedirectedToRequest(uint64_t customProtocolID, const WebCore::ResourceRequest&amp;, const WebCore::ResourceResponse&amp; redirectResponse);
</ins><span class="cx"> 
</span><span class="cx">     ChildProcess* m_childProcess;
</span><span class="cx">     RefPtr&lt;WorkQueue&gt; m_messageQueue;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKit2SharedNetworkCustomProtocolsCustomProtocolManagermessagesin"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.messages.in (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.messages.in        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.messages.in        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx">     DidLoadData(uint64_t customProtocolID, IPC::DataReference data)
</span><span class="cx">     DidReceiveResponse(uint64_t customProtocolID, WebCore::ResourceResponse response, uint32_t cacheStoragePolicy)
</span><span class="cx">     DidFinishLoading(uint64_t customProtocolID)
</span><ins>+    WasRedirectedToRequest(uint64_t customProtocolID, WebCore::ResourceRequest request, WebCore::ResourceResponse redirectResponse);
</ins><span class="cx"> 
</span><span class="cx">     RegisterScheme(String name)
</span><span class="cx">     UnregisterScheme(String name)
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKit2SharedNetworkCustomProtocolssoupCustomProtocolManagerSoupcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebKit2/Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -106,4 +106,9 @@
</span><span class="cx">     m_impl-&gt;didFinishLoading(customProtocolID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CustomProtocolManager::wasRedirectedToRequest(uint64_t, const WebCore::ResourceRequest&amp;, const WebCore::ResourceResponse&amp;)
+{
+    notImplemented();
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKit2UIProcessNetworkCustomProtocolsmacCustomProtocolManagerProxyMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit2/UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -110,6 +110,10 @@
</span><span class="cx"> 
</span><span class="cx"> - (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse
</span><span class="cx"> {
</span><ins>+    if (redirectResponse) {
+        _connection-&gt;send(Messages::CustomProtocolManager::WasRedirectedToRequest(_customProtocolID, request, redirectResponse), 0);
+        return nil;
+    }
</ins><span class="cx">     return request;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKit2WebProcessWebPageWebFramecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -283,7 +283,7 @@
</span><span class="cx">         // This can happen if there is no loader because the main resource is in the WebCore memory cache,
</span><span class="cx">         // or because the conversion was attempted when not calling SubresourceLoader::didReceiveResponse().
</span><span class="cx">         uint64_t mainResourceLoadIdentifier;
</span><del>-        if (mainResourceLoader &amp;&amp; mainResourceLoader-&gt;callingDidReceiveResponse())
</del><ins>+        if (mainResourceLoader)
</ins><span class="cx">             mainResourceLoadIdentifier = mainResourceLoader-&gt;identifier();
</span><span class="cx">         else
</span><span class="cx">             mainResourceLoadIdentifier = 0;
</span><span class="lines">@@ -293,7 +293,7 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (!mainResourceLoader || !mainResourceLoader-&gt;callingDidReceiveResponse()) {
</del><ins>+    if (!mainResourceLoader) {
</ins><span class="cx">         // The main resource has already been loaded. Start a new download instead.
</span><span class="cx">         webProcess.downloadManager().startDownload(policyDownloadID, request);
</span><span class="cx">         return;
</span></span></pre></div>
<a id="branchessafari601branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/ChangeLog (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/ChangeLog        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/ChangeLog        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -1,3 +1,210 @@
</span><ins>+2015-10-08  Andy Estes  &lt;aestes@apple.com&gt;
+
+        Merge r188150, r188517, r188844, r188845, r188851, r188852, r188880, r188881, r188988, r189193, r189289, and r190133.
+
+    2015-09-22  Andy Estes  &lt;aestes@apple.com&gt;
+
+            ContentFiltering.AllowDownloadAfterAddData is very flaky
+            https://bugs.webkit.org/show_bug.cgi?id=148885
+            &lt;rdar://problem/22729563&gt;
+
+            Reviewed by Alexey Proskuryakov.
+
+            The AllowDownload* tests were relying on -_downloadDidStart: being called before -webView:didFinishNavigation:,
+            but there is no guarantee of this. For tests that should allow a download, spin the runloop until
+            -_downloadDidStart: is called. The test will now timeout on failure, but will no longer produce false failures.
+
+            * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm:
+            (downloadTest):
+
+    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;
+
+            [Content Filtering] Determine navigation and content policy before continuing to filter a load
+            https://bugs.webkit.org/show_bug.cgi?id=148506
+
+            Reviewed by Brady Eidson.
+
+            Added download API tests covering every decision and decision point.
+            Removed _WKDownload.AsynchronousDownloadPolicy in favor of these new tests.
+
+            * TestWebKitAPI/Configurations/Base.xcconfig: Added $(BUILT_PRODUCTS_DIR)/WebCoreTestSupport to the header search path.
+            * TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig: Removed it from here.
+            * TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm:
+            (-[BundleParametersPlugIn observeValueForKeyPath:ofObject:change:context:]): Called -valueForKeyPath:, which
+            returns an id, instead of -valueForKey:, which always returns an NSString even if the object is of another type.
+            * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm: Added a class that can send a MockContentFilter
+            decision and decision point as a bundle parameter.
+            (+[MockContentFilterEnabler supportsSecureCoding]):
+            (-[MockContentFilterEnabler copyWithZone:]):
+            (-[MockContentFilterEnabler initWithCoder:]):
+            (-[MockContentFilterEnabler initWithDecision:decisionPoint:]):
+            (-[MockContentFilterEnabler encodeWithCoder:]):
+            (configurationWithContentFilterSettings): Added a helper function to create a WKWebViewConfiguration with MockConentFilter settings.
+            (TEST): Renamed ContentFiltering.ServerRedirect to ContentFiltering.URLAfterServerRedirect.
+            (-[BecomeDownloadDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]): Decided _WKNavigationResponsePolicyBecomeDownload.
+            (-[BecomeDownloadDelegate webView:didFailProvisionalNavigation:withError:]): Set isDone to true.
+            (-[BecomeDownloadDelegate webView:didFinishNavigation:]): Ditto.
+            (-[ContentFilteringDownloadDelegate _downloadDidStart:]): Set downloadDidStart to true.
+            (downloadTest): Added a helper function to test downloads with a given decision and decision point.
+            * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFilteringPlugIn.mm: Added a corresponding bundle class that decodes
+            the MockContentFilter decision and decision point, and sets these values in the MockContentFilterSettings
+            singleton. This class is duplicated in the bundle to prevent TestWebKitAPI from having to link to WebCoreTestSupport.
+            (+[MockContentFilterEnabler supportsSecureCoding]):
+            (-[MockContentFilterEnabler copyWithZone:]):
+            (-[MockContentFilterEnabler initWithCoder:]):
+            (-[MockContentFilterEnabler dealloc]):
+            (-[MockContentFilterEnabler encodeWithCoder:]):
+            (-[ContentFilteringPlugIn webProcessPlugIn:initializeWithObject:]): Start observing changes to the MockContentFilterEnabler key path.
+            (-[ContentFilteringPlugIn dealloc]): Stop observing.
+            (-[ContentFilteringPlugIn observeValueForKeyPath:ofObject:change:context:]): Store a MockContentFilterEnabler in _contentFilterEnabler.
+            (+[ServerRedirectPlugIn initialize]): Deleted.
+            * TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm:
+            (-[AsynchronousDownloadNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]): Deleted.
+            (-[AsynchronousDownloadDelegate _downloadDidStart:]): Deleted.
+            (TEST): Deleted.
+
+    2015-08-26  Andy Estes  &lt;aestes@apple.com&gt;
+
+            Crash when following a Google search link to Twitter with Limit Adult Content enabled
+            https://bugs.webkit.org/show_bug.cgi?id=147651
+
+            Rubber-stamped by Brady Eidson.
+
+            Taught TestRunner how to decide the navigation policy after a delay.
+
+            * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+            * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+            (WTR::InjectedBundlePage::decidePolicyForNavigationAction):
+            * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+            (WTR::TestRunner::setShouldDecideNavigationPolicyAfterDelay):
+            * WebKitTestRunner/InjectedBundle/TestRunner.h:
+            (WTR::TestRunner::shouldDecideNavigationPolicyAfterDelay):
+            * WebKitTestRunner/TestController.cpp:
+            (WTR::TestController::initialize):
+            (WTR::TestController::resetStateToConsistentValues):
+            (WTR::TestController::decidePolicyForNavigationAction):
+            * WebKitTestRunner/TestController.h:
+            (WTR::TestController::setShouldDecideNavigationPolicyAfterDelay):
+            * WebKitTestRunner/TestInvocation.cpp:
+            (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+
+    2015-08-24  Andy Estes  &lt;aestes@apple.com&gt;
+
+            REGRESSION (r188851): WebKit2.BundleParameters fails on iOS
+
+            * TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig: Specify LD_RUNPATH_SEARCH_PATHS correctly for iOS.
+
+    2015-08-23  Andy Estes  &lt;aestes@apple.com&gt;
+
+            Addressed a missed piece of review feedback from r188851.
+
+            * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm:
+
+    2015-08-23  Andy Estes  &lt;aestes@apple.com&gt;
+
+            [Content Filtering] REGRESSION (r182356): Provisional URL is incorrect in didReceiveServerRedirectForProvisionalLoadForFrame when Content Filtering is enabled
+            https://bugs.webkit.org/show_bug.cgi?id=147872
+            rdar://problem/22044000
+
+            Reviewed by Dan Bernstein.
+            
+            Added an API test.
+
+            * TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig: Linked libWebCoreTestSupport in order to use MockContentFilter.
+            * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+            * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm: Added.
+            (-[ServerRedirectNavigationDelegate webView:didStartProvisionalNavigation:]): Expect the initial request URL.
+            (-[ServerRedirectNavigationDelegate webView:didReceiveServerRedirectForProvisionalNavigation:]): Expect the redirect URL.
+            (-[ServerRedirectNavigationDelegate webView:didCommitNavigation:]):
+            (TEST): Tested that -[WKWebView URL] is updated after a redirect when content filtering is enabled.
+            * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFilteringPlugIn.mm: Added.
+            (+[ServerRedirectPlugIn initialize]): Enable MockContentFilter.
+            * TestWebKitAPI/cocoa/TestProtocol.h: Renamed from Tools/TestWebKitAPI/mac/TestProtocol.h.
+            * TestWebKitAPI/cocoa/TestProtocol.mm: Renamed from Tools/TestWebKitAPI/mac/TestProtocol.mm.
+
+    2015-08-23  Andy Estes  &lt;aestes@apple.com&gt;
+
+            Fixed the 32-bit Mac build after r188844.
+
+            * TestWebKitAPI/WKWebViewConfigurationExtras.h:
+            * TestWebKitAPI/WKWebViewConfigurationExtras.mm:
+
+    2015-08-22  Andy Estes  &lt;aestes@apple.com&gt;
+
+            [Cocoa] API tests using the Modern WebKit API should be able to create web process plug-ins
+            https://bugs.webkit.org/show_bug.cgi?id=148317
+
+            Reviewed by Dan Bernstein.
+
+            Added the ability for Modern WebKit API tests to create WKWebProcessPlugIns. A test can create a plug-in by
+            creating a class that conforms to WKWebProcessPlugIn, adding it to the WebProcessPlugIn target, and using the
+            WKWebViewConfiguration returned by +[WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:]
+            when creating WKWebViews.
+
+            Since TestWebKitAPI relies on a bundle parameter to know which test class to instantiate in the plug-in, I also
+            added a new API test for bundle parameters.
+
+            * TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig: Added. Named the bundle TestWebKitAPI.wkbundle and
+            named its executable TestWebKitAPI.bundle.
+            * TestWebKitAPI/PlatformUtilities.h: Declared TestPlugInClassNameParameter.
+            * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added the WebProcessPlugIn target.
+            * TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm: Added.
+            (TEST): Tested bundle parameters by verifying that parameter changes in the UI process are observed in the bundle.
+            * TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm: Added.
+            (-[BundleParametersPlugIn webProcessPlugIn:didCreateBrowserContextController:]): Started observing changes to a
+            bundle parameter and asked for an initial notification.
+            (-[BundleParametersPlugIn dealloc]): Stopped observing changes to a bundle parameter.
+            (-[BundleParametersPlugIn observeValueForKeyPath:ofObject:change:context:]): When a bundle parameter changes,
+            mirror its value in the main frame's JSContext.
+            * TestWebKitAPI/WKWebViewConfigurationExtras.h: Added.
+            * TestWebKitAPI/WKWebViewConfigurationExtras.mm: Added.
+            (+[WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:]): Created a configuration with
+            TestWebKitAPI's bundle URL and set a bundle parameter indicating the test plug-in's class name.
+            * TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm: Defined TestPlugInClassNameParameter.
+            * TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist: Added. Set the principal class to WebProcessPlugIn.
+            * TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm: Added.
+            (-[WebProcessPlugIn webProcessPlugIn:initializeWithObject:]): Forwarded to a newly-created test class instance.
+            (-[WebProcessPlugIn respondsToSelector:]): Returned YES if the test class instance response.
+            (-[WebProcessPlugIn forwardingTargetForSelector:]): Forwarded unimplemented methods to the test class instance.
+
+    2015-08-11  Andy Estes  &lt;aestes@apple.com&gt;
+
+            [Cocoa] Add redirect support to CustomProtocolManager
+            https://bugs.webkit.org/show_bug.cgi?id=147871
+
+            Reviewed by Dan Bernstein.
+
+            Updated WebKit2CustomProtocolsTest.MainResource to generate a redirect response.
+
+            * TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:
+            (TestWebKitAPI::TEST): Unregesitered TestProtocol.
+            * TestWebKitAPI/Tests/WebKit2/custom-protocol-sync-xhr.html: Changed scheme to http.
+            * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:
+            (-[CustomProtocolsLoadDelegate browsingContextControllerDidStartProvisionalLoad:]): Expected a certain provisional URL.
+            (-[CustomProtocolsLoadDelegate browsingContextControllerDidReceiveServerRedirectForProvisionalLoad:]): Ditto.
+            (-[CustomProtocolsLoadDelegate browsingContextControllerDidCommitLoad:]): Expected a certain committed URL.
+            (-[CustomProtocolsLoadDelegate browsingContextControllerDidFinishLoad:]): Expected isLoading to be false.
+            (TestWebKitAPI::TEST): Used the new load delegate and unregistered TestProtocol.
+            * TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm:
+            (TestWebKitAPI::TEST): Unregistered TestProtocol.
+            * TestWebKitAPI/mac/TestProtocol.mm: Changed scheme to http.
+            (+[TestProtocol canInitWithRequest:]): Changed to use property syntax.
+            (-[TestProtocol startLoading]): Taught to handle redirect responses.
+
+    2015-08-13  Andy Estes  &lt;aestes@apple.com&gt;
+
+            [Cocoa] Downloads do not start if policy decision is made asynchronously
+            https://bugs.webkit.org/show_bug.cgi?id=147985
+
+            Reviewed by Brady Eidson.
+
+            Added a new API test.
+
+            * TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm:
+            (-[AsynchronousDownloadNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
+            (-[AsynchronousDownloadDelegate _downloadDidStart:]):
+            (TEST):
+
</ins><span class="cx"> 2015-09-08  Andy Estes  &lt;aestes@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reverted r189001.
</span></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPIConfigurationsBasexcconfig"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/TestWebKitAPI/Configurations/Base.xcconfig (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/Configurations/Base.xcconfig        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/Configurations/Base.xcconfig        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx"> CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
</span><span class="cx"> CLANG_CXX_LIBRARY = libc++;
</span><span class="cx"> CLANG_WARN_CXX0X_EXTENSIONS = NO;
</span><del>-HEADER_SEARCH_PATHS = ${BUILT_PRODUCTS_DIR}/usr/local/include $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(WEBCORE_PRIVATE_HEADERS_DIR)/icu;
</del><ins>+HEADER_SEARCH_PATHS = ${BUILT_PRODUCTS_DIR}/usr/local/include $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(WEBCORE_PRIVATE_HEADERS_DIR)/icu $(BUILT_PRODUCTS_DIR)/WebCoreTestSupport;
</ins><span class="cx"> FRAMEWORK_SEARCH_PATHS = $(FRAMEWORK_SEARCH_PATHS_$(PLATFORM_NAME));
</span><span class="cx"> FRAMEWORK_SEARCH_PATHS_macosx = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPIConfigurationsWebProcessPlugInxcconfig"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/Tools/TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig                                (rev 0)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+//
+// Copyright (C) 2015 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.
+//
+
+INFOPLIST_FILE = cocoa/WebProcessPlugIn/Info.plist;
+PRODUCT_NAME = TestWebKitAPI;
+EXECUTABLE_SUFFIX = .bundle;
+WRAPPER_EXTENSION = wkbundle;
+OTHER_LDFLAGS = $(inherited) -framework JavaScriptCore -framework WebKit -lWebCoreTestSupport;
+LD_RUNPATH_SEARCH_PATHS[sdk=macosx*] = &quot;@loader_path/../../..&quot;;
+LD_RUNPATH_SEARCH_PATHS[sdk=iphone*] = &quot;@loader_path/..&quot;;
</ins></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPIPlatformUtilitiesh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/TestWebKitAPI/PlatformUtilities.h (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/PlatformUtilities.h        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/PlatformUtilities.h        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -75,6 +75,10 @@
</span><span class="cx"> #define EXPECT_WK_STREQ(expected, actual) \
</span><span class="cx">     EXPECT_PRED_FORMAT2(TestWebKitAPI::Util::assertWKStringEqual, expected, actual)
</span><span class="cx"> 
</span><ins>+#if WK_API_ENABLED
+extern NSString * const TestPlugInClassNameParameter;
+#endif
+
</ins><span class="cx"> } // namespace Util
</span><span class="cx"> } // namespace TestWebKitAPI
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -86,7 +86,6 @@
</span><span class="cx">                 7CCE7EA71A411A1300447C4C /* PlatformWebViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC90955C125548AA00083756 /* PlatformWebViewMac.mm */; };
</span><span class="cx">                 7CCE7EA81A411A1900447C4C /* SyntheticBackingScaleFactorWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = C081224413FC19EC00DC39AE /* SyntheticBackingScaleFactorWindow.m */; };
</span><span class="cx">                 7CCE7EA91A411A1D00447C4C /* TestBrowsingContextLoadDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29AB8AA2164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm */; };
</span><del>-                7CCE7EAA1A411A2400447C4C /* TestProtocol.mm in Sources */ = {isa = PBXBuildFile; fileRef = 290F4279172A23A500939FF0 /* TestProtocol.mm */; };
</del><span class="cx">                 7CCE7EAB1A411A2400447C4C /* WebKitAgnosticTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = C08587BD13FE956C001EF4E5 /* WebKitAgnosticTest.mm */; };
</span><span class="cx">                 7CCE7EAC1A411A3400447C4C /* Counters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C6BBD8B19CEA63000C1F5E0 /* Counters.cpp */; };
</span><span class="cx">                 7CCE7EAD1A411A3400447C4C /* JavaScriptTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0ADBE7A12FCA4D000D2C129 /* JavaScriptTest.cpp */; };
</span><span class="lines">@@ -260,6 +259,14 @@
</span><span class="cx">                 93F7E86F14DC8E5C00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F7E86E14DC8E5B00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp */; };
</span><span class="cx">                 9B26FCCA159D16DE00CC3765 /* HTMLFormCollectionNamedItem.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */; };
</span><span class="cx">                 9B4F8FA7159D52DD002D9F94 /* HTMLCollectionNamedItem.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B4F8FA6159D52CA002D9F94 /* HTMLCollectionNamedItem.html */; };
</span><ins>+                A13EBBAA1B87428D00097110 /* WebProcessPlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = A13EBBA91B87428D00097110 /* WebProcessPlugIn.mm */; };
+                A13EBBAB1B87434600097110 /* PlatformUtilitiesCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F139E721A423A2B00F590F5 /* PlatformUtilitiesCocoa.mm */; };
+                A13EBBB01B87436F00097110 /* BundleParametersPlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = A13EBBAE1B87436F00097110 /* BundleParametersPlugIn.mm */; };
+                A13EBBB11B87438000097110 /* BundleParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = A13EBBAC1B87436F00097110 /* BundleParameters.mm */; };
+                A14FC5851B89739100D107EB /* WKWebViewConfigurationExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = A14FC5831B89739100D107EB /* WKWebViewConfigurationExtras.mm */; };
+                A14FC5881B8991BF00D107EB /* ContentFiltering.mm in Sources */ = {isa = PBXBuildFile; fileRef = A14FC5861B8991B600D107EB /* ContentFiltering.mm */; };
+                A14FC58B1B89927100D107EB /* ContentFilteringPlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = A14FC5891B89927100D107EB /* ContentFilteringPlugIn.mm */; };
+                A14FC5901B8AE36F00D107EB /* TestProtocol.mm in Sources */ = {isa = PBXBuildFile; fileRef = A14FC58E1B8AE36500D107EB /* TestProtocol.mm */; };
</ins><span class="cx">                 A57A34F216AF6B2B00C2501F /* PageVisibilityStateWithWindowChanges.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A57A34F116AF69E200C2501F /* PageVisibilityStateWithWindowChanges.html */; };
</span><span class="cx">                 A5E2027515B21F6E00C13E14 /* WindowlessWebViewWithMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A5E2027015B2180600C13E14 /* WindowlessWebViewWithMedia.html */; };
</span><span class="cx">                 B55AD1D5179F3B3000AC1494 /* PreventImageLoadWithAutoResizing_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55AD1D3179F3ABF00AC1494 /* PreventImageLoadWithAutoResizing_Bundle.cpp */; };
</span><span class="lines">@@ -320,6 +327,13 @@
</span><span class="cx">                         remoteGlobalIDString = 7CCE7E8B1A41144E00447C4C;
</span><span class="cx">                         remoteInfo = TestWebKitAPILibrary;
</span><span class="cx">                 };
</span><ins>+                A13EBBB21B87441900097110 /* PBXContainerItemProxy */ = {
+                        isa = PBXContainerItemProxy;
+                        containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+                        proxyType = 1;
+                        remoteGlobalIDString = A13EBB481B87339E00097110;
+                        remoteInfo = WebProcessPlugIn;
+                };
</ins><span class="cx">                 BC575A95126E74E7006F0F12 /* PBXContainerItemProxy */ = {
</span><span class="cx">                         isa = PBXContainerItemProxy;
</span><span class="cx">                         containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
</span><span class="lines">@@ -468,8 +482,6 @@
</span><span class="cx">                 290A9BB81735F42300D71BBC /* OpenNewWindow.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = OpenNewWindow.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 290F4274172A1FDE00939FF0 /* custom-protocol-sync-xhr.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = &quot;custom-protocol-sync-xhr.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 290F4276172A232C00939FF0 /* CustomProtocolsSyncXHRTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CustomProtocolsSyncXHRTest.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                290F4279172A23A500939FF0 /* TestProtocol.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestProtocol.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
-                290F427A172A23A500939FF0 /* TestProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestProtocol.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 291861FD17BD4DC700D4E41E /* StopLoadingFromDidFinishLoading.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StopLoadingFromDidFinishLoading.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2943BE84161DFEB800999E3D /* UserContentTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = UserContentTest.mm; path = WebKit2ObjC/UserContentTest.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 297234B2173AD04800983601 /* CustomProtocolsInvalidScheme.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CustomProtocolsInvalidScheme.mm; path = WebKit2ObjC/CustomProtocolsInvalidScheme.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -611,6 +623,18 @@
</span><span class="cx">                 9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = HTMLFormCollectionNamedItem.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9B4F8FA3159D52B1002D9F94 /* HTMLCollectionNamedItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HTMLCollectionNamedItem.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9B4F8FA6159D52CA002D9F94 /* HTMLCollectionNamedItem.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = HTMLCollectionNamedItem.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A13EBB491B87339E00097110 /* TestWebKitAPI.wkbundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestWebKitAPI.wkbundle; sourceTree = BUILT_PRODUCTS_DIR; };
+                A13EBB521B87346600097110 /* WebProcessPlugIn.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebProcessPlugIn.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A13EBB541B8734E000097110 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A13EBBA91B87428D00097110 /* WebProcessPlugIn.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessPlugIn.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A13EBBAC1B87436F00097110 /* BundleParameters.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundleParameters.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A13EBBAE1B87436F00097110 /* BundleParametersPlugIn.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundleParametersPlugIn.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A14FC5831B89739100D107EB /* WKWebViewConfigurationExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewConfigurationExtras.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A14FC5841B89739100D107EB /* WKWebViewConfigurationExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewConfigurationExtras.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A14FC5861B8991B600D107EB /* ContentFiltering.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentFiltering.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A14FC5891B89927100D107EB /* ContentFilteringPlugIn.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentFilteringPlugIn.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A14FC58D1B8AE36500D107EB /* TestProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestProtocol.h; path = cocoa/TestProtocol.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A14FC58E1B8AE36500D107EB /* TestProtocol.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestProtocol.mm; path = cocoa/TestProtocol.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A1A4FE5D18DD3DB700B5EA8A /* Download.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Download.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1FDFD2E19C288BB005148A4 /* WKImageCreateCGImageCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKImageCreateCGImageCrash.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A57A34EF16AF677200C2501F /* PageVisibilityStateWithWindowChanges.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageVisibilityStateWithWindowChanges.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -828,7 +852,12 @@
</span><span class="cx">                 0F139E711A423A1D00F590F5 /* cocoa */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                A13EBB441B87332B00097110 /* WebProcessPlugIn */,
</ins><span class="cx">                                 0F139E721A423A2B00F590F5 /* PlatformUtilitiesCocoa.mm */,
</span><ins>+                                A14FC58D1B8AE36500D107EB /* TestProtocol.h */,
+                                A14FC58E1B8AE36500D107EB /* TestProtocol.mm */,
+                                A14FC5841B89739100D107EB /* WKWebViewConfigurationExtras.h */,
+                                A14FC5831B89739100D107EB /* WKWebViewConfigurationExtras.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = cocoa;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -847,6 +876,7 @@
</span><span class="cx">                                 8DD76FA10486AA7600D96B5E /* TestWebKitAPI */,
</span><span class="cx">                                 BC575980126E74AF006F0F12 /* InjectedBundleTestWebKitAPI.bundle */,
</span><span class="cx">                                 7CCE7E8C1A41144E00447C4C /* libTestWebKitAPI.a */,
</span><ins>+                                A13EBB491B87339E00097110 /* TestWebKitAPI.wkbundle */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = Products;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -855,6 +885,10 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 7CEFA9641AC0B9E200B910FD /* _WKUserContentExtensionStore.mm */,
</span><ins>+                                A13EBBAC1B87436F00097110 /* BundleParameters.mm */,
+                                A13EBBAE1B87436F00097110 /* BundleParametersPlugIn.mm */,
+                                A14FC5861B8991B600D107EB /* ContentFiltering.mm */,
+                                A14FC5891B89927100D107EB /* ContentFilteringPlugIn.mm */,
</ins><span class="cx">                                 A1A4FE5D18DD3DB700B5EA8A /* Download.mm */,
</span><span class="cx">                                 2D1FE0AF1AD465C1006CD9E6 /* FixedLayoutSize.mm */,
</span><span class="cx">                                 37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */,
</span><span class="lines">@@ -923,6 +957,16 @@
</span><span class="cx">                         path = darwin;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                A13EBB441B87332B00097110 /* WebProcessPlugIn */ = {
+                        isa = PBXGroup;
+                        children = (
+                                A13EBB541B8734E000097110 /* Info.plist */,
+                                A13EBBA91B87428D00097110 /* WebProcessPlugIn.mm */,
+                        );
+                        name = WebProcessPlugIn;
+                        path = cocoa/WebProcessPlugIn;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 BC029B1A1486B23800817DA9 /* ns */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -967,6 +1011,7 @@
</span><span class="cx">                                 BC575AE2126E88B1006F0F12 /* InjectedBundle.xcconfig */,
</span><span class="cx">                                 BC90958012554CF900083756 /* TestWebKitAPI.xcconfig */,
</span><span class="cx">                                 7CCE7EA31A4115CB00447C4C /* TestWebKitAPILibrary.xcconfig */,
</span><ins>+                                A13EBB521B87346600097110 /* WebProcessPlugIn.xcconfig */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = Configurations;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -1186,8 +1231,6 @@
</span><span class="cx">                                 C081224413FC19EC00DC39AE /* SyntheticBackingScaleFactorWindow.m */,
</span><span class="cx">                                 29AB8AA3164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.h */,
</span><span class="cx">                                 29AB8AA2164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm */,
</span><del>-                                290F427A172A23A500939FF0 /* TestProtocol.h */,
-                                290F4279172A23A500939FF0 /* TestProtocol.mm */,
</del><span class="cx">                                 C08587BE13FE956C001EF4E5 /* WebKitAgnosticTest.h */,
</span><span class="cx">                                 C08587BD13FE956C001EF4E5 /* WebKitAgnosticTest.mm */,
</span><span class="cx">                         );
</span><span class="lines">@@ -1366,6 +1409,7 @@
</span><span class="cx">                         buildRules = (
</span><span class="cx">                         );
</span><span class="cx">                         dependencies = (
</span><ins>+                                A13EBBB31B87441900097110 /* PBXTargetDependency */,
</ins><span class="cx">                                 BC575A96126E74E7006F0F12 /* PBXTargetDependency */,
</span><span class="cx">                                 7CCE7F511A4124DB00447C4C /* PBXTargetDependency */,
</span><span class="cx">                         );
</span><span class="lines">@@ -1375,6 +1419,21 @@
</span><span class="cx">                         productReference = 8DD76FA10486AA7600D96B5E /* TestWebKitAPI */;
</span><span class="cx">                         productType = &quot;com.apple.product-type.tool&quot;;
</span><span class="cx">                 };
</span><ins>+                A13EBB481B87339E00097110 /* WebProcessPlugIn */ = {
+                        isa = PBXNativeTarget;
+                        buildConfigurationList = A13EBB4C1B87339E00097110 /* Build configuration list for PBXNativeTarget &quot;WebProcessPlugIn&quot; */;
+                        buildPhases = (
+                                A13EBB451B87339E00097110 /* Sources */,
+                        );
+                        buildRules = (
+                        );
+                        dependencies = (
+                        );
+                        name = WebProcessPlugIn;
+                        productName = WebProcessPlugIn;
+                        productReference = A13EBB491B87339E00097110 /* TestWebKitAPI.wkbundle */;
+                        productType = &quot;com.apple.product-type.bundle&quot;;
+                };
</ins><span class="cx">                 BC57597F126E74AF006F0F12 /* InjectedBundleTestWebKitAPI */ = {
</span><span class="cx">                         isa = PBXNativeTarget;
</span><span class="cx">                         buildConfigurationList = BC575986126E74AF006F0F12 /* Build configuration list for PBXNativeTarget &quot;InjectedBundleTestWebKitAPI&quot; */;
</span><span class="lines">@@ -1404,6 +1463,9 @@
</span><span class="cx">                                         7CCE7E8B1A41144E00447C4C = {
</span><span class="cx">                                                 CreatedOnToolsVersion = 6.3;
</span><span class="cx">                                         };
</span><ins>+                                        A13EBB481B87339E00097110 = {
+                                                CreatedOnToolsVersion = 7.0;
+                                        };
</ins><span class="cx">                                 };
</span><span class="cx">                         };
</span><span class="cx">                         buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject &quot;TestWebKitAPI&quot; */;
</span><span class="lines">@@ -1423,6 +1485,7 @@
</span><span class="cx">                                 8DD76F960486AA7600D96B5E /* TestWebKitAPI */,
</span><span class="cx">                                 BC57597F126E74AF006F0F12 /* InjectedBundleTestWebKitAPI */,
</span><span class="cx">                                 7CCE7E8B1A41144E00447C4C /* TestWebKitAPILibrary */,
</span><ins>+                                A13EBB481B87339E00097110 /* WebProcessPlugIn */,
</ins><span class="cx">                         );
</span><span class="cx">                 };
</span><span class="cx"> /* End PBXProject section */
</span><span class="lines">@@ -1517,6 +1580,7 @@
</span><span class="cx">                                 7CCE7EC41A411A7E00447C4C /* JSWrapperForNodeInWebFrame.mm in Sources */,
</span><span class="cx">                                 7CCE7F061A411AE600447C4C /* LayoutMilestonesWithAllContentInFrame.cpp in Sources */,
</span><span class="cx">                                 7CCE7EDF1A411A9200447C4C /* LayoutUnit.cpp in Sources */,
</span><ins>+                                A13EBBB11B87438000097110 /* BundleParameters.mm in Sources */,
</ins><span class="cx">                                 7CCE7F381A411B8E00447C4C /* ListHashSet.cpp in Sources */,
</span><span class="cx">                                 37D36ED71AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm in Sources */,
</span><span class="cx">                                 7CCE7EFE1A411AE600447C4C /* LoadAlternateHTMLStringWithNonDirectoryURL.cpp in Sources */,
</span><span class="lines">@@ -1525,6 +1589,7 @@
</span><span class="cx">                                 7CCE7F3A1A411B8E00447C4C /* MathExtras.cpp in Sources */,
</span><span class="cx">                                 7C89D2AC1A69B80D003A5FDE /* WKPageConfiguration.cpp in Sources */,
</span><span class="cx">                                 7CCE7F391A411B8E00447C4C /* MD5.cpp in Sources */,
</span><ins>+                                A14FC5901B8AE36F00D107EB /* TestProtocol.mm in Sources */,
</ins><span class="cx">                                 7CCE7F3B1A411B8E00447C4C /* MediaTime.cpp in Sources */,
</span><span class="cx">                                 7CCE7EB21A411A5100447C4C /* MemoryCacheAddImageToCacheIOS.mm in Sources */,
</span><span class="cx">                                 7CCE7EC51A411A7E00447C4C /* MemoryCacheDisableWithinResourceLoadDelegate.mm in Sources */,
</span><span class="lines">@@ -1532,6 +1597,7 @@
</span><span class="cx">                                 7CCE7F3C1A411B8E00447C4C /* MetaAllocator.cpp in Sources */,
</span><span class="cx">                                 7CCE7F011A411AE600447C4C /* MouseMoveAfterCrash.cpp in Sources */,
</span><span class="cx">                                 7CCE7F241A411AF600447C4C /* Navigation.mm in Sources */,
</span><ins>+                                A14FC5881B8991BF00D107EB /* ContentFiltering.mm in Sources */,
</ins><span class="cx">                                 7CCE7F021A411AE600447C4C /* NewFirstVisuallyNonEmptyLayout.cpp in Sources */,
</span><span class="cx">                                 7CCE7F031A411AE600447C4C /* NewFirstVisuallyNonEmptyLayoutFails.cpp in Sources */,
</span><span class="cx">                                 7CCE7F041A411AE600447C4C /* NewFirstVisuallyNonEmptyLayoutForImages.cpp in Sources */,
</span><span class="lines">@@ -1583,6 +1649,7 @@
</span><span class="cx">                                 7CCE7ECE1A411A7E00447C4C /* StopLoadingFromDidFinishLoading.mm in Sources */,
</span><span class="cx">                                 7CCE7ECF1A411A7E00447C4C /* StopLoadingFromDidReceiveResponse.mm in Sources */,
</span><span class="cx">                                 7CCE7F441A411B8E00447C4C /* StringBuilder.cpp in Sources */,
</span><ins>+                                A14FC5851B89739100D107EB /* WKWebViewConfigurationExtras.mm in Sources */,
</ins><span class="cx">                                 7CB184C61AA3F2100066EDFD /* ContentExtensions.cpp in Sources */,
</span><span class="cx">                                 7CCE7ED01A411A7E00447C4C /* StringByEvaluatingJavaScriptFromString.mm in Sources */,
</span><span class="cx">                                 7CCE7F451A411B8E00447C4C /* StringHasher.cpp in Sources */,
</span><span class="lines">@@ -1595,7 +1662,6 @@
</span><span class="cx">                                 7CCE7F491A411B8E00447C4C /* TemporaryChange.cpp in Sources */,
</span><span class="cx">                                 7CCE7F161A411AE600447C4C /* TerminateTwice.cpp in Sources */,
</span><span class="cx">                                 7CCE7EA91A411A1D00447C4C /* TestBrowsingContextLoadDelegate.mm in Sources */,
</span><del>-                                7CCE7EAA1A411A2400447C4C /* TestProtocol.mm in Sources */,
</del><span class="cx">                                 7CCE7EAE1A411A3400447C4C /* TestsController.cpp in Sources */,
</span><span class="cx">                                 CE3524F91B1441C40028A7C5 /* TextFieldDidBeginAndEndEditing.cpp in Sources */,
</span><span class="cx">                                 7CCE7EDD1A411A9200447C4C /* TimeRanges.cpp in Sources */,
</span><span class="lines">@@ -1654,6 +1720,17 @@
</span><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span><ins>+                A13EBB451B87339E00097110 /* Sources */ = {
+                        isa = PBXSourcesBuildPhase;
+                        buildActionMask = 2147483647;
+                        files = (
+                                A13EBBAA1B87428D00097110 /* WebProcessPlugIn.mm in Sources */,
+                                A13EBBB01B87436F00097110 /* BundleParametersPlugIn.mm in Sources */,
+                                A13EBBAB1B87434600097110 /* PlatformUtilitiesCocoa.mm in Sources */,
+                                A14FC58B1B89927100D107EB /* ContentFilteringPlugIn.mm in Sources */,
+                        );
+                        runOnlyForDeploymentPostprocessing = 0;
+                };
</ins><span class="cx">                 BC57597D126E74AF006F0F12 /* Sources */ = {
</span><span class="cx">                         isa = PBXSourcesBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="lines">@@ -1705,6 +1782,11 @@
</span><span class="cx">                         target = 7CCE7E8B1A41144E00447C4C /* TestWebKitAPILibrary */;
</span><span class="cx">                         targetProxy = 7CCE7F501A4124DB00447C4C /* PBXContainerItemProxy */;
</span><span class="cx">                 };
</span><ins>+                A13EBBB31B87441900097110 /* PBXTargetDependency */ = {
+                        isa = PBXTargetDependency;
+                        target = A13EBB481B87339E00097110 /* WebProcessPlugIn */;
+                        targetProxy = A13EBBB21B87441900097110 /* PBXContainerItemProxy */;
+                };
</ins><span class="cx">                 BC575A96126E74E7006F0F12 /* PBXTargetDependency */ = {
</span><span class="cx">                         isa = PBXTargetDependency;
</span><span class="cx">                         target = BC57597F126E74AF006F0F12 /* InjectedBundleTestWebKitAPI */;
</span><span class="lines">@@ -1757,6 +1839,20 @@
</span><span class="cx">                         };
</span><span class="cx">                         name = Release;
</span><span class="cx">                 };
</span><ins>+                A13EBB4D1B87339E00097110 /* Debug */ = {
+                        isa = XCBuildConfiguration;
+                        baseConfigurationReference = A13EBB521B87346600097110 /* WebProcessPlugIn.xcconfig */;
+                        buildSettings = {
+                        };
+                        name = Debug;
+                };
+                A13EBB4E1B87339E00097110 /* Release */ = {
+                        isa = XCBuildConfiguration;
+                        baseConfigurationReference = A13EBB521B87346600097110 /* WebProcessPlugIn.xcconfig */;
+                        buildSettings = {
+                        };
+                        name = Release;
+                };
</ins><span class="cx">                 BC575984126E74AF006F0F12 /* Debug */ = {
</span><span class="cx">                         isa = XCBuildConfiguration;
</span><span class="cx">                         baseConfigurationReference = BC575AE2126E88B1006F0F12 /* InjectedBundle.xcconfig */;
</span><span class="lines">@@ -1801,6 +1897,15 @@
</span><span class="cx">                         defaultConfigurationIsVisible = 0;
</span><span class="cx">                         defaultConfigurationName = Release;
</span><span class="cx">                 };
</span><ins>+                A13EBB4C1B87339E00097110 /* Build configuration list for PBXNativeTarget &quot;WebProcessPlugIn&quot; */ = {
+                        isa = XCConfigurationList;
+                        buildConfigurations = (
+                                A13EBB4D1B87339E00097110 /* Debug */,
+                                A13EBB4E1B87339E00097110 /* Release */,
+                        );
+                        defaultConfigurationIsVisible = 0;
+                        defaultConfigurationName = Release;
+                };
</ins><span class="cx">                 BC575986126E74AF006F0F12 /* Build configuration list for PBXNativeTarget &quot;InjectedBundleTestWebKitAPI&quot; */ = {
</span><span class="cx">                         isa = XCConfigurationList;
</span><span class="cx">                         buildConfigurations = (
</span></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPITestsCustomProtocolsSyncXHRTestmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -69,6 +69,8 @@
</span><span class="cx">     WKPageLoadURL(wkView.get().pageRef, Util::createURLForResource(&quot;custom-protocol-sync-xhr&quot;, &quot;html&quot;));
</span><span class="cx"> 
</span><span class="cx">     TestWebKitAPI::Util::run(&amp;testFinished);
</span><ins>+    [NSURLProtocol unregisterClass:[TestProtocol class]];
+    [WKBrowsingContextController unregisterSchemeForCustomProtocol:[TestProtocol scheme]];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace TestWebKitAPI
</span></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPITestsWebKit2customprotocolsyncxhrhtml"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2/custom-protocol-sync-xhr.html (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2/custom-protocol-sync-xhr.html        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2/custom-protocol-sync-xhr.html        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> &lt;script&gt;
</span><span class="cx">     var request = new XMLHttpRequest();
</span><del>-    request.open('GET', 'test://test', false);
</del><ins>+    request.open('GET', 'http://test', false);
</ins><span class="cx">     request.send(null);
</span><span class="cx">     window._testResult = request.responseText;
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPITestsWebKit2CocoaBundleParametersmm"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm                                (rev 0)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;PlatformUtilities.h&quot;
+#import &quot;Test.h&quot;
+#import &quot;WKWebViewConfigurationExtras.h&quot;
+#import &lt;WebKit/WKProcessPoolPrivate.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+static bool isDone;
+
+TEST(WebKit2, BundleParameters)
+{
+    @autoreleasepool {
+        NSString * const testPlugInClassName = @&quot;BundleParametersPlugIn&quot;;
+        auto configuration = retainPtr([WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:testPlugInClassName]);
+        auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]);
+
+        [webView evaluateJavaScript:TestWebKitAPI::Util::TestPlugInClassNameParameter completionHandler:^(id result, NSError *error) {
+            EXPECT_TRUE([result isKindOfClass:[NSString class]]);
+            EXPECT_WK_STREQ(result, testPlugInClassName);
+            isDone = true;
+        }];
+
+        TestWebKitAPI::Util::run(&amp;isDone);
+        isDone = false;
+
+        NSString * const testParameter = @&quot;TestParameter&quot;;
+        [webView evaluateJavaScript:testParameter completionHandler:^(id result, NSError *error) {
+            EXPECT_NULL(result);
+            isDone = true;
+        }];
+
+        TestWebKitAPI::Util::run(&amp;isDone);
+        isDone = false;
+
+        NSString * const testString = @&quot;PASS&quot;;
+        [[configuration processPool] _setObject:testString forBundleParameter:testParameter];
+        [webView evaluateJavaScript:testParameter completionHandler:^(id result, NSError *error) {
+            EXPECT_TRUE([result isKindOfClass:[NSString class]]);
+            EXPECT_WK_STREQ(result, testString);
+            isDone = true;
+        }];
+
+        TestWebKitAPI::Util::run(&amp;isDone);
+        isDone = false;
+
+        NSDictionary * const testDictionary = @{ @&quot;result&quot; : @&quot;PASS&quot; };
+        [[configuration processPool] _setObject:testDictionary forBundleParameter:testParameter];
+        [webView evaluateJavaScript:testParameter completionHandler:^(id result, NSError *error) {
+            EXPECT_TRUE([result isKindOfClass:[NSDictionary class]]);
+            EXPECT_TRUE([result isEqualToDictionary:testDictionary]);
+            isDone = true;
+        }];
+
+        TestWebKitAPI::Util::run(&amp;isDone);
+        isDone = false;
+
+        [[configuration processPool] _setObject:nil forBundleParameter:testParameter];
+        [webView evaluateJavaScript:testParameter completionHandler:^(id result, NSError *error) {
+            EXPECT_NULL(result);
+            isDone = true;
+        }];
+
+        TestWebKitAPI::Util::run(&amp;isDone);
+    }
+}
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPITestsWebKit2CocoaBundleParametersPlugInmm"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm                                (rev 0)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;PlatformUtilities.h&quot;
+#import &lt;WebKit/WKWebProcessPlugIn.h&gt;
+#import &lt;WebKit/WKWebProcessPlugInBrowserContextController.h&gt;
+#import &lt;WebKit/WKWebProcessPlugInFrame.h&gt;
+#import &lt;WebKit/WKWebProcessPlugInScriptWorld.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+static NSString * const testParameter = @&quot;TestParameter&quot;;
+
+@interface BundleParametersPlugIn : NSObject &lt;WKWebProcessPlugIn&gt;
+@end
+
+@implementation BundleParametersPlugIn {
+    RetainPtr&lt;WKWebProcessPlugInBrowserContextController&gt; _browserContextController;
+    RetainPtr&lt;WKWebProcessPlugInController&gt; _plugInController;
+}
+
+- (void)webProcessPlugIn:(WKWebProcessPlugInController *)plugInController didCreateBrowserContextController:(WKWebProcessPlugInBrowserContextController *)browserContextController
+{
+    ASSERT(!_browserContextController);
+    ASSERT(!_plugInController);
+    _browserContextController = browserContextController;
+    _plugInController = plugInController;
+    [plugInController.parameters addObserver:self forKeyPath:testParameter options:NSKeyValueObservingOptionInitial context:NULL];
+    [plugInController.parameters addObserver:self forKeyPath:TestWebKitAPI::Util::TestPlugInClassNameParameter options:NSKeyValueObservingOptionInitial context:NULL];
+}
+
+- (void)dealloc
+{
+    [[_plugInController parameters] removeObserver:self forKeyPath:testParameter];
+    [[_plugInController parameters] removeObserver:self forKeyPath:TestWebKitAPI::Util::TestPlugInClassNameParameter];
+    [super dealloc];
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+{
+    JSContext *jsContext = [[_browserContextController mainFrame] jsContextForWorld:[WKWebProcessPlugInScriptWorld normalWorld]];
+    [jsContext setObject:[object valueForKeyPath:keyPath] forKeyedSubscript:keyPath];
+}
+
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPITestsWebKit2CocoaContentFilteringmm"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm                                (rev 0)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,261 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;MockContentFilterSettings.h&quot;
+#import &quot;PlatformUtilities.h&quot;
+#import &quot;TestProtocol.h&quot;
+#import &quot;WKWebViewConfigurationExtras.h&quot;
+#import &lt;WebKit/WKBrowsingContextController.h&gt;
+#import &lt;WebKit/WKNavigationDelegatePrivate.h&gt;
+#import &lt;WebKit/WKProcessPoolPrivate.h&gt;
+#import &lt;WebKit/WKWebView.h&gt;
+#import &lt;WebKit/_WKDownloadDelegate.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+using Decision = WebCore::MockContentFilterSettings::Decision;
+using DecisionPoint = WebCore::MockContentFilterSettings::DecisionPoint;
+
+static bool isDone;
+
+@interface MockContentFilterEnabler : NSObject &lt;NSCopying, NSSecureCoding&gt;
+- (instancetype)initWithDecision:(Decision)decision decisionPoint:(DecisionPoint)decisionPoint;
+@end
+
+@implementation MockContentFilterEnabler {
+    Decision _decision;
+    DecisionPoint _decisionPoint;
+}
+
++ (BOOL)supportsSecureCoding
+{
+    return YES;
+}
+
+- (id)copyWithZone:(NSZone *)zone
+{
+    return [self retain];
+}
+
+- (instancetype)initWithCoder:(NSCoder *)decoder
+{
+    return [super init];
+}
+
+- (instancetype)initWithDecision:(Decision)decision decisionPoint:(DecisionPoint)decisionPoint
+{
+    if (!(self = [super init]))
+        return nil;
+
+    _decision = decision;
+    _decisionPoint = decisionPoint;
+    return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder
+{
+    [coder encodeInt:static_cast&lt;int&gt;(_decision) forKey:@&quot;Decision&quot;];
+    [coder encodeInt:static_cast&lt;int&gt;(_decisionPoint) forKey:@&quot;DecisionPoint&quot;];
+}
+
+@end
+
+static RetainPtr&lt;WKWebViewConfiguration&gt; configurationWithContentFilterSettings(Decision decision, DecisionPoint decisionPoint)
+{
+    auto configuration = retainPtr([WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:@&quot;ContentFilteringPlugIn&quot;]);
+    auto contentFilterEnabler = adoptNS([[MockContentFilterEnabler alloc] initWithDecision:decision decisionPoint:decisionPoint]);
+    [[configuration processPool] _setObject:contentFilterEnabler.get() forBundleParameter:NSStringFromClass([MockContentFilterEnabler class])];
+    return configuration;
+}
+
+@interface ServerRedirectNavigationDelegate : NSObject &lt;WKNavigationDelegate&gt;
+@end
+
+@implementation ServerRedirectNavigationDelegate
+
+- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation
+{
+    EXPECT_WK_STREQ(webView.URL.absoluteString, @&quot;http://redirect/?pass&quot;);
+}
+
+- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation
+{
+    EXPECT_WK_STREQ(webView.URL.absoluteString, @&quot;http://pass/&quot;);
+}
+
+- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation
+{
+    isDone = true;
+}
+
+@end
+
+TEST(ContentFiltering, URLAfterServerRedirect)
+{
+    @autoreleasepool {
+        [NSURLProtocol registerClass:[TestProtocol class]];
+        [WKBrowsingContextController registerSchemeForCustomProtocol:[TestProtocol scheme]];
+
+        auto configuration = configurationWithContentFilterSettings(Decision::Allow, DecisionPoint::AfterAddData);
+        auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]);
+        auto navigationDelegate = adoptNS([[ServerRedirectNavigationDelegate alloc] init]);
+        [webView setNavigationDelegate:navigationDelegate.get()];
+        [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@&quot;http://redirect?pass&quot;]]];
+        TestWebKitAPI::Util::run(&amp;isDone);
+
+        [WKBrowsingContextController unregisterSchemeForCustomProtocol:[TestProtocol scheme]];
+        [NSURLProtocol unregisterClass:[TestProtocol class]];
+    }
+}
+
+@interface BecomeDownloadDelegate : NSObject &lt;WKNavigationDelegate&gt;
+@end
+
+@implementation BecomeDownloadDelegate
+
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler
+{
+    decisionHandler(_WKNavigationResponsePolicyBecomeDownload);
+}
+
+- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error
+{
+    isDone = true;
+}
+
+- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
+{
+    isDone = true;
+}
+
+@end
+
+static bool downloadDidStart;
+
+@interface ContentFilteringDownloadDelegate : NSObject &lt;_WKDownloadDelegate&gt;
+@end
+
+@implementation ContentFilteringDownloadDelegate
+
+- (void)_downloadDidStart:(_WKDownload *)download
+{
+    downloadDidStart = true;
+}
+
+@end
+
+static void downloadTest(Decision decision, DecisionPoint decisionPoint)
+{
+    @autoreleasepool {
+        [NSURLProtocol registerClass:[TestProtocol class]];
+        [WKBrowsingContextController registerSchemeForCustomProtocol:[TestProtocol scheme]];
+
+        auto configuration = configurationWithContentFilterSettings(decision, decisionPoint);
+        auto downloadDelegate = adoptNS([[ContentFilteringDownloadDelegate alloc] init]);
+        [[configuration processPool] _setDownloadDelegate:downloadDelegate.get()];
+        auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]);
+        auto navigationDelegate = adoptNS([[BecomeDownloadDelegate alloc] init]);
+        [webView setNavigationDelegate:navigationDelegate.get()];
+        [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@&quot;http://redirect/?download&quot;]]];
+
+        isDone = false;
+        downloadDidStart = false;
+        const bool downloadShouldStart = decision == Decision::Allow || decisionPoint &gt; DecisionPoint::AfterResponse;
+        if (downloadShouldStart)
+            TestWebKitAPI::Util::run(&amp;downloadDidStart);
+        else
+            TestWebKitAPI::Util::run(&amp;isDone);
+
+        EXPECT_EQ(downloadShouldStart, downloadDidStart);
+
+        [WKBrowsingContextController unregisterSchemeForCustomProtocol:[TestProtocol scheme]];
+        [NSURLProtocol unregisterClass:[TestProtocol class]];
+    }
+}
+
+TEST(ContentFiltering, AllowDownloadAfterWillSendRequest)
+{
+    downloadTest(Decision::Allow, DecisionPoint::AfterWillSendRequest);
+}
+
+TEST(ContentFiltering, BlockDownloadAfterWillSendRequest)
+{
+    downloadTest(Decision::Block, DecisionPoint::AfterWillSendRequest);
+}
+
+TEST(ContentFiltering, AllowDownloadAfterRedirect)
+{
+    downloadTest(Decision::Allow, DecisionPoint::AfterRedirect);
+}
+
+TEST(ContentFiltering, BlockDownloadAfterRedirect)
+{
+    downloadTest(Decision::Block, DecisionPoint::AfterRedirect);
+}
+
+TEST(ContentFiltering, AllowDownloadAfterResponse)
+{
+    downloadTest(Decision::Allow, DecisionPoint::AfterResponse);
+}
+
+TEST(ContentFiltering, BlockDownloadAfterResponse)
+{
+    downloadTest(Decision::Block, DecisionPoint::AfterResponse);
+}
+
+TEST(ContentFiltering, AllowDownloadAfterAddData)
+{
+    downloadTest(Decision::Allow, DecisionPoint::AfterAddData);
+}
+
+TEST(ContentFiltering, BlockDownloadAfterAddData)
+{
+    downloadTest(Decision::Block, DecisionPoint::AfterAddData);
+}
+
+TEST(ContentFiltering, AllowDownloadAfterFinishedAddingData)
+{
+    downloadTest(Decision::Allow, DecisionPoint::AfterFinishedAddingData);
+}
+
+TEST(ContentFiltering, BlockDownloadAfterFinishedAddingData)
+{
+    downloadTest(Decision::Block, DecisionPoint::AfterFinishedAddingData);
+}
+
+TEST(ContentFiltering, AllowDownloadNever)
+{
+    downloadTest(Decision::Allow, DecisionPoint::Never);
+}
+
+TEST(ContentFiltering, BlockDownloadNever)
+{
+    downloadTest(Decision::Block, DecisionPoint::Never);
+}
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPITestsWebKit2CocoaContentFilteringPlugInmm"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ContentFilteringPlugIn.mm (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ContentFilteringPlugIn.mm                                (rev 0)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ContentFilteringPlugIn.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,106 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;MockContentFilterSettings.h&quot;
+#import &lt;WebKit/WKWebProcessPlugIn.h&gt;
+
+using MockContentFilterSettings = WebCore::MockContentFilterSettings;
+using Decision = MockContentFilterSettings::Decision;
+using DecisionPoint = MockContentFilterSettings::DecisionPoint;
+
+@interface MockContentFilterEnabler : NSObject &lt;NSCopying, NSSecureCoding&gt;
+@end
+
+@implementation MockContentFilterEnabler
+
++ (BOOL)supportsSecureCoding
+{
+    return YES;
+}
+
+- (id)copyWithZone:(NSZone *)zone
+{
+    return [self retain];
+}
+
+- (instancetype)initWithCoder:(NSCoder *)decoder
+{
+    if (!(self = [super init]))
+        return nil;
+
+    auto&amp; settings = MockContentFilterSettings::singleton();
+    settings.setEnabled(true);
+    settings.setDecision(static_cast&lt;Decision&gt;([decoder decodeIntForKey:@&quot;Decision&quot;]));
+    settings.setDecisionPoint(static_cast&lt;DecisionPoint&gt;([decoder decodeIntForKey:@&quot;DecisionPoint&quot;]));
+    return self;
+}
+
+- (void)dealloc
+{
+    MockContentFilterSettings::singleton().setEnabled(false);
+    [super dealloc];
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder
+{
+}
+
+@end
+
+@interface ContentFilteringPlugIn : NSObject &lt;WKWebProcessPlugIn&gt;
+@end
+
+@implementation ContentFilteringPlugIn {
+    RetainPtr&lt;MockContentFilterEnabler&gt; _contentFilterEnabler;
+    RetainPtr&lt;WKWebProcessPlugInController&gt; _plugInController;
+}
+
+- (void)webProcessPlugIn:(WKWebProcessPlugInController *)plugInController initializeWithObject:(id)initializationObject
+{
+    ASSERT(!_plugInController);
+    _plugInController = plugInController;
+    [plugInController.parameters addObserver:self forKeyPath:NSStringFromClass([MockContentFilterEnabler class]) options:NSKeyValueObservingOptionInitial context:NULL];
+}
+
+- (void)dealloc
+{
+    [[_plugInController parameters] removeObserver:self forKeyPath:NSStringFromClass([MockContentFilterEnabler class])];
+    [super dealloc];
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+{
+    id contentFilterEnabler = [object valueForKeyPath:keyPath];
+    ASSERT([contentFilterEnabler isKindOfClass:[MockContentFilterEnabler class]]);
+    _contentFilterEnabler = contentFilterEnabler;
+}
+
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPITestsWebKit2CocoaDownloadmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -265,34 +265,5 @@
</span><span class="cx">     TestWebKitAPI::Util::run(&amp;isDone);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-@interface AsynchronousDownloadNavigationDelegate : NSObject &lt;WKNavigationDelegate&gt;
-@end
-
-@implementation AsynchronousDownloadNavigationDelegate
-- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler
-{
-    dispatch_async(dispatch_get_main_queue(), ^ {
-        decisionHandler(_WKNavigationResponsePolicyBecomeDownload);
-    });
-}
-@end
-
-@interface AsynchronousDownloadDelegate : NSObject &lt;_WKDownloadDelegate&gt;
-@end
-
-@implementation AsynchronousDownloadDelegate
-
-- (void)_downloadDidStart:(_WKDownload *)download
-{
-    isDone = true;
-}
-
-@end
-
-TEST(_WKDownload, AsynchronousDownloadPolicy)
-{
-    runTest(adoptNS([[AsynchronousDownloadNavigationDelegate alloc] init]).get(), adoptNS([[AsynchronousDownloadDelegate alloc] init]).get(), sourceURL);
-}
-
</del><span class="cx"> #endif
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPITestsWebKit2ObjCCustomProtocolsTestmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -39,6 +39,34 @@
</span><span class="cx"> 
</span><span class="cx"> static bool testFinished = false;
</span><span class="cx"> 
</span><ins>+@interface CustomProtocolsLoadDelegate : NSObject &lt;WKBrowsingContextLoadDelegate&gt;
+@end
+
+@implementation CustomProtocolsLoadDelegate
+
+- (void)browsingContextControllerDidStartProvisionalLoad:(WKBrowsingContextController *)sender
+{
+    EXPECT_TRUE([sender.provisionalURL.absoluteString isEqualToString:@&quot;http://redirect/?test&quot;]);
+}
+
+- (void)browsingContextControllerDidReceiveServerRedirectForProvisionalLoad:(WKBrowsingContextController *)sender
+{
+    EXPECT_TRUE([sender.provisionalURL.absoluteString isEqualToString:@&quot;http://test/&quot;]);
+}
+
+- (void)browsingContextControllerDidCommitLoad:(WKBrowsingContextController *)sender
+{
+    EXPECT_TRUE([sender.committedURL.absoluteString isEqualToString:@&quot;http://test/&quot;]);
+}
+
+- (void)browsingContextControllerDidFinishLoad:(WKBrowsingContextController *)sender
+{
+    EXPECT_FALSE(sender.isLoading);
+    testFinished = true;
+}
+
+@end
+
</ins><span class="cx"> namespace TestWebKitAPI {
</span><span class="cx"> 
</span><span class="cx"> TEST(WebKit2CustomProtocolsTest, MainResource)
</span><span class="lines">@@ -49,12 +77,13 @@
</span><span class="cx">     RetainPtr&lt;WKProcessGroup&gt; processGroup = adoptNS([[WKProcessGroup alloc] init]);
</span><span class="cx">     RetainPtr&lt;WKBrowsingContextGroup&gt; browsingContextGroup = adoptNS([[WKBrowsingContextGroup alloc] initWithIdentifier:@&quot;TestIdentifier&quot;]);
</span><span class="cx">     RetainPtr&lt;WKView&gt; wkView = adoptNS([[WKView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) processGroup:processGroup.get() browsingContextGroup:browsingContextGroup.get()]);
</span><del>-    wkView.get().browsingContextController.loadDelegate = [[TestBrowsingContextLoadDelegate alloc] initWithBlockToRunOnLoad:^(WKBrowsingContextController *sender) {
-        testFinished = true;
-    }];
-    [wkView.get().browsingContextController loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@&quot;%@://test&quot;, [TestProtocol scheme]]]]];
</del><ins>+    RetainPtr&lt;CustomProtocolsLoadDelegate&gt; loadDelegate = adoptNS([[CustomProtocolsLoadDelegate alloc] init]);
+    [wkView browsingContextController].loadDelegate = loadDelegate.get();
+    [[wkView browsingContextController] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@&quot;%@://redirect?test&quot;, [TestProtocol scheme]]]]];
</ins><span class="cx"> 
</span><span class="cx">     Util::run(&amp;testFinished);
</span><ins>+    [NSURLProtocol unregisterClass:[TestProtocol class]];
+    [WKBrowsingContextController unregisterSchemeForCustomProtocol:[TestProtocol scheme]];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace TestWebKitAPI
</span></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPITestsWebKit2ObjCPreventImageLoadWithAutoResizingmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -57,6 +57,8 @@
</span><span class="cx">     [webView.platformView().browsingContextController loadHTMLString:@&quot;&lt;html&gt;&lt;body style='background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC);'&gt;&lt;/body&gt;&lt;/html&gt;&quot; baseURL:[NSURL URLWithString:@&quot;about:blank&quot;]];
</span><span class="cx"> 
</span><span class="cx">     Util::run(&amp;testFinished);
</span><ins>+    [NSURLProtocol unregisterClass:[TestProtocol class]];
+    [WKBrowsingContextController unregisterSchemeForCustomProtocol:[TestProtocol scheme]];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace TestWebKitAPI
</span></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPIWKWebViewConfigurationExtrashfromrev190765branchessafari601branchToolsTestWebKitAPImacTestProtocolh"></a>
<div class="copfile"><h4>Copied: branches/safari-601-branch/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.h (from rev 190765, branches/safari-601-branch/Tools/TestWebKitAPI/mac/TestProtocol.h) (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.h                                (rev 0)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.h        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &lt;WebKit/WKWebViewConfiguration.h&gt;
+
+#if WK_API_ENABLED
+
+@interface WKWebViewConfiguration (TestWebKitAPIExtras)
++ (instancetype)testwebkitapi_configurationWithTestPlugInClassName:(NSString *)className;
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPIWKWebViewConfigurationExtrasmmfromrev190765branchessafari601branchSourceWebCoretestingMockContentFilterSettingscpp"></a>
<div class="copfile"><h4>Copied: branches/safari-601-branch/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.mm (from rev 190765, branches/safari-601-branch/Source/WebCore/testing/MockContentFilterSettings.cpp) (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.mm                                (rev 0)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;WKWebViewConfigurationExtras.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;PlatformUtilities.h&quot;
+#import &lt;WebKit/WKProcessPoolPrivate.h&gt;
+#import &lt;WebKit/_WKProcessPoolConfiguration.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+@implementation WKWebViewConfiguration (TestWebKitAPIExtras)
+
++ (instancetype)testwebkitapi_configurationWithTestPlugInClassName:(NSString *)className
+{
+    auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
+    [processPoolConfiguration setInjectedBundleURL:[[NSBundle mainBundle] URLForResource:@&quot;TestWebKitAPI&quot; withExtension:@&quot;wkbundle&quot;]];
+
+    auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]);
+    [processPool _setObject:className forBundleParameter:TestWebKitAPI::Util::TestPlugInClassNameParameter];
+
+    auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
+    [webViewConfiguration setProcessPool:processPool.get()];
+
+    return webViewConfiguration.autorelease();
+}
+
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPIcocoaPlatformUtilitiesCocoamm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -55,5 +55,8 @@
</span><span class="cx">     return std::string(buffer.get(), stringLength);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if WK_API_ENABLED
+NSString * const TestPlugInClassNameParameter = @&quot;TestPlugInPrincipalClassName&quot;;
+#endif
</ins><span class="cx"> } // namespace Util
</span><span class="cx"> } // namespace TestWebKitAPI
</span></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPIcocoaTestProtocolhfromrev190765branchessafari601branchToolsTestWebKitAPImacTestProtocolh"></a>
<div class="copfile"><h4>Copied: branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/TestProtocol.h (from rev 190765, branches/safari-601-branch/Tools/TestWebKitAPI/mac/TestProtocol.h) (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/TestProtocol.h                                (rev 0)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/TestProtocol.h        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TestProtocol_h
+#define TestProtocol_h
+
+@interface TestProtocol : NSURLProtocol {
+}
++ (NSString *)scheme;
+@end
+
+#endif // TestProtocol_h
</ins></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPIcocoaTestProtocolmmfromrev190765branchessafari601branchToolsTestWebKitAPImacTestProtocolmm"></a>
<div class="copfile"><h4>Copied: branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/TestProtocol.mm (from rev 190765, branches/safari-601-branch/Tools/TestWebKitAPI/mac/TestProtocol.mm) (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/TestProtocol.mm                                (rev 0)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/TestProtocol.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;TestProtocol.h&quot;
+
+#import &lt;wtf/RetainPtr.h&gt;
+
+// Even though NSURLProtocol is capable of generating redirect responses for any protocol, WebCore asserts if a redirect is not in the http family.
+// See http://webkit.org/b/147870 for details.
+static NSString *testScheme = @&quot;http&quot;;
+
+@implementation TestProtocol
+
++ (BOOL)canInitWithRequest:(NSURLRequest *)request
+{
+    return [request.URL.scheme caseInsensitiveCompare:testScheme] == NSOrderedSame;
+}
+
++ (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request
+{
+    return request;
+}
+
++ (BOOL)requestIsCacheEquivalent:(NSURLRequest *)a toRequest:(NSURLRequest *)b
+{
+    return NO;
+}
+
++ (NSString *)scheme
+{
+    return testScheme;
+}
+
+- (void)startLoading
+{
+    NSURL *requestURL = self.request.URL;
+    EXPECT_TRUE([requestURL.scheme isEqualToString:testScheme]);
+
+    NSData *data = [@&quot;PASS&quot; dataUsingEncoding:NSASCIIStringEncoding];
+    RetainPtr&lt;NSURLResponse&gt; response = adoptNS([[NSURLResponse alloc] initWithURL:requestURL MIMEType:@&quot;text/html&quot; expectedContentLength:data.length textEncodingName:nil]);
+
+    if ([requestURL.host isEqualToString:@&quot;redirect&quot;]) {
+        NSURL *redirectURL = [NSURL URLWithString:[NSString stringWithFormat:@&quot;%@://%@&quot;, testScheme, requestURL.query]];
+        [self.client URLProtocol:self wasRedirectedToRequest:[NSURLRequest requestWithURL:redirectURL] redirectResponse:response.get()];
+        return;
+    }
+
+    [self.client URLProtocol:self didReceiveResponse:response.get() cacheStoragePolicy:NSURLCacheStorageNotAllowed];
+    [self.client URLProtocol:self didLoadData:data];
+    [self.client URLProtocolDidFinishLoading:self];
+}
+
+- (void)stopLoading
+{
+}
+
+@end
</ins></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPIcocoaWebProcessPlugInInfoplist"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist                                (rev 0)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
+&lt;plist version=&quot;1.0&quot;&gt;
+&lt;dict&gt;
+        &lt;key&gt;CFBundleDevelopmentRegion&lt;/key&gt;
+        &lt;string&gt;en&lt;/string&gt;
+        &lt;key&gt;CFBundleExecutable&lt;/key&gt;
+        &lt;string&gt;$(EXECUTABLE_NAME)&lt;/string&gt;
+        &lt;key&gt;CFBundleInfoDictionaryVersion&lt;/key&gt;
+        &lt;string&gt;6.0&lt;/string&gt;
+        &lt;key&gt;CFBundleName&lt;/key&gt;
+        &lt;string&gt;$(PRODUCT_NAME)&lt;/string&gt;
+        &lt;key&gt;CFBundlePackageType&lt;/key&gt;
+        &lt;string&gt;BNDL&lt;/string&gt;
+        &lt;key&gt;CFBundleShortVersionString&lt;/key&gt;
+        &lt;string&gt;1.0&lt;/string&gt;
+        &lt;key&gt;CFBundleSignature&lt;/key&gt;
+        &lt;string&gt;????&lt;/string&gt;
+        &lt;key&gt;CFBundleVersion&lt;/key&gt;
+        &lt;string&gt;1&lt;/string&gt;
+        &lt;key&gt;NSPrincipalClass&lt;/key&gt;
+        &lt;string&gt;WebProcessPlugIn&lt;/string&gt;
+&lt;/dict&gt;
+&lt;/plist&gt;
</ins></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPIcocoaWebProcessPlugInWebProcessPlugInmmfromrev190765branchessafari601branchToolsTestWebKitAPITestsWebKit2ObjCCustomProtocolsTestmm"></a>
<div class="copfile"><h4>Copied: branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm (from rev 190765, branches/safari-601-branch/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm) (0 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm                                (rev 0)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;PlatformUtilities.h&quot;
+#import &lt;WebKit/WKWebProcessPlugIn.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+@interface WebProcessPlugIn : NSObject &lt;WKWebProcessPlugIn&gt;
+@end
+
+@implementation WebProcessPlugIn {
+    RetainPtr&lt;id &lt;WKWebProcessPlugIn&gt;&gt; _testPlugIn;
+}
+
+- (void)webProcessPlugIn:(WKWebProcessPlugInController *)plugInController initializeWithObject:(id)initializationObject
+{
+    NSString *testPlugInClassName = [plugInController.parameters valueForKey:TestWebKitAPI::Util::TestPlugInClassNameParameter];
+    ASSERT(testPlugInClassName);
+    ASSERT([testPlugInClassName isKindOfClass:[NSString class]]);
+
+    Class testPlugInClass = NSClassFromString(testPlugInClassName);
+    ASSERT(testPlugInClass);
+    ASSERT([testPlugInClass conformsToProtocol:@protocol(WKWebProcessPlugIn)]);
+
+    ASSERT(!_testPlugIn);
+    _testPlugIn = adoptNS([[testPlugInClass alloc] init]);
+
+    if ([_testPlugIn respondsToSelector:@selector(webProcessPlugIn:initializeWithObject:)])
+        [_testPlugIn webProcessPlugIn:plugInController initializeWithObject:initializationObject];
+}
+
+- (BOOL)respondsToSelector:(SEL)aSelector
+{
+    if ([_testPlugIn respondsToSelector:aSelector])
+        return YES;
+    return [super respondsToSelector:aSelector];
+}
+
+- (id)forwardingTargetForSelector:(SEL)aSelector
+{
+    return _testPlugIn.get();
+}
+
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPImacTestProtocolh"></a>
<div class="delfile"><h4>Deleted: branches/safari-601-branch/Tools/TestWebKitAPI/mac/TestProtocol.h (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/mac/TestProtocol.h        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/mac/TestProtocol.h        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -1,34 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TestProtocol_h
-#define TestProtocol_h
-
-@interface TestProtocol : NSURLProtocol {
-}
-+ (NSString *)scheme;
-@end
-
-#endif // TestProtocol_h
</del></span></pre></div>
<a id="branchessafari601branchToolsTestWebKitAPImacTestProtocolmm"></a>
<div class="delfile"><h4>Deleted: branches/safari-601-branch/Tools/TestWebKitAPI/mac/TestProtocol.mm (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/TestWebKitAPI/mac/TestProtocol.mm        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/TestWebKitAPI/mac/TestProtocol.mm        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -1,69 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import &quot;config.h&quot;
-#import &quot;TestProtocol.h&quot;
-
-static NSString *testScheme = @&quot;test&quot;;
-
-@implementation TestProtocol
-
-+ (BOOL)canInitWithRequest:(NSURLRequest *)request
-{
-    return [[[request URL] scheme] caseInsensitiveCompare:testScheme] == NSOrderedSame;
-}
-
-+ (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request
-{
-    return request;
-}
-
-+ (BOOL)requestIsCacheEquivalent:(NSURLRequest *)a toRequest:(NSURLRequest *)b
-{
-    return NO;
-}
-
-+ (NSString *)scheme
-{
-    return testScheme;
-}
-
-- (void)startLoading
-{
-    EXPECT_TRUE([[[[self request] URL] scheme] isEqualToString:testScheme]);
-    
-    NSData *data = [@&quot;PASS&quot; dataUsingEncoding:NSASCIIStringEncoding];
-    NSURLResponse *response = [[NSURLResponse alloc] initWithURL:[[self request] URL] MIMEType:@&quot;text/html&quot; expectedContentLength:[data length] textEncodingName:nil];
-    [[self client] URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed];
-    [[self client] URLProtocol:self didLoadData:data];
-    [[self client] URLProtocolDidFinishLoading:self];
-    [response release];
-}
-
-- (void)stopLoading
-{
-}
-
-@end
</del></span></pre></div>
<a id="branchessafari601branchToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -75,6 +75,7 @@
</span><span class="cx">     void setCacheModel(int model);
</span><span class="cx">     void setAsynchronousSpellCheckingEnabled(boolean value);
</span><span class="cx">     void setPrinting();
</span><ins>+    void setShouldDecideNavigationPolicyAfterDelay(boolean value);
</ins><span class="cx"> 
</span><span class="cx">     // Special DOM functions.
</span><span class="cx">     void clearBackForwardList();
</span></span></pre></div>
<a id="branchessafari601branchToolsWebKitTestRunnerInjectedBundleInjectedBundlePagecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -1286,6 +1286,9 @@
</span><span class="cx">         injectedBundle.outputText(stringBuilder.toString());
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (injectedBundle.testRunner()-&gt;shouldDecideNavigationPolicyAfterDelay())
+        return WKBundlePagePolicyActionPassThrough;
+
</ins><span class="cx">     if (!injectedBundle.testRunner()-&gt;isPolicyDelegateEnabled())
</span><span class="cx">         return WKBundlePagePolicyActionUse;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchToolsWebKitTestRunnerInjectedBundleTestRunnercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -851,4 +851,12 @@
</span><span class="cx">     return JSC::setNeverInline(context, theFunction);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TestRunner::setShouldDecideNavigationPolicyAfterDelay(bool value)
+{
+    m_shouldDecideNavigationPolicyAfterDelay = value;
+    WKRetainPtr&lt;WKStringRef&gt; messageName(AdoptWK, WKStringCreateWithUTF8CString(&quot;SetShouldDecideNavigationPolicyAfterDelay&quot;));
+    WKRetainPtr&lt;WKBooleanRef&gt; messageBody(AdoptWK, WKBooleanCreate(value));
+    WKBundlePagePostMessage(InjectedBundle::singleton().page()-&gt;page(), messageName.get(), messageBody.get());
+}
+
</ins><span class="cx"> } // namespace WTR
</span></span></pre></div>
<a id="branchessafari601branchToolsWebKitTestRunnerInjectedBundleTestRunnerh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -281,6 +281,9 @@
</span><span class="cx">     JSValueRef numberOfDFGCompiles(JSValueRef theFunction);
</span><span class="cx">     JSValueRef neverInlineFunction(JSValueRef theFunction);
</span><span class="cx"> 
</span><ins>+    bool shouldDecideNavigationPolicyAfterDelay() const { return m_shouldDecideNavigationPolicyAfterDelay; }
+    void setShouldDecideNavigationPolicyAfterDelay(bool);
+
</ins><span class="cx"> private:
</span><span class="cx">     TestRunner();
</span><span class="cx"> 
</span><span class="lines">@@ -331,6 +334,8 @@
</span><span class="cx">     double m_databaseDefaultQuota;
</span><span class="cx">     double m_databaseMaxQuota;
</span><span class="cx"> 
</span><ins>+    bool m_shouldDecideNavigationPolicyAfterDelay { false };
+
</ins><span class="cx">     bool m_userStyleSheetEnabled;
</span><span class="cx">     WKRetainPtr&lt;WKStringRef&gt; m_userStyleSheetLocation;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/WebKitTestRunner/TestController.cpp (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/WebKitTestRunner/TestController.cpp        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/WebKitTestRunner/TestController.cpp        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx"> #include &lt;ctype.h&gt;
</span><span class="cx"> #include &lt;stdlib.h&gt;
</span><span class="cx"> #include &lt;string&gt;
</span><ins>+#include &lt;wtf/RunLoop.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -311,6 +312,8 @@
</span><span class="cx"> 
</span><span class="cx"> void TestController::initialize(int argc, const char* argv[])
</span><span class="cx"> {
</span><ins>+    RunLoop::initializeMainRunLoop();
+
</ins><span class="cx">     platformInitialize();
</span><span class="cx"> 
</span><span class="cx">     Options options;
</span><span class="lines">@@ -717,6 +720,8 @@
</span><span class="cx">     // Reset main page back to about:blank
</span><span class="cx">     m_doneResetting = false;
</span><span class="cx"> 
</span><ins>+    m_shouldDecideNavigationPolicyAfterDelay = false;
+
</ins><span class="cx">     WKPageLoadURL(m_mainWebView-&gt;page(), blankURL());
</span><span class="cx">     runUntil(m_doneResetting, shortTimeout);
</span><span class="cx">     return m_doneResetting;
</span><span class="lines">@@ -1548,12 +1553,19 @@
</span><span class="cx"> 
</span><span class="cx"> void TestController::decidePolicyForNavigationAction(WKFramePolicyListenerRef listener)
</span><span class="cx"> {
</span><del>-    if (m_policyDelegateEnabled &amp;&amp; !m_policyDelegatePermissive) {
-        WKFramePolicyListenerIgnore(listener);
-        return;
-    }
</del><ins>+    WKRetainPtr&lt;WKFramePolicyListenerRef&gt; retainedListener { listener };
+    const bool shouldIgnore { m_policyDelegateEnabled &amp;&amp; !m_policyDelegatePermissive };
+    std::function&lt;void()&gt; decisionFunction = [shouldIgnore, retainedListener]() {
+        if (shouldIgnore)
+            WKFramePolicyListenerIgnore(retainedListener.get());
+        else
+            WKFramePolicyListenerUse(retainedListener.get());
+    };
</ins><span class="cx"> 
</span><del>-    WKFramePolicyListenerUse(listener);
</del><ins>+    if (m_shouldDecideNavigationPolicyAfterDelay)
+        RunLoop::main().dispatch(decisionFunction);
+    else
+        decisionFunction();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestController::decidePolicyForNavigationResponse(WKPageRef, WKNavigationResponseRef navigationResponse, WKFramePolicyListenerRef listener, WKTypeRef, const void* clientInfo)
</span></span></pre></div>
<a id="branchessafari601branchToolsWebKitTestRunnerTestControllerh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/WebKitTestRunner/TestController.h (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/WebKitTestRunner/TestController.h        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/WebKitTestRunner/TestController.h        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -121,6 +121,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool isCurrentInvocation(TestInvocation* invocation) const { return invocation == m_currentInvocation.get(); }
</span><span class="cx"> 
</span><ins>+    void setShouldDecideNavigationPolicyAfterDelay(bool value) { m_shouldDecideNavigationPolicyAfterDelay = value; }
+
</ins><span class="cx"> private:
</span><span class="cx">     void initialize(int argc, const char* argv[]);
</span><span class="cx">     void createWebViewWithOptions(WKDictionaryRef);
</span><span class="lines">@@ -273,6 +275,8 @@
</span><span class="cx">     bool m_shouldLogHistoryClientCallbacks;
</span><span class="cx">     bool m_shouldShowWebView;
</span><span class="cx"> 
</span><ins>+    bool m_shouldDecideNavigationPolicyAfterDelay { false };
+
</ins><span class="cx">     std::unique_ptr&lt;EventSenderProxy&gt; m_eventSenderProxy;
</span><span class="cx"> 
</span><span class="cx">     WorkQueueManager m_workQueueManager;
</span></span></pre></div>
<a id="branchessafari601branchToolsWebKitTestRunnerTestInvocationcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/WebKitTestRunner/TestInvocation.cpp (190765 => 190766)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/WebKitTestRunner/TestInvocation.cpp        2015-10-09 01:13:55 UTC (rev 190765)
+++ branches/safari-601-branch/Tools/WebKitTestRunner/TestInvocation.cpp        2015-10-09 01:33:05 UTC (rev 190766)
</span><span class="lines">@@ -630,6 +630,13 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (WKStringIsEqualToUTF8CString(messageName, &quot;SetShouldDecideNavigationPolicyAfterDelay&quot;)) {
+        ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID());
+        WKBooleanRef value = static_cast&lt;WKBooleanRef&gt;(messageBody);
+        TestController::singleton().setShouldDecideNavigationPolicyAfterDelay(WKBooleanGetValue(value));
+        return;
+    }
+
</ins><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>