<!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>[212685] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/212685">212685</a></dd>
<dt>Author</dt> <dd>wilander@apple.com</dd>
<dt>Date</dt> <dd>2017-02-20 16:34:37 -0800 (Mon, 20 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Resource Load Statistics: Add alternate classification method
https://bugs.webkit.org/show_bug.cgi?id=168347
&lt;rdar://problem/30352793&gt;

Reviewed by Alex Christensen.

Source/WebCore:

This patch only adds test infrastructure in WebCore.

Tests: http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
       http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
       http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
       http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
       http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
       http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
       http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
       http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
(WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
(WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
* loader/ResourceLoadObserver.h:

Source/WebKit2:

This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
also adds functions to support layout tests of the feature.

* Configurations/BaseTarget.xcconfig:
* Configurations/WebKit.xcconfig:
    Added dependency on CorePrediction.
* Platform/classifier: Added.
* Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
    Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
(WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
* Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
(WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
    Shared classifier logic.
(WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
    Fallback classifier for when we don't have CorePrediction.
* Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
(WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
(WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
* Platform/classifier/cocoa: Added.
* Platform/classifier/cocoa/CorePredictionSPI.h: Added.
    Includes CorePrediction if available, otherwise declares needed symbols.
    Always redeclares the functions so we'll get a build error if
    CorePrediction changes.
* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
(WebKit::ResourceLoadStatisticsClassifier::classify):
(WebKit::ResourceLoadStatisticsClassifier::storagePath):
(WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePrediction):
    The new classifier for Cocoa platforms.
* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
(WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
* PlatformGTK.cmake:
   Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
* PlatformMac.cmake:
   Added Platform/classifier and Platform/classifier/cocoa directories, and
   source files ResourceLoadStatisticsClassifierBase.cpp and
   ResourceLoadStatisticsClassifierCocoa.cpp
* Resources/ResourceLoadStatistics: Added.
* Resources/ResourceLoadStatistics/corePrediction_model: Added.
    Model file to load into CorePrediction.
* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
(WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
(WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
    Test infrastructure.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
    Test infrastructure.
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
    Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::classifyResource):
    Now calls the classifier through its ResourceLoadStatisticsClassifier
    member variable.
(WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
    Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
    Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:
* WebKit2.xcodeproj/project.pbxproj:
    Added the new classifier source files under Platform/classifier and the
    corePrediction_model file under Resources/ResourceLoadStatistics.

Source/WTF:

* wtf/Platform.h:
    Added support for HAVE(CORE_PREDICTION).

Tools:

Added three testRunner functions to facilitate layout tests:
- setStatisticsSubframeUnderTopFrameOrigin()
- setStatisticsSubresourceUnderTopFrameOrigin()
- setStatisticsSubresourceUniqueRedirectTo()

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsSubframeUnderTopFrameOrigin):
(WTR::TestRunner::setStatisticsSubresourceUnderTopFrameOrigin):
(WTR::TestRunner::setStatisticsSubresourceUniqueRedirectTo):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsSubframeUnderTopFrameOrigin):
(WTR::TestController::setStatisticsSubresourceUnderTopFrameOrigin):
(WTR::TestController::setStatisticsSubresourceUniqueRedirectTo):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

WebKitLibraries:

* WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework: Added.
* WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework/CorePrediction.tbd: Added.
    Stubs for private framework.

LayoutTests:

* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html: Added.
* platform/gtk/TestExpectations:
    The whole http/tests/loading/resourceLoadStatistics marked as crashing based on
    Carlos Garcia Campos's assessment in https://bugs.webkit.org/show_bug.cgi?id=168171.
* platform/wk2/TestExpectations:
    The above tests are only valid for WebKit2. Marked as [ Pass ].</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwk2TestExpectations">trunk/LayoutTests/platform/wk2/TestExpectations</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfPlatformh">trunk/Source/WTF/wtf/Platform.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadObservercpp">trunk/Source/WebCore/loader/ResourceLoadObserver.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadObserverh">trunk/Source/WebCore/loader/ResourceLoadObserver.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2ConfigurationsBaseTargetxcconfig">trunk/Source/WebKit2/Configurations/BaseTarget.xcconfig</a></li>
<li><a href="#trunkSourceWebKit2ConfigurationsWebKitxcconfig">trunk/Source/WebKit2/Configurations/WebKit.xcconfig</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2PlatformMaccmake">trunk/Source/WebKit2/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKResourceLoadStatisticsManagercpp">trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKResourceLoadStatisticsManagerh">trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebResourceLoadStatisticsManagercpp">trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebResourceLoadStatisticsManagerh">trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebResourceLoadStatisticsStorecpp">trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebResourceLoadStatisticsStoreh">trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl">trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/WebKitTestRunner/TestController.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllerh">trunk/Tools/WebKitTestRunner/TestController.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestInvocationcpp">trunk/Tools/WebKitTestRunner/TestInvocation.cpp</a></li>
<li><a href="#trunkWebKitLibrariesChangeLog">trunk/WebKitLibraries/ChangeLog</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonmixedstatisticsexpectedtxt">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonmixedstatisticshtml">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonsubframeundertopframeoriginsexpectedtxt">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonsubframeundertopframeoriginshtml">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonsubresourceundertopframeoriginsexpectedtxt">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonsubresourceundertopframeoriginshtml">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonsubresourceuniqueredirectstoexpectedtxt">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonsubresourceuniqueredirectstohtml">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonmixedstatisticsexpectedtxt">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonmixedstatisticshtml">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonsubframeundertopframeoriginsexpectedtxt">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonsubframeundertopframeoriginshtml">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonsubresourceundertopframeoriginsexpectedtxt">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonsubresourceundertopframeoriginshtml">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonsubresourceuniqueredirectstoexpectedtxt">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonsubresourceuniqueredirectstohtml">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html</a></li>
<li>trunk/Source/WebKit2/Platform/classifier/</li>
<li><a href="#trunkSourceWebKit2PlatformclassifierResourceLoadStatisticsClassifierh">trunk/Source/WebKit2/Platform/classifier/ResourceLoadStatisticsClassifier.h</a></li>
<li><a href="#trunkSourceWebKit2PlatformclassifierResourceLoadStatisticsClassifierBasecpp">trunk/Source/WebKit2/Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp</a></li>
<li><a href="#trunkSourceWebKit2PlatformclassifierResourceLoadStatisticsClassifierBaseh">trunk/Source/WebKit2/Platform/classifier/ResourceLoadStatisticsClassifierBase.h</a></li>
<li>trunk/Source/WebKit2/Platform/classifier/cocoa/</li>
<li><a href="#trunkSourceWebKit2PlatformclassifiercocoaCorePredictionSPIh">trunk/Source/WebKit2/Platform/classifier/cocoa/CorePredictionSPI.h</a></li>
<li><a href="#trunkSourceWebKit2PlatformclassifiercocoaResourceLoadStatisticsClassifierCocoacpp">trunk/Source/WebKit2/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp</a></li>
<li><a href="#trunkSourceWebKit2PlatformclassifiercocoaResourceLoadStatisticsClassifierCocoah">trunk/Source/WebKit2/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h</a></li>
<li>trunk/Source/WebKit2/Resources/ResourceLoadStatistics/</li>
<li><a href="#trunkSourceWebKit2ResourcesResourceLoadStatisticscorePrediction_model">trunk/Source/WebKit2/Resources/ResourceLoadStatistics/corePrediction_model</a></li>
<li>trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework/</li>
<li><a href="#trunkWebKitLibrariesWebKitPrivateFrameworkStubsiOS10CorePredictionframeworkCorePredictiontbd">trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework/CorePrediction.tbd</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/LayoutTests/ChangeLog        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2017-02-20  John Wilander  &lt;wilander@apple.com&gt;
+
+        Resource Load Statistics: Add alternate classification method
+        https://bugs.webkit.org/show_bug.cgi?id=168347
+        &lt;rdar://problem/30352793&gt;
+
+        Reviewed by Alex Christensen.
+
+        * http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-expected.txt: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-expected.txt: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-expected.txt: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-expected.txt: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-expected.txt: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-expected.txt: Added.
+        * http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html: Added.
+        * platform/gtk/TestExpectations:
+            The whole http/tests/loading/resourceLoadStatistics marked as crashing based on
+            Carlos Garcia Campos's assessment in https://bugs.webkit.org/show_bug.cgi?id=168171.
+        * platform/wk2/TestExpectations:
+            The above tests are only valid for WebKit2. Marked as [ Pass ].
+
</ins><span class="cx"> 2017-02-20  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         LayoutTest fast/multicol/column-span-parent-continuation-crash.html is a flaky timeout
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonmixedstatisticsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-expected.txt (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-expected.txt        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+main frame - didReceiveTitle: Tests for Classification Based on Mixed Statistics
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
+PASS Host did not get classified as prevalent resource.
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonmixedstatisticshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+    &lt;meta charset=&quot;UTF-8&quot;&gt;
+    &lt;title&gt;Tests for Classification Based on Mixed Statistics&lt;/title&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+    const hostUnderTest = &quot;127.0.0.1:8000&quot;;
+    const statisticsUrl = &quot;http://&quot; + hostUnderTest + &quot;/temp&quot;;
+    const topFrameOrigin1 = &quot;http://127.0.0.2:8000/temp&quot;;
+    const topFrameOrigin2 = &quot;http://127.0.0.3:8000/temp&quot;;
+    const topFrameOrigin3 = &quot;http://127.0.0.4:8000/temp&quot;;
+    function runTestRunnerTest() {
+        testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get set as non-prevalent resource.&quot;);
+
+        testRunner.setStatisticsSubframeUnderTopFrameOrigin(statisticsUrl, topFrameOrigin1);
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin2);
+        testRunner.setStatisticsSubresourceUniqueRedirectTo(statisticsUrl, topFrameOrigin3);
+
+        testRunner.statisticsFireDataModificationHandler();
+
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host classified as prevalent resource.&quot;);
+        else
+            testPassed(&quot;Host did not get classified as prevalent resource.&quot;);
+
+        testRunner.statisticsResetToConsistentState();
+        testRunner.notifyDone();
+    }
+
+    if (document.location.host === hostUnderTest &amp;&amp; window.testRunner &amp;&amp; window.internals) {
+        testRunner.waitUntilDone();
+        internals.setResourceLoadStatisticsEnabled(true);
+        runTestRunnerTest();
+    }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonsubframeundertopframeoriginsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+main frame - didReceiveTitle: Tests for Classification Based on Sub Frame Under Top Frame Origins
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
+PASS Host did not get classified as prevalent resource.
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonsubframeundertopframeoriginshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+    &lt;meta charset=&quot;UTF-8&quot;&gt;
+    &lt;title&gt;Tests for Classification Based on Sub Frame Under Top Frame Origins&lt;/title&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+    const hostUnderTest = &quot;127.0.0.1:8000&quot;;
+    const statisticsUrl = &quot;http://&quot; + hostUnderTest + &quot;/temp&quot;;
+    const topFrameOrigin1 = &quot;http://127.0.0.2:8000/temp&quot;;
+    const topFrameOrigin2 = &quot;http://127.0.0.3:8000/temp&quot;;
+    const topFrameOrigin3 = &quot;http://127.0.0.4:8000/temp&quot;;
+    function runTestRunnerTest() {
+        testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get set as non-prevalent resource.&quot;);
+
+        testRunner.setStatisticsSubframeUnderTopFrameOrigin(statisticsUrl, topFrameOrigin1);
+        testRunner.setStatisticsSubframeUnderTopFrameOrigin(statisticsUrl, topFrameOrigin2);
+        testRunner.setStatisticsSubframeUnderTopFrameOrigin(statisticsUrl, topFrameOrigin3);
+
+        testRunner.statisticsFireDataModificationHandler();
+
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host classified as prevalent resource.&quot;);
+        else
+            testPassed(&quot;Host did not get classified as prevalent resource.&quot;);
+
+        testRunner.statisticsResetToConsistentState();
+        testRunner.notifyDone();
+    }
+
+    if (document.location.host === hostUnderTest &amp;&amp; window.testRunner &amp;&amp; window.internals) {
+        testRunner.waitUntilDone();
+        internals.setResourceLoadStatisticsEnabled(true);
+        runTestRunnerTest();
+    }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonsubresourceundertopframeoriginsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-expected.txt (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-expected.txt        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+main frame - didReceiveTitle: Tests for Classification Based on Subresource Under Top Frame Origins
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
+PASS Host did not get classified as prevalent resource.
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonsubresourceundertopframeoriginshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+    &lt;meta charset=&quot;UTF-8&quot;&gt;
+    &lt;title&gt;Tests for Classification Based on Subresource Under Top Frame Origins&lt;/title&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+    const hostUnderTest = &quot;127.0.0.1:8000&quot;;
+    const statisticsUrl = &quot;http://&quot; + hostUnderTest + &quot;/temp&quot;;
+    const topFrameOrigin1 = &quot;http://127.0.0.2:8000/temp&quot;;
+    const topFrameOrigin2 = &quot;http://127.0.0.3:8000/temp&quot;;
+    function runTestRunnerTest() {
+        testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get set as non-prevalent resource.&quot;);
+
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin1);
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin2);
+
+        testRunner.statisticsFireDataModificationHandler();
+
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host classified as prevalent resource.&quot;);
+        else
+            testPassed(&quot;Host did not get classified as prevalent resource.&quot;);
+
+        testRunner.statisticsResetToConsistentState();
+        testRunner.notifyDone();
+    }
+
+    if (document.location.host === hostUnderTest &amp;&amp; window.testRunner &amp;&amp; window.internals) {
+        testRunner.waitUntilDone();
+        internals.setResourceLoadStatisticsEnabled(true);
+        runTestRunnerTest();
+    }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonsubresourceuniqueredirectstoexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-expected.txt (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-expected.txt        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+main frame - didReceiveTitle: Tests for Classification Based on Subresource Unique Redirects To
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
+PASS Host did not get classified as prevalent resource.
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasnonprevalentbasedonsubresourceuniqueredirectstohtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+    &lt;meta charset=&quot;UTF-8&quot;&gt;
+    &lt;title&gt;Tests for Classification Based on Subresource Unique Redirects To&lt;/title&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+    const hostUnderTest = &quot;127.0.0.1:8000&quot;;
+    const statisticsUrl = &quot;http://&quot; + hostUnderTest + &quot;/temp&quot;;
+    const topFrameOrigin1 = &quot;http://127.0.0.2:8000/temp&quot;;
+    const topFrameOrigin2 = &quot;http://127.0.0.3:8000/temp&quot;;
+    function runTestRunnerTest() {
+        testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get set as non-prevalent resource.&quot;);
+
+        testRunner.setStatisticsSubresourceUniqueRedirectTo(statisticsUrl, topFrameOrigin1);
+        testRunner.setStatisticsSubresourceUniqueRedirectTo(statisticsUrl, topFrameOrigin2);
+
+        testRunner.statisticsFireDataModificationHandler();
+
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host classified as prevalent resource.&quot;);
+        else
+            testPassed(&quot;Host did not get classified as prevalent resource.&quot;);
+
+        testRunner.statisticsResetToConsistentState();
+        testRunner.notifyDone();
+    }
+
+    if (document.location.host === hostUnderTest &amp;&amp; window.testRunner &amp;&amp; window.internals) {
+        testRunner.waitUntilDone();
+        internals.setResourceLoadStatisticsEnabled(true);
+        runTestRunnerTest();
+    }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonmixedstatisticsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-expected.txt (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-expected.txt        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+main frame - didReceiveTitle: Tests for Classification Based on Mixed Statistics
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
+PASS Host classified as prevalent resource.
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonmixedstatisticshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+    &lt;meta charset=&quot;UTF-8&quot;&gt;
+    &lt;title&gt;Tests for Classification Based on Mixed Statistics&lt;/title&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+    const hostUnderTest = &quot;127.0.0.1:8000&quot;;
+    const statisticsUrl = &quot;http://&quot; + hostUnderTest + &quot;/temp&quot;;
+    const topFrameOrigin1 = &quot;http://127.0.0.2:8000/temp&quot;;
+    const topFrameOrigin2 = &quot;http://127.0.0.3:8000/temp&quot;;
+    const topFrameOrigin3 = &quot;http://127.0.0.4:8000/temp&quot;;
+    const topFrameOrigin4 = &quot;http://127.0.0.5:8000/temp&quot;;
+    function runTestRunnerTest() {
+        testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get set as non-prevalent resource.&quot;);
+
+        testRunner.setStatisticsSubframeUnderTopFrameOrigin(statisticsUrl, topFrameOrigin1);
+        testRunner.setStatisticsSubframeUnderTopFrameOrigin(statisticsUrl, topFrameOrigin4);
+
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin2);
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin3);
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin4);
+
+        testRunner.setStatisticsSubresourceUniqueRedirectTo(statisticsUrl, topFrameOrigin3);
+        testRunner.setStatisticsSubresourceUniqueRedirectTo(statisticsUrl, topFrameOrigin1);
+
+        testRunner.statisticsFireDataModificationHandler();
+
+        if (!testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get classified as prevalent resource.&quot;);
+        else
+            testPassed(&quot;Host classified as prevalent resource.&quot;);
+
+        testRunner.statisticsResetToConsistentState();
+        testRunner.notifyDone();
+    }
+
+    if (document.location.host === hostUnderTest &amp;&amp; window.testRunner &amp;&amp; window.internals) {
+        testRunner.waitUntilDone();
+        internals.setResourceLoadStatisticsEnabled(true);
+        runTestRunnerTest();
+    }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonsubframeundertopframeoriginsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+main frame - didReceiveTitle: Tests for Classification Based on Sub Frame Under Top Frame Origins
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
+PASS Host classified as prevalent resource.
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonsubframeundertopframeoriginshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+    &lt;meta charset=&quot;UTF-8&quot;&gt;
+    &lt;title&gt;Tests for Classification Based on Sub Frame Under Top Frame Origins&lt;/title&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+    const hostUnderTest = &quot;127.0.0.1:8000&quot;;
+    const statisticsUrl = &quot;http://&quot; + hostUnderTest + &quot;/temp&quot;;
+    const topFrameOrigin1 = &quot;http://127.0.0.2:8000/temp&quot;;
+    const topFrameOrigin2 = &quot;http://127.0.0.3:8000/temp&quot;;
+    const topFrameOrigin3 = &quot;http://127.0.0.4:8000/temp&quot;;
+    const topFrameOrigin4 = &quot;http://127.0.0.5:8000/temp&quot;;
+    function runTestRunnerTest() {
+        testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get set as non-prevalent resource.&quot;);
+
+        testRunner.setStatisticsSubframeUnderTopFrameOrigin(statisticsUrl, topFrameOrigin1);
+        testRunner.setStatisticsSubframeUnderTopFrameOrigin(statisticsUrl, topFrameOrigin2);
+        testRunner.setStatisticsSubframeUnderTopFrameOrigin(statisticsUrl, topFrameOrigin3);
+        testRunner.setStatisticsSubframeUnderTopFrameOrigin(statisticsUrl, topFrameOrigin4);
+
+        testRunner.statisticsFireDataModificationHandler();
+
+        if (!testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get classified as prevalent resource.&quot;);
+        else
+            testPassed(&quot;Host classified as prevalent resource.&quot;);
+
+        testRunner.statisticsResetToConsistentState();
+        testRunner.notifyDone();
+    }
+
+    if (document.location.host === hostUnderTest &amp;&amp; window.testRunner &amp;&amp; window.internals) {
+        testRunner.waitUntilDone();
+        internals.setResourceLoadStatisticsEnabled(true);
+        runTestRunnerTest();
+    }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonsubresourceundertopframeoriginsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-expected.txt (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-expected.txt        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+main frame - didReceiveTitle: Tests for Classification Based on Subresource Under Top Frame Origins
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
+PASS Host classified as prevalent resource.
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonsubresourceundertopframeoriginshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+    &lt;meta charset=&quot;UTF-8&quot;&gt;
+    &lt;title&gt;Tests for Classification Based on Subresource Under Top Frame Origins&lt;/title&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+    const hostUnderTest = &quot;127.0.0.1:8000&quot;;
+    const statisticsUrl = &quot;http://&quot; + hostUnderTest + &quot;/temp&quot;;
+    const topFrameOrigin1 = &quot;http://127.0.0.2:8000/temp&quot;;
+    const topFrameOrigin2 = &quot;http://127.0.0.3:8000/temp&quot;;
+    const topFrameOrigin3 = &quot;http://127.0.0.4:8000/temp&quot;;
+    const topFrameOrigin4 = &quot;http://127.0.0.5:8000/temp&quot;;
+    function runTestRunnerTest() {
+        testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get set as non-prevalent resource.&quot;);
+
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin1);
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin2);
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin3);
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin4);
+
+        testRunner.statisticsFireDataModificationHandler();
+
+        if (!testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get classified as prevalent resource.&quot;);
+        else
+            testPassed(&quot;Host classified as prevalent resource.&quot;);
+
+        testRunner.statisticsResetToConsistentState();
+        testRunner.notifyDone();
+    }
+
+    if (document.location.host === hostUnderTest &amp;&amp; window.testRunner &amp;&amp; window.internals) {
+        testRunner.waitUntilDone();
+        internals.setResourceLoadStatisticsEnabled(true);
+        runTestRunnerTest();
+    }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonsubresourceuniqueredirectstoexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-expected.txt (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-expected.txt        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+main frame - didReceiveTitle: Tests for Classification Based on Subresource Unique Redirects To
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
+PASS Host classified as prevalent resource.
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclassifyasprevalentbasedonsubresourceuniqueredirectstohtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+    &lt;meta charset=&quot;UTF-8&quot;&gt;
+    &lt;title&gt;Tests for Classification Based on Subresource Unique Redirects To&lt;/title&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+    const hostUnderTest = &quot;127.0.0.1:8000&quot;;
+    const statisticsUrl = &quot;http://&quot; + hostUnderTest + &quot;/temp&quot;;
+    const topFrameOrigin1 = &quot;http://127.0.0.2:8000/temp&quot;;
+    const topFrameOrigin2 = &quot;http://127.0.0.3:8000/temp&quot;;
+    const topFrameOrigin3 = &quot;http://127.0.0.4:8000/temp&quot;;
+    const topFrameOrigin4 = &quot;http://127.0.0.5:8000/temp&quot;;
+    function runTestRunnerTest() {
+        testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get set as non-prevalent resource.&quot;);
+
+        testRunner.setStatisticsSubresourceUniqueRedirectTo(statisticsUrl, topFrameOrigin1);
+        testRunner.setStatisticsSubresourceUniqueRedirectTo(statisticsUrl, topFrameOrigin2);
+        testRunner.setStatisticsSubresourceUniqueRedirectTo(statisticsUrl, topFrameOrigin3);
+        testRunner.setStatisticsSubresourceUniqueRedirectTo(statisticsUrl, topFrameOrigin4);
+
+        testRunner.statisticsFireDataModificationHandler();
+
+        if (!testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get classified as prevalent resource.&quot;);
+        else
+            testPassed(&quot;Host classified as prevalent resource.&quot;);
+
+        testRunner.statisticsResetToConsistentState();
+        testRunner.notifyDone();
+    }
+
+    if (document.location.host === hostUnderTest &amp;&amp; window.testRunner &amp;&amp; window.internals) {
+        testRunner.waitUntilDone();
+        internals.setResourceLoadStatisticsEnabled(true);
+        runTestRunnerTest();
+    }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -931,11 +931,7 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/163782 media/video-played-ranges-1.html [ Crash Pass ]
</span><span class="cx"> 
</span><del>-webkit.org/b/168171 http/tests/loading/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html [ Crash ]
-webkit.org/b/168171 http/tests/loading/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html [ Crash ]
-webkit.org/b/168171 http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html [ Crash ]
-webkit.org/b/168171 http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction.html [ Crash ]
-webkit.org/b/168171 http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-interaction.html [ Crash ]
</del><ins>+webkit.org/b/168171 http/tests/loading/resourceLoadStatistics [ Crash ]
</ins><span class="cx"> 
</span><span class="cx"> webkit.org/b/167576 imported/w3c/IndexedDB-private-browsing/idbcursor_iterating.html [ Crash ]
</span><span class="cx"> webkit.org/b/167576 imported/w3c/IndexedDB-private-browsing/idbcursor_iterating_index.html [ Crash ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/wk2/TestExpectations (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wk2/TestExpectations        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/LayoutTests/platform/wk2/TestExpectations        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -705,6 +705,14 @@
</span><span class="cx"> http/tests/loading/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html [ Pass Timeout ]
</span><span class="cx"> http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-interaction.html [ Pass Timeout ]
</span><span class="cx"> http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html [ Pass Timeout ]
</span><ins>+http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html [ Pass ]
+http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html [ Pass ]
+http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html [ Pass ]
+http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html [ Pass ]
+http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html [ Pass ]
+http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html [ Pass ]
+http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html [ Pass ]
+http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html [ Pass ]
</ins><span class="cx"> 
</span><span class="cx"> ### END OF (5) Progressions, expected successes that are expected failures in WebKit1.
</span><span class="cx"> ########################################
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WTF/ChangeLog        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-02-20  John Wilander  &lt;wilander@apple.com&gt;
+
+        Resource Load Statistics: Add alternate classification method
+        https://bugs.webkit.org/show_bug.cgi?id=168347
+        &lt;rdar://problem/30352793&gt;
+
+        Reviewed by Alex Christensen.
+
+        * wtf/Platform.h:
+            Added support for HAVE(CORE_PREDICTION).
+
</ins><span class="cx"> 2017-02-20  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r212618.
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Platform.h (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Platform.h        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WTF/wtf/Platform.h        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -1208,4 +1208,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif /* PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MAX_ALLOWED &gt;= 101201 &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200 */
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS) || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200)
+#define HAVE_CORE_PREDICTION 1
+#endif
+
</ins><span class="cx"> #endif /* WTF_Platform_h */
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebCore/ChangeLog        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2017-02-20  John Wilander  &lt;wilander@apple.com&gt;
+
+        Resource Load Statistics: Add alternate classification method
+        https://bugs.webkit.org/show_bug.cgi?id=168347
+        &lt;rdar://problem/30352793&gt;
+
+        Reviewed by Alex Christensen.
+
+        This patch only adds test infrastructure in WebCore.
+
+        Tests: http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
+               http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
+               http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
+               http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
+               http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
+               http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
+               http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
+               http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html
+
+        * loader/ResourceLoadObserver.cpp:
+        (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
+        (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
+        (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
+        * loader/ResourceLoadObserver.h:
+
</ins><span class="cx"> 2017-02-20  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use the new drag code path when dragging links
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadObservercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoadObserver.cpp (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoadObserver.cpp        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebCore/loader/ResourceLoadObserver.cpp        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -375,6 +375,33 @@
</span><span class="cx">     statistics.isPrevalentResource = false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ResourceLoadObserver::setSubframeUnderTopFrameOrigin(const URL&amp; subframe, const URL&amp; topFrame)
+{
+    if (subframe.isBlankURL() || subframe.isEmpty() || topFrame.isBlankURL() || topFrame.isEmpty())
+        return;
+    
+    auto&amp; statistics = m_store-&gt;ensureResourceStatisticsForPrimaryDomain(primaryDomain(subframe));
+    statistics.subframeUnderTopFrameOrigins.add(primaryDomain(topFrame));
+}
+
+void ResourceLoadObserver::setSubresourceUnderTopFrameOrigin(const URL&amp; subresource, const URL&amp; topFrame)
+{
+    if (subresource.isBlankURL() || subresource.isEmpty() || topFrame.isBlankURL() || topFrame.isEmpty())
+        return;
+    
+    auto&amp; statistics = m_store-&gt;ensureResourceStatisticsForPrimaryDomain(primaryDomain(subresource));
+    statistics.subresourceUnderTopFrameOrigins.add(primaryDomain(topFrame));
+}
+
+void ResourceLoadObserver::setSubresourceUniqueRedirectTo(const URL&amp; subresource, const URL&amp; hostNameRedirectedTo)
+{
+    if (subresource.isBlankURL() || subresource.isEmpty() || hostNameRedirectedTo.isBlankURL() || hostNameRedirectedTo.isEmpty())
+        return;
+    
+    auto&amp; statistics = m_store-&gt;ensureResourceStatisticsForPrimaryDomain(primaryDomain(subresource));
+    statistics.subresourceUniqueRedirectsTo.add(primaryDomain(hostNameRedirectedTo));
+}
+
</ins><span class="cx"> void ResourceLoadObserver::setTimeToLiveUserInteraction(double seconds)
</span><span class="cx"> {
</span><span class="cx">     m_store-&gt;setTimeToLiveUserInteraction(seconds);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadObserverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoadObserver.h (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoadObserver.h        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebCore/loader/ResourceLoadObserver.h        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -58,6 +58,10 @@
</span><span class="cx">     WEBCORE_EXPORT bool isPrevalentResource(const URL&amp;);
</span><span class="cx">     WEBCORE_EXPORT void clearPrevalentResource(const URL&amp;);
</span><span class="cx"> 
</span><ins>+    WEBCORE_EXPORT void setSubframeUnderTopFrameOrigin(const URL&amp; subframe, const URL&amp; topFrame);
+    WEBCORE_EXPORT void setSubresourceUnderTopFrameOrigin(const URL&amp; subresource, const URL&amp; topFrame);
+    WEBCORE_EXPORT void setSubresourceUniqueRedirectTo(const URL&amp; subresource, const URL&amp; hostNameRedirectedTo);
+
</ins><span class="cx">     WEBCORE_EXPORT void setTimeToLiveUserInteraction(double seconds);
</span><span class="cx">     WEBCORE_EXPORT void setReducedTimestampResolution(double seconds);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebKit2/ChangeLog        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -1,3 +1,79 @@
</span><ins>+2017-02-20  John Wilander  &lt;wilander@apple.com&gt;
+
+        Resource Load Statistics: Add alternate classification method
+        https://bugs.webkit.org/show_bug.cgi?id=168347
+        &lt;rdar://problem/30352793&gt;
+
+        Reviewed by Alex Christensen.
+
+        This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
+        The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
+        also adds functions to support layout tests of the feature.
+
+        * Configurations/BaseTarget.xcconfig:
+        * Configurations/WebKit.xcconfig:
+            Added dependency on CorePrediction.
+        * Platform/classifier: Added.
+        * Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
+            Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
+        (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
+        * Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
+        (WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
+            Shared classifier logic.
+        (WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
+            Fallback classifier for when we don't have CorePrediction.
+        * Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
+        (WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
+        (WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
+        * Platform/classifier/cocoa: Added.
+        * Platform/classifier/cocoa/CorePredictionSPI.h: Added.
+            Includes CorePrediction if available, otherwise declares needed symbols.
+            Always redeclares the functions so we'll get a build error if
+            CorePrediction changes.
+        * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
+        (WebKit::ResourceLoadStatisticsClassifier::classify):
+        (WebKit::ResourceLoadStatisticsClassifier::storagePath):
+        (WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePrediction):
+            The new classifier for Cocoa platforms.
+        * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
+        (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
+        * PlatformGTK.cmake:
+           Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
+        * PlatformMac.cmake:
+           Added Platform/classifier and Platform/classifier/cocoa directories, and
+           source files ResourceLoadStatisticsClassifierBase.cpp and
+           ResourceLoadStatisticsClassifierCocoa.cpp
+        * Resources/ResourceLoadStatistics: Added.
+        * Resources/ResourceLoadStatistics/corePrediction_model: Added.
+            Model file to load into CorePrediction.
+        * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
+        (WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
+        (WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
+        (WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
+            Test infrastructure.
+        * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
+        * UIProcess/WebResourceLoadStatisticsManager.cpp:
+        (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
+        (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
+        (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
+            Test infrastructure.
+        * UIProcess/WebResourceLoadStatisticsManager.h:
+        * UIProcess/WebResourceLoadStatisticsStore.cpp:
+        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
+            Renamed m_storagePath to m_statisticsStoragePath for clarity.
+        (WebKit::WebResourceLoadStatisticsStore::classifyResource):
+            Now calls the classifier through its ResourceLoadStatisticsClassifier
+            member variable.
+        (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
+            Renamed m_storagePath to m_statisticsStoragePath for clarity.
+        (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
+            Renamed m_storagePath to m_statisticsStoragePath for clarity.
+        (WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
+        * UIProcess/WebResourceLoadStatisticsStore.h:
+        * WebKit2.xcodeproj/project.pbxproj:
+            Added the new classifier source files under Platform/classifier and the
+            corePrediction_model file under Resources/ResourceLoadStatistics.
+
</ins><span class="cx"> 2017-02-20  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add plumbing to the UI process for TextIndicatorData when computing the drag image
</span></span></pre></div>
<a id="trunkSourceWebKit2ConfigurationsBaseTargetxcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Configurations/BaseTarget.xcconfig (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Configurations/BaseTarget.xcconfig        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebKit2/Configurations/BaseTarget.xcconfig        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> WK_PRIVATE_FRAMEWORKS_DIR_iphoneos_YES = $(SRCROOT)/../../WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/$(WK_TARGET_IOS_VERSION_MAJOR);
</span><span class="cx"> WK_PRIVATE_FRAMEWORKS_DIR_iphoneos_NO = $(PRODUCTION_FRAMEWORKS_DIR);
</span><span class="cx"> 
</span><del>-FRAMEWORK_SEARCH_PATHS_base = &quot;$(UMBRELLA_FRAMEWORKS_DIR)&quot; $(FRAMEWORK_SEARCH_PATHS);
</del><ins>+FRAMEWORK_SEARCH_PATHS_base = &quot;$(UMBRELLA_FRAMEWORKS_DIR)&quot; /System/Library/PrivateFrameworks $(FRAMEWORK_SEARCH_PATHS);
</ins><span class="cx"> FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(FRAMEWORK_SEARCH_PATHS_base) $(WK_PRIVATE_FRAMEWORKS_DIR);
</span><span class="cx"> FRAMEWORK_SEARCH_PATHS = $(FRAMEWORK_SEARCH_PATHS_base);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ConfigurationsWebKitxcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Configurations/WebKit.xcconfig (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Configurations/WebKit.xcconfig        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebKit2/Configurations/WebKit.xcconfig        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -34,12 +34,14 @@
</span><span class="cx"> INSTALL_PATH = $(WEBKIT_FRAMEWORKS_DIR);
</span><span class="cx"> DYLIB_INSTALL_NAME_BASE = $(NORMAL_WEBKIT_FRAMEWORKS_DIR);
</span><span class="cx"> 
</span><del>-FRAMEWORK_AND_LIBRARY_LDFLAGS_BASE_ios = -lobjc -framework AssertionServices -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CorePDF -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework UIKit -framework OpenGLES -framework MobileCoreServices -lMobileGestalt $(FRAMEWORK_AND_LIBRARY_LDFLAGS_PLATFORM_$(PLATFORM_NAME));
</del><ins>+FRAMEWORK_AND_LIBRARY_LDFLAGS_BASE_ios = -lobjc -framework AssertionServices -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CorePDF -framework CorePrediction -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework UIKit -framework OpenGLES -framework MobileCoreServices -lMobileGestalt $(FRAMEWORK_AND_LIBRARY_LDFLAGS_PLATFORM_$(PLATFORM_NAME));
</ins><span class="cx"> FRAMEWORK_AND_LIBRARY_LDFLAGS[sdk=iphoneos*] = $(FRAMEWORK_AND_LIBRARY_LDFLAGS_BASE_ios) -framework IOSurface;
</span><span class="cx"> FRAMEWORK_AND_LIBRARY_LDFLAGS[sdk=iphonesimulator*] = $(FRAMEWORK_AND_LIBRARY_LDFLAGS_BASE_ios);
</span><span class="cx"> FRAMEWORK_AND_LIBRARY_LDFLAGS_PLATFORM_iphoneos = ;
</span><span class="cx"> FRAMEWORK_AND_LIBRARY_LDFLAGS_PLATFORM_iphonesimulator = ;
</span><del>-FRAMEWORK_AND_LIBRARY_LDFLAGS[sdk=macosx*] = -framework ApplicationServices -framework Carbon -framework Cocoa -framework CoreServices -framework IOKit -framework CoreAudio -framework IOSurface -framework OpenGL;
</del><ins>+FRAMEWORK_AND_LIBRARY_LDFLAGS[sdk=macosx*] = -framework ApplicationServices -framework Carbon -framework Cocoa -framework CoreServices -framework IOKit -framework CoreAudio -framework IOSurface -framework OpenGL $(EXTRA_FRAMEWORK_AND_LIBRARY_LDFLAGS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+EXTRA_FRAMEWORK_AND_LIBRARY_LDFLAGS_101200 = -framework CorePrediction;
+EXTRA_FRAMEWORK_AND_LIBRARY_LDFLAGS_101300 = -framework CorePrediction;
</ins><span class="cx"> 
</span><span class="cx"> // Prevent C++ standard library operator new, delete and their related exception types from being exported as weak symbols.
</span><span class="cx"> UNEXPORTED_SYMBOL_LDFLAGS = -Wl,-unexported_symbol -Wl,__ZTISt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTISt9exception -Wl,-unexported_symbol -Wl,__ZTSSt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTSSt9exception -Wl,-unexported_symbol -Wl,__ZdlPvS_ -Wl,-unexported_symbol -Wl,__ZnwmPv -Wl,-unexported_symbol -Wl,__Znwm -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC2EOS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC1EOS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEaSEDn -Wl,-unexported_symbol, -Wl,__ZNKSt3__18functionIFvN7WebCore12PolicyActionEEEclES2_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEE4swapERS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC1ERKS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC2ERKS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore
 12PolicyActionEEED1Ev -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEED2Ev -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEaSERKS4_ -Wl,-unexported_symbol, -Wl,__ZTVNSt3__117bad_function_callE;
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformclassifierResourceLoadStatisticsClassifierhfromrev212681trunkSourceWebKit2UIProcessWebResourceLoadStatisticsManagerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Platform/classifier/ResourceLoadStatisticsClassifier.h (from rev 212681, trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h) (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/classifier/ResourceLoadStatisticsClassifier.h                                (rev 0)
+++ trunk/Source/WebKit2/Platform/classifier/ResourceLoadStatisticsClassifier.h        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include &lt;wtf/Platform.h&gt;
+
+#if PLATFORM(COCOA)
+#include &quot;ResourceLoadStatisticsClassifierCocoa.h&quot;
+#else
+
+#include &quot;ResourceLoadStatisticsClassifierBase.h&quot;
+
+namespace WebKit {
+
+class ResourceLoadStatisticsClassifier : public ResourceLoadStatisticsClassifierBase {
+public:
+    ResourceLoadStatisticsClassifier()
+    : ResourceLoadStatisticsClassifierBase() { }
+    
+protected:
+    bool classify(const unsigned a, const unsigned b, const unsigned c) override
+    {
+        return classifyWithVectorThreshold(a, b, c);
+    }
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2PlatformclassifierResourceLoadStatisticsClassifierBasecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp                                (rev 0)
+++ trunk/Source/WebKit2/Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ResourceLoadStatisticsClassifierBase.h&quot;
+
+#include &lt;WebCore/ResourceLoadStatistics.h&gt;
+
+using namespace WebCore;
+
+namespace WebKit {
+
+static const auto featureVectorLengthThreshold = 3;
+bool ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics(const ResourceLoadStatistics&amp; resourceStatistic)
+{
+    auto subresourceUnderTopFrameOriginsCount = resourceStatistic.subresourceUnderTopFrameOrigins.size();
+    auto subresourceUniqueRedirectsToCount = resourceStatistic.subresourceUniqueRedirectsTo.size();
+    auto subframeUnderTopFrameOriginsCount = resourceStatistic.subframeUnderTopFrameOrigins.size();
+    
+    if (!subresourceUnderTopFrameOriginsCount
+        &amp;&amp; !subresourceUniqueRedirectsToCount
+        &amp;&amp; !subframeUnderTopFrameOriginsCount)
+        return false;
+    
+    if (subresourceUnderTopFrameOriginsCount &gt; featureVectorLengthThreshold
+        || subresourceUniqueRedirectsToCount &gt; featureVectorLengthThreshold
+        || subframeUnderTopFrameOriginsCount &gt; featureVectorLengthThreshold)
+        return true;
+
+    return classify(subresourceUnderTopFrameOriginsCount, subresourceUniqueRedirectsToCount, subframeUnderTopFrameOriginsCount);
+}
+
+bool ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold(const unsigned a, const unsigned b, const unsigned c)
+{
+    return sqrt(a * a + b * b + c * c) &gt; featureVectorLengthThreshold;
+}
+    
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2PlatformclassifierResourceLoadStatisticsClassifierBasehfromrev212681trunkSourceWebKit2UIProcessWebResourceLoadStatisticsManagerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Platform/classifier/ResourceLoadStatisticsClassifierBase.h (from rev 212681, trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h) (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/classifier/ResourceLoadStatisticsClassifierBase.h                                (rev 0)
+++ trunk/Source/WebKit2/Platform/classifier/ResourceLoadStatisticsClassifierBase.h        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+struct ResourceLoadStatistics;
+}
+
+namespace WebKit {
+
+class ResourceLoadStatisticsClassifierBase {
+public:
+    bool hasPrevalentResourceCharacteristics(const WebCore::ResourceLoadStatistics&amp; resourceStatistic);
+protected:
+    ResourceLoadStatisticsClassifierBase() { }
+    virtual ~ResourceLoadStatisticsClassifierBase() { }
+    virtual bool classify(const unsigned, const unsigned, const unsigned) = 0;
+    bool classifyWithVectorThreshold(const unsigned, const unsigned, const unsigned);
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2PlatformclassifiercocoaCorePredictionSPIhfromrev212681trunkSourceWebKit2UIProcessWebResourceLoadStatisticsManagerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Platform/classifier/cocoa/CorePredictionSPI.h (from rev 212681, trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h) (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/classifier/cocoa/CorePredictionSPI.h                                (rev 0)
+++ trunk/Source/WebKit2/Platform/classifier/cocoa/CorePredictionSPI.h        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(APPLE_INTERNAL_SDK) &amp;&amp; HAVE(CORE_PREDICTION)
+#include &lt;CorePrediction/svm.h&gt;
+#else
+
+struct svm_node {
+    int index;
+    double value;
+};
+
+struct svm_model { };
+
+#endif
+
+#ifdef __cplusplus
+extern &quot;C&quot; {
+#endif
+
+double svm_predict_values(const struct svm_model*, const struct svm_node*, double*);
+
+struct svm_model *svm_load_model(const char*);
+
+#ifdef __cplusplus
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2PlatformclassifiercocoaResourceLoadStatisticsClassifierCocoacpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp                                (rev 0)
+++ trunk/Source/WebKit2/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,114 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ResourceLoadStatisticsClassifierCocoa.h&quot;
+
+#include &quot;Logging.h&quot;
+
+namespace WebKit {
+
+bool ResourceLoadStatisticsClassifier::classify(const unsigned subresourceUnderTopFrameOriginsCount, const unsigned subresourceUniqueRedirectsToCount, const unsigned subframeUnderTopFrameOriginsCount)
+{
+    if (!shouldUseCorePrediction())
+        return classifyWithVectorThreshold(subresourceUnderTopFrameOriginsCount, subresourceUniqueRedirectsToCount, subframeUnderTopFrameOriginsCount);
+
+#if HAVE(CORE_PREDICTION)
+    Vector&lt;unsigned&gt; nonZeroFeatures;
+    Vector&lt;unsigned&gt; indices;
+
+    if (subresourceUnderTopFrameOriginsCount) {
+        nonZeroFeatures.append(subresourceUnderTopFrameOriginsCount);
+        indices.append(1);
+    }
+    if (subresourceUniqueRedirectsToCount) {
+        nonZeroFeatures.append(subresourceUniqueRedirectsToCount);
+        indices.append(2);
+    }
+    if (subframeUnderTopFrameOriginsCount) {
+        nonZeroFeatures.append(subframeUnderTopFrameOriginsCount);
+        indices.append(3);
+    }
+
+    svm_node* exampleVector = new svm_node[nonZeroFeatures.size() + 1];
+    for (size_t i = 0; i &lt; nonZeroFeatures.size(); i++) {
+        exampleVector[i].index = indices.at(i);
+        exampleVector[i].value = nonZeroFeatures.at(i);
+    }
+    // Add termination node with index -1.
+    exampleVector[nonZeroFeatures.size()].index = -1;
+    exampleVector[nonZeroFeatures.size()].value = -1;
+
+    int classification;
+    double score;
+    classification = svm_predict_values(m_corePredictionModel, exampleVector, &amp;score);
+    delete[] exampleVector;
+    return classification &lt; 0;
+#endif
+    return false;
+}
+
+String ResourceLoadStatisticsClassifier::storagePath()
+{
+    CFBundleRef webKitBundle = CFBundleGetBundleWithIdentifier(CFSTR(&quot;com.apple.WebKit&quot;));
+    RetainPtr&lt;CFURLRef&gt; resourceUrl = adoptCF(CFBundleCopyResourcesDirectoryURL(webKitBundle));
+    resourceUrl = adoptCF(CFURLCreateCopyAppendingPathComponent(nullptr, resourceUrl.get(), CFSTR(&quot;corePrediction_model&quot;), false));
+    CFErrorRef error = nullptr;
+    resourceUrl = adoptCF(CFURLCreateFilePathURL(nullptr, resourceUrl.get(), &amp;error));
+
+    if (error || !resourceUrl)
+        return String();
+
+    RetainPtr&lt;CFStringRef&gt; resourceUrlString = adoptCF(CFURLCopyFileSystemPath(resourceUrl.get(), kCFURLPOSIXPathStyle));
+    return String(resourceUrlString.get());
+}
+
+bool ResourceLoadStatisticsClassifier::shouldUseCorePrediction()
+{
+#if HAVE(CORE_PREDICTION)
+    if (m_corePredictionModel)
+        return true;
+
+    if (!m_useCorePrediction)
+        return false;
+
+    String storagePathStr = storagePath();
+    if (storagePathStr.isNull() || storagePathStr.isEmpty()) {
+        m_useCorePrediction = false;
+        return false;
+    }
+
+    m_corePredictionModel = svm_load_model((storagePathStr).utf8().data());
+    
+    if (m_corePredictionModel)
+        return true;
+
+    WTFLogAlways(&quot;ResourceLoadStatisticsClassifier::shouldUseCorePrediction(): Couldn't load model file at path %s.&quot;, storagePathStr.utf8().data());
+    m_useCorePrediction = false;
+#endif
+    return false;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2PlatformclassifiercocoaResourceLoadStatisticsClassifierCocoahfromrev212681trunkSourceWebKit2UIProcessWebResourceLoadStatisticsManagerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h (from rev 212681, trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h) (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h                                (rev 0)
+++ trunk/Source/WebKit2/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if HAVE(CORE_PREDICTION)
+#include &quot;CorePredictionSPI.h&quot;
+#endif
+#include &quot;ResourceLoadStatisticsClassifierBase.h&quot;
+#include &lt;CoreFoundation/CoreFoundation.h&gt;
+#include &lt;wtf/Platform.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebKit {
+
+class ResourceLoadStatisticsClassifier : public ResourceLoadStatisticsClassifierBase {
+
+public:
+    ResourceLoadStatisticsClassifier()
+        : ResourceLoadStatisticsClassifierBase() { }
+
+private:
+    bool classify(const unsigned, const unsigned, const unsigned) override;
+    String storagePath();
+    bool shouldUseCorePrediction();
+#if HAVE(CORE_PREDICTION)
+    struct svm_model* m_corePredictionModel;
+    bool m_useCorePrediction { true };
+#endif
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -46,6 +46,8 @@
</span><span class="cx">     Platform/IPC/unix/AttachmentUnix.cpp
</span><span class="cx">     Platform/IPC/unix/ConnectionUnix.cpp
</span><span class="cx"> 
</span><ins>+    Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp
+
</ins><span class="cx">     Platform/glib/ModuleGlib.cpp
</span><span class="cx"> 
</span><span class="cx">     Platform/unix/LoggingUnix.cpp
</span><span class="lines">@@ -852,6 +854,7 @@
</span><span class="cx">     &quot;${WEBKIT2_DIR}/NetworkProcess/soup&quot;
</span><span class="cx">     &quot;${WEBKIT2_DIR}/NetworkProcess/unix&quot;
</span><span class="cx">     &quot;${WEBKIT2_DIR}/Platform/IPC/glib&quot;
</span><ins>+    &quot;${WEBKIT2_DIR}/Platform/classifier&quot;
</ins><span class="cx">     &quot;${WEBKIT2_DIR}/Shared/API/c/gtk&quot;
</span><span class="cx">     &quot;${WEBKIT2_DIR}/Shared/Plugins/unix&quot;
</span><span class="cx">     &quot;${WEBKIT2_DIR}/Shared/glib&quot;
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformMac.cmake (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformMac.cmake        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebKit2/PlatformMac.cmake        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -49,6 +49,10 @@
</span><span class="cx"> 
</span><span class="cx">     Platform/cg/CGUtilities.cpp
</span><span class="cx"> 
</span><ins>+    Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp
+
+    Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp
+
</ins><span class="cx">     Platform/foundation/LoggingFoundation.mm
</span><span class="cx"> 
</span><span class="cx">     Platform/cocoa/SharedMemoryCocoa.cpp
</span><span class="lines">@@ -392,6 +396,8 @@
</span><span class="cx">     &quot;${WEBKIT2_DIR}/UIProcess/Scrolling&quot;
</span><span class="cx">     &quot;${WEBKIT2_DIR}/UIProcess/ios&quot;
</span><span class="cx">     &quot;${WEBKIT2_DIR}/Platform/cg&quot;
</span><ins>+    &quot;${WEBKIT2_DIR}/Platform/classifier&quot;
+    &quot;${WEBKIT2_DIR}/Platform/classifier/cocoa&quot;
</ins><span class="cx">     &quot;${WEBKIT2_DIR}/Platform/mac&quot;
</span><span class="cx">     &quot;${WEBKIT2_DIR}/Platform/unix&quot;
</span><span class="cx">     &quot;${WEBKIT2_DIR}/Platform/spi/Cocoa&quot;
</span></span></pre></div>
<a id="trunkSourceWebKit2ResourcesResourceLoadStatisticscorePrediction_model"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Resources/ResourceLoadStatistics/corePrediction_model (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Resources/ResourceLoadStatistics/corePrediction_model                                (rev 0)
+++ trunk/Source/WebKit2/Resources/ResourceLoadStatistics/corePrediction_model        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,678 @@
</span><ins>+svm_type c_svc
+kernel_type rbf
+gamma 0.1
+nr_class 2
+total_sv 330
+rho 0.287945642261
+label -1 1
+nr_sv 300 30
+SV
+-0.0546697038724 1:14.0 2:3.0 3:7.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:12.0 
+-0.0546697038724 1:7.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:3.0 2:16.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 2:2.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:3.0 2:1.0 
+-0.0546697038724 1:5.0 
+-0.0546697038724 1:16.0 2:2.0 3:2.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:11.0 
+-0.0546697038724 1:4.0 3:3.0 
+-0.0546697038724 1:28.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:22.0 2:1.0 3:12.0 
+-0.0546697038724 1:14.0 3:5.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:48.0 2:1.0 
+-0.0546697038724 1:25.0 3:16.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:6.0 
+-0.0546697038724 1:7.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:3.0 3:2.0 
+-0.0546697038724 1:7.0 2:1.0 3:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:7.0 
+-0.0546697038724 1:5.0 2:2.0 3:3.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:9.0 3:4.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:47.0 2:21.0 3:33.0 
+-0.0546697038724 1:11.0 2:2.0 3:5.0 
+-0.0546697038724 1:11.0 2:3.0 3:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:43.0 3:2.0 
+-0.0546697038724 1:13.0 3:7.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:13.0 3:4.0 
+-0.0546697038724 1:42.0 2:4.0 3:32.0 
+-0.0546697038724 1:10.0 2:5.0 3:1.0 
+-0.0546697038724 1:7.0 3:4.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:6.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:6.0 
+-0.0546697038724 1:16.0 2:4.0 
+-0.0546697038724 1:10.0 2:1.0 3:2.0 
+-0.0546697038724 1:18.0 2:3.0 3:6.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:3.0 2:1.0 3:1.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:3.0 
+-0.0546697038724 1:3.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:2.0 3:2.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:21.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:2.0 2:2.0 
+-0.0546697038724 1:14.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:2.0 3:2.0 
+-0.0546697038724 1:4.0 3:3.0 
+-0.0546697038724 1:2.0 3:1.0 
+-0.0546697038724 1:3.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:39.0 3:4.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 2:1.0 3:1.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 2:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:3.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:16.0 2:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:3.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:20.0 3:3.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:8.0 
+-0.0546697038724 1:7.0 2:1.0 3:2.0 
+-0.0546697038724 1:8.0 2:2.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:12.0 3:7.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:9.0 
+-0.0546697038724 1:7.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:8.0 2:2.0 
+-0.0546697038724 1:17.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:13.0 2:4.0 3:2.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:2.0 3:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:16.0 
+-0.0546697038724 1:3.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:3.0 3:3.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:11.0 3:11.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:15.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:20.0 2:12.0 3:3.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:7.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:3.0 3:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:9.0 2:3.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:6.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:7.0 2:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:9.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:14.0 
+-0.0546697038724 1:12.0 3:6.0 
+-0.0546697038724 1:3.0 
+-0.0546697038724 1:4.0 2:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:9.0 
+-0.0546697038724 1:9.0 2:1.0 3:4.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:9.0 2:1.0 
+-0.0546697038724 1:3.0 2:3.0 
+-0.0546697038724 1:2.0 2:2.0 
+-0.0546697038724 1:1.0 2:1.0 3:1.0 
+-0.0546697038724 1:8.0 2:1.0 3:3.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:9.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:36.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:6.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:4.0 3:2.0 
+-0.0546697038724 1:13.0 3:4.0 
+-0.0546697038724 1:1.0 
+-0.0402075178942 1:1.0 
+0.585365853659 1:1.0 
+0.479276139001 1:6.0 2:3.0 
+0.585365853659 1:2.0 
+0.585365853659 1:1.0 
+0.585365853659 1:3.0 3:3.0 
+0.585365853659 1:42.0 2:2.0 3:28.0 
+0.585365853659 1:2.0 
+0.585365853659 1:12.0 
+0.479283046578 1:7.0 
+0.300397873476 1:3.0 3:1.0 
+0.0543173306442 1:6.0 3:2.0 
+0.563465126299 1:11.0 
+0.585365853659 1:2.0 
+0.585365853659 1:10.0 2:3.0 3:6.0 
+0.585365853659 1:1.0 2:1.0 
+0.585365853659 1:2.0 
+0.585365853659 1:1.0 2:1.0 
+0.585365853659 1:3.0 3:1.0 
+0.585365853659 1:1.0 
+0.585365853659 1:2.0 
+0.585365853659 1:1.0 2:1.0 
+0.584989719909 1:7.0 
+0.585365853659 1:3.0 
+0.585365853659 1:3.0 
+0.525925136983 1:3.0 2:2.0 
+0.585365853659 1:1.0 
+0.585365853659 1:1.0 
+0.585365853659 1:3.0 3:1.0 
+0.585365853659 1:1.0 
+0.520745822374 1:3.0 
+svm_type c_svc
+kernel_type rbf
+gamma 0.1
+nr_class 2
+total_sv 330
+rho 0.287945642261
+label -1 1
+nr_sv 300 30
+SV
+-0.0546697038724 1:14.0 2:3.0 3:7.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:12.0 
+-0.0546697038724 1:7.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:3.0 2:16.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 2:2.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:3.0 2:1.0 
+-0.0546697038724 1:5.0 
+-0.0546697038724 1:16.0 2:2.0 3:2.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:11.0 
+-0.0546697038724 1:4.0 3:3.0 
+-0.0546697038724 1:28.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:22.0 2:1.0 3:12.0 
+-0.0546697038724 1:14.0 3:5.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:48.0 2:1.0 
+-0.0546697038724 1:25.0 3:16.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:6.0 
+-0.0546697038724 1:7.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:3.0 3:2.0 
+-0.0546697038724 1:7.0 2:1.0 3:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:7.0 
+-0.0546697038724 1:5.0 2:2.0 3:3.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:9.0 3:4.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:47.0 2:21.0 3:33.0 
+-0.0546697038724 1:11.0 2:2.0 3:5.0 
+-0.0546697038724 1:11.0 2:3.0 3:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:43.0 3:2.0 
+-0.0546697038724 1:13.0 3:7.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:13.0 3:4.0 
+-0.0546697038724 1:42.0 2:4.0 3:32.0 
+-0.0546697038724 1:10.0 2:5.0 3:1.0 
+-0.0546697038724 1:7.0 3:4.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:6.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:6.0 
+-0.0546697038724 1:16.0 2:4.0 
+-0.0546697038724 1:10.0 2:1.0 3:2.0 
+-0.0546697038724 1:18.0 2:3.0 3:6.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:3.0 2:1.0 3:1.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:3.0 
+-0.0546697038724 1:3.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:2.0 3:2.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:21.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:2.0 2:2.0 
+-0.0546697038724 1:14.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:2.0 3:2.0 
+-0.0546697038724 1:4.0 3:3.0 
+-0.0546697038724 1:2.0 3:1.0 
+-0.0546697038724 1:3.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:39.0 3:4.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 2:1.0 3:1.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 2:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:3.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:16.0 2:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:3.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:20.0 3:3.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:8.0 
+-0.0546697038724 1:7.0 2:1.0 3:2.0 
+-0.0546697038724 1:8.0 2:2.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:12.0 3:7.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:9.0 
+-0.0546697038724 1:7.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 2:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:8.0 2:2.0 
+-0.0546697038724 1:17.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:13.0 2:4.0 3:2.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:2.0 3:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:16.0 
+-0.0546697038724 1:3.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:3.0 3:3.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:11.0 3:11.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:15.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:20.0 2:12.0 3:3.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:7.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:3.0 3:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:9.0 2:3.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:6.0 
+-0.0546697038724 1:4.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:7.0 2:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:9.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:14.0 
+-0.0546697038724 1:12.0 3:6.0 
+-0.0546697038724 1:3.0 
+-0.0546697038724 1:4.0 2:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:9.0 
+-0.0546697038724 1:9.0 2:1.0 3:4.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:9.0 2:1.0 
+-0.0546697038724 1:3.0 2:3.0 
+-0.0546697038724 1:2.0 2:2.0 
+-0.0546697038724 1:1.0 2:1.0 3:1.0 
+-0.0546697038724 1:8.0 2:1.0 3:3.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 2:1.0 
+-0.0546697038724 1:9.0 2:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:36.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:6.0 
+-0.0546697038724 1:1.0 3:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:1.0 
+-0.0546697038724 1:2.0 
+-0.0546697038724 1:4.0 3:2.0 
+-0.0546697038724 1:13.0 3:4.0 
+-0.0546697038724 1:1.0 
+-0.0402075178942 1:1.0 
+0.585365853659 1:1.0 
+0.479276139001 1:6.0 2:3.0 
+0.585365853659 1:2.0 
+0.585365853659 1:1.0 
+0.585365853659 1:3.0 3:3.0 
+0.585365853659 1:42.0 2:2.0 3:28.0 
+0.585365853659 1:2.0 
+0.585365853659 1:12.0 
+0.479283046578 1:7.0 
+0.300397873476 1:3.0 3:1.0 
+0.0543173306442 1:6.0 3:2.0 
+0.563465126299 1:11.0 
+0.585365853659 1:2.0 
+0.585365853659 1:10.0 2:3.0 3:6.0 
+0.585365853659 1:1.0 2:1.0 
+0.585365853659 1:2.0 
+0.585365853659 1:1.0 2:1.0 
+0.585365853659 1:3.0 3:1.0 
+0.585365853659 1:1.0 
+0.585365853659 1:2.0 
+0.585365853659 1:1.0 2:1.0 
+0.584989719909 1:7.0 
+0.585365853659 1:3.0 
+0.585365853659 1:3.0 
+0.525925136983 1:3.0 2:2.0 
+0.585365853659 1:1.0 
+0.585365853659 1:1.0 
+0.585365853659 1:3.0 3:1.0 
+0.585365853659 1:1.0 
+0.520745822374 1:3.0 
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKResourceLoadStatisticsManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -56,6 +56,21 @@
</span><span class="cx">     return WebResourceLoadStatisticsManager::hasHadUserInteraction(toWTFString(hostName));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName)
+{
+    WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin(toWTFString(hostName), toWTFString(topFrameHostName));
+}
+
+void WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName)
+{
+    WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin(toWTFString(hostName), toWTFString(topFrameHostName));
+}
+
+void WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo(WKStringRef hostName, WKStringRef hostNameRedirectedTo)
+{
+    WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo(toWTFString(hostName), toWTFString(hostNameRedirectedTo));
+}
+
</ins><span class="cx"> void WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction(double seconds)
</span><span class="cx"> {
</span><span class="cx">     WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction(seconds);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKResourceLoadStatisticsManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -38,6 +38,9 @@
</span><span class="cx">     WK_EXPORT bool WKResourceLoadStatisticsManagerIsPrevalentResource(WKStringRef hostName);
</span><span class="cx">     WK_EXPORT void WKResourceLoadStatisticsManagerSetHasHadUserInteraction(WKStringRef hostName, bool value);
</span><span class="cx">     WK_EXPORT bool WKResourceLoadStatisticsManagerIsHasHadUserInteraction(WKStringRef hostName);
</span><ins>+    WK_EXPORT void WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName);
+    WK_EXPORT void WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName);
+    WK_EXPORT void WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo(WKStringRef hostName, WKStringRef hostNameRedirectedTo);
</ins><span class="cx">     WK_EXPORT void WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction(double seconds);
</span><span class="cx">     WK_EXPORT void WKResourceLoadStatisticsManagerSetReducedTimestampResolution(double seconds);
</span><span class="cx">     WK_EXPORT void WKResourceLoadStatisticsManagerFireDataModificationHandler();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebResourceLoadStatisticsManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.cpp (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.cpp        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.cpp        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -61,6 +61,21 @@
</span><span class="cx">     return WebCore::ResourceLoadObserver::sharedObserver().hasHadUserInteraction(URL(URL(), hostName));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin(const String&amp; hostName, const String&amp; topFrameHostName)
+{
+    WebCore::ResourceLoadObserver::sharedObserver().setSubframeUnderTopFrameOrigin(URL(URL(), hostName), URL(URL(), topFrameHostName));
+}
+
+void WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin(const String&amp; hostName, const String&amp; topFrameHostName)
+{
+    WebCore::ResourceLoadObserver::sharedObserver().setSubresourceUnderTopFrameOrigin(URL(URL(), hostName), URL(URL(), topFrameHostName));
+}
+
+void WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo(const String&amp; hostName, const String&amp; hostNameRedirectedTo)
+{
+    WebCore::ResourceLoadObserver::sharedObserver().setSubresourceUniqueRedirectTo(URL(URL(), hostName), URL(URL(), hostNameRedirectedTo));
+}
+
</ins><span class="cx"> void WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction(double seconds)
</span><span class="cx"> {
</span><span class="cx">     WebCore::ResourceLoadObserver::sharedObserver().setTimeToLiveUserInteraction(seconds);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebResourceLoadStatisticsManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -42,6 +42,9 @@
</span><span class="cx">     static bool isPrevalentResource(const String&amp; hostName);
</span><span class="cx">     static void setHasHadUserInteraction(const String&amp; hostName, bool value);
</span><span class="cx">     static bool hasHadUserInteraction(const String&amp; hostName);
</span><ins>+    static void setSubframeUnderTopFrameOrigin(const String&amp; hostName, const String&amp; topFrameHostName);
+    static void setSubresourceUnderTopFrameOrigin(const String&amp; hostName, const String&amp; topFrameHostName);
+    static void setSubresourceUniqueRedirectTo(const String&amp; hostName, const String&amp; hostNameRedirectedTo);
</ins><span class="cx">     static void setTimeToLiveUserInteraction(double seconds);
</span><span class="cx">     static void setReducedTimestampResolution(double seconds);
</span><span class="cx">     static void fireDataModificationHandler();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebResourceLoadStatisticsStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -45,7 +45,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-static const auto featureVectorLengthThreshold = 3;
</del><span class="cx"> static auto minimumTimeBetweeenDataRecordsRemoval = 60;
</span><span class="cx"> static OptionSet&lt;WebKit::WebsiteDataType&gt; dataTypesToRemove;
</span><span class="cx"> static auto notifyPages = false;
</span><span class="lines">@@ -59,7 +58,7 @@
</span><span class="cx"> WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore(const String&amp; resourceLoadStatisticsDirectory)
</span><span class="cx">     : m_resourceLoadStatisticsStore(ResourceLoadStatisticsStore::create())
</span><span class="cx">     , m_statisticsQueue(WorkQueue::create(&quot;WebResourceLoadStatisticsStore Process Data Queue&quot;))
</span><del>-    , m_storagePath(resourceLoadStatisticsDirectory)
</del><ins>+    , m_statisticsStoragePath(resourceLoadStatisticsDirectory)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -83,40 +82,11 @@
</span><span class="cx">         minimumTimeBetweeenDataRecordsRemoval = seconds;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics(const ResourceLoadStatistics&amp; resourceStatistic)
-{
-    auto subresourceUnderTopFrameOriginsCount = resourceStatistic.subresourceUnderTopFrameOrigins.size();
-    auto subresourceUniqueRedirectsToCount = resourceStatistic.subresourceUniqueRedirectsTo.size();
-    auto subframeUnderTopFrameOriginsCount = resourceStatistic.subframeUnderTopFrameOrigins.size();
-    
-    if (!subresourceUnderTopFrameOriginsCount
-        &amp;&amp; !subresourceUniqueRedirectsToCount
-        &amp;&amp; !subframeUnderTopFrameOriginsCount)
-        return false;
-
-    if (subresourceUnderTopFrameOriginsCount &gt; featureVectorLengthThreshold
-        || subresourceUniqueRedirectsToCount &gt; featureVectorLengthThreshold
-        || subframeUnderTopFrameOriginsCount &gt; featureVectorLengthThreshold)
-        return true;
-
-    // The resource is considered prevalent if the feature vector
-    // is longer than the threshold.
-    // Vector length for n dimensions is sqrt(a^2 + (...) + n^2).
-    double vectorLength = 0;
-    vectorLength += subresourceUnderTopFrameOriginsCount * subresourceUnderTopFrameOriginsCount;
-    vectorLength += subresourceUniqueRedirectsToCount * subresourceUniqueRedirectsToCount;
-    vectorLength += subframeUnderTopFrameOriginsCount * subframeUnderTopFrameOriginsCount;
-
-    ASSERT(vectorLength &gt; 0);
-
-    return sqrt(vectorLength) &gt; featureVectorLengthThreshold;
-}
-    
</del><span class="cx"> void WebResourceLoadStatisticsStore::classifyResource(ResourceLoadStatistics&amp; resourceStatistic)
</span><span class="cx"> {
</span><del>-    if (!resourceStatistic.isPrevalentResource &amp;&amp; hasPrevalentResourceCharacteristics(resourceStatistic)) {
</del><ins>+    if (!resourceStatistic.isPrevalentResource
+        &amp;&amp; m_resourceLoadStatisticsClassifier.hasPrevalentResourceCharacteristics(resourceStatistic))
</ins><span class="cx">         resourceStatistic.isPrevalentResource = true;
</span><del>-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebResourceLoadStatisticsStore::removeDataRecords()
</span><span class="lines">@@ -248,11 +218,11 @@
</span><span class="cx"> 
</span><span class="cx"> String WebResourceLoadStatisticsStore::persistentStoragePath(const String&amp; label) const
</span><span class="cx"> {
</span><del>-    if (m_storagePath.isEmpty())
</del><ins>+    if (m_statisticsStoragePath.isEmpty())
</ins><span class="cx">         return emptyString();
</span><span class="cx"> 
</span><span class="cx">     // TODO Decide what to call this file
</span><del>-    return pathByAppendingComponent(m_storagePath, label + &quot;_resourceLog.plist&quot;);
</del><ins>+    return pathByAppendingComponent(m_statisticsStoragePath, label + &quot;_resourceLog.plist&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebResourceLoadStatisticsStore::writeEncoderToDisk(KeyedEncoder&amp; encoder, const String&amp; label) const
</span><span class="lines">@@ -265,8 +235,8 @@
</span><span class="cx">     if (resourceLog.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (!m_storagePath.isEmpty())
-        makeAllDirectories(m_storagePath);
</del><ins>+    if (!m_statisticsStoragePath.isEmpty())
+        makeAllDirectories(m_statisticsStoragePath);
</ins><span class="cx"> 
</span><span class="cx">     auto handle = openFile(resourceLog, OpenForWrite);
</span><span class="cx">     if (!handle)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebResourceLoadStatisticsStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;APIObject.h&quot;
</span><span class="cx"> #include &quot;Connection.h&quot;
</span><ins>+#include &quot;ResourceLoadStatisticsClassifier.h&quot;
</ins><span class="cx"> #include &quot;WebsiteDataRecord.h&quot;
</span><span class="cx"> #include &lt;WebCore/ResourceLoadStatisticsStore.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="lines">@@ -76,7 +77,6 @@
</span><span class="cx"> 
</span><span class="cx">     void processStatisticsAndDataRecords();
</span><span class="cx"> 
</span><del>-    bool hasPrevalentResourceCharacteristics(const WebCore::ResourceLoadStatistics&amp;);
</del><span class="cx">     void classifyResource(WebCore::ResourceLoadStatistics&amp;);
</span><span class="cx">     void removeDataRecords();
</span><span class="cx"> 
</span><span class="lines">@@ -89,8 +89,9 @@
</span><span class="cx">     std::unique_ptr&lt;WebCore::KeyedDecoder&gt; createDecoderFromDisk(const String&amp; label) const;
</span><span class="cx"> 
</span><span class="cx">     Ref&lt;WebCore::ResourceLoadStatisticsStore&gt; m_resourceLoadStatisticsStore;
</span><ins>+    ResourceLoadStatisticsClassifier m_resourceLoadStatisticsClassifier;
</ins><span class="cx">     Ref&lt;WTF::WorkQueue&gt; m_statisticsQueue;
</span><del>-    String m_storagePath;
</del><ins>+    String m_statisticsStoragePath;
</ins><span class="cx">     bool m_resourceLoadStatisticsEnabled { false };
</span><span class="cx"> 
</span><span class="cx">     double m_lastTimeDataRecordsWereRemoved { 0 };
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -1148,10 +1148,17 @@
</span><span class="cx">                 6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */; };
</span><span class="cx">                 659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6546A82913000164000CEB1C /* InjectedBundlePageResourceLoadClient.cpp */; };
</span><span class="cx">                 65B86F1E12F11DE300B7DD8A /* WKBundleInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                6B2E09BA1E57B88100C8A8B9 /* CorePredictionSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B2E09B91E57B88100C8A8B9 /* CorePredictionSPI.h */; };
</ins><span class="cx">                 6BE9699C1E43B3FF008B7483 /* WKResourceLoadStatisticsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE9699B1E43B3FF008B7483 /* WKResourceLoadStatisticsManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 6BE9699E1E43B41D008B7483 /* WKResourceLoadStatisticsManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BE9699D1E43B41D008B7483 /* WKResourceLoadStatisticsManager.cpp */; };
</span><span class="cx">                 6BE969A01E43B86E008B7483 /* WebResourceLoadStatisticsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE9699F1E43B86E008B7483 /* WebResourceLoadStatisticsManager.h */; };
</span><span class="cx">                 6BE969A21E43B8A4008B7483 /* WebResourceLoadStatisticsManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BE969A11E43B8A4008B7483 /* WebResourceLoadStatisticsManager.cpp */; };
</span><ins>+                6BE969C11E54D452008B7483 /* corePrediction_model in Resources */ = {isa = PBXBuildFile; fileRef = 6BE969C01E54D452008B7483 /* corePrediction_model */; };
+                6BE969C51E54D4A4008B7483 /* ResourceLoadStatisticsClassifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE969C41E54D4A4008B7483 /* ResourceLoadStatisticsClassifier.h */; };
+                6BE969C71E54D4B6008B7483 /* ResourceLoadStatisticsClassifierBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BE969C61E54D4B6008B7483 /* ResourceLoadStatisticsClassifierBase.cpp */; };
+                6BE969CA1E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BE969C81E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.cpp */; };
+                6BE969CB1E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE969C91E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h */; };
+                6BE969CD1E54E054008B7483 /* ResourceLoadStatisticsClassifierBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE969CC1E54E054008B7483 /* ResourceLoadStatisticsClassifierBase.h */; };
</ins><span class="cx">                 6EE849C81368D9390038D481 /* WKInspectorPrivateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE849C61368D92D0038D481 /* WKInspectorPrivateMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 728E86F11795188C0087879E /* WebColorPickerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 728E86EF1795188C0087879E /* WebColorPickerMac.h */; };
</span><span class="cx">                 728E86F21795188C0087879E /* WebColorPickerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 728E86F01795188C0087879E /* WebColorPickerMac.mm */; };
</span><span class="lines">@@ -3338,10 +3345,17 @@
</span><span class="cx">                 6546A82A13000164000CEB1C /* InjectedBundlePageResourceLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageResourceLoadClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleInspector.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleInspector.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                6B2E09B91E57B88100C8A8B9 /* CorePredictionSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorePredictionSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 6BE9699B1E43B3FF008B7483 /* WKResourceLoadStatisticsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKResourceLoadStatisticsManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6BE9699D1E43B41D008B7483 /* WKResourceLoadStatisticsManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKResourceLoadStatisticsManager.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6BE9699F1E43B86E008B7483 /* WebResourceLoadStatisticsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceLoadStatisticsManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6BE969A11E43B8A4008B7483 /* WebResourceLoadStatisticsManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebResourceLoadStatisticsManager.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                6BE969C01E54D452008B7483 /* corePrediction_model */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = corePrediction_model; sourceTree = &quot;&lt;group&gt;&quot;; };
+                6BE969C41E54D4A4008B7483 /* ResourceLoadStatisticsClassifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatisticsClassifier.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                6BE969C61E54D4B6008B7483 /* ResourceLoadStatisticsClassifierBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadStatisticsClassifierBase.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                6BE969C81E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadStatisticsClassifierCocoa.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                6BE969C91E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatisticsClassifierCocoa.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                6BE969CC1E54E054008B7483 /* ResourceLoadStatisticsClassifierBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatisticsClassifierBase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = com.apple.WebProcess.sb.in; path = WebProcess/com.apple.WebProcess.sb.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6EE849C61368D92D0038D481 /* WKInspectorPrivateMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKInspectorPrivateMac.h; path = mac/WKInspectorPrivateMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 728E86EF1795188C0087879E /* WebColorPickerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebColorPickerMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4354,6 +4368,7 @@
</span><span class="cx">                 089C1665FE841158C02AAC07 /* Resources */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                6BE969BF1E54D452008B7483 /* ResourceLoadStatistics */,
</ins><span class="cx">                                 37F8C94F1AE22BD8007DAB9E /* mac */,
</span><span class="cx">                                 7CB16FE11724B9B5007A0A95 /* PlugInSandboxProfiles */,
</span><span class="cx">                                 A78CCDD5193AC9E3005ECC25 /* SandboxProfiles */,
</span><span class="lines">@@ -6115,6 +6130,36 @@
</span><span class="cx">                         name = Cocoa;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                6BE969BF1E54D452008B7483 /* ResourceLoadStatistics */ = {
+                        isa = PBXGroup;
+                        children = (
+                                6BE969C01E54D452008B7483 /* corePrediction_model */,
+                        );
+                        name = ResourceLoadStatistics;
+                        path = Resources/ResourceLoadStatistics;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
+                6BE969C21E54D467008B7483 /* classifier */ = {
+                        isa = PBXGroup;
+                        children = (
+                                6BE969C31E54D467008B7483 /* cocoa */,
+                                6BE969C61E54D4B6008B7483 /* ResourceLoadStatisticsClassifierBase.cpp */,
+                                6BE969C41E54D4A4008B7483 /* ResourceLoadStatisticsClassifier.h */,
+                                6BE969CC1E54E054008B7483 /* ResourceLoadStatisticsClassifierBase.h */,
+                        );
+                        path = classifier;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
+                6BE969C31E54D467008B7483 /* cocoa */ = {
+                        isa = PBXGroup;
+                        children = (
+                                6BE969C81E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.cpp */,
+                                6BE969C91E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h */,
+                                6B2E09B91E57B88100C8A8B9 /* CorePredictionSPI.h */,
+                        );
+                        path = cocoa;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 6EE849C41368D9040038D481 /* mac */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -7015,6 +7060,7 @@
</span><span class="cx">                 BC2E6E74114196F000A63B1E /* Platform */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                6BE969C21E54D467008B7483 /* classifier */,
</ins><span class="cx">                                 3709504118A88BA40087AE5D /* cf */,
</span><span class="cx">                                 1AA2E51A12E4C05600BC4966 /* cg */,
</span><span class="cx">                                 4450AEBE1DC3FAAC009943F2 /* cocoa */,
</span><span class="lines">@@ -7897,6 +7943,7 @@
</span><span class="cx">                                 41DC45961E3D6E2200B11F51 /* NetworkRTCProvider.h in Headers */,
</span><span class="cx">                                 7C1BA33E1A4A0E600043E249 /* APIDictionary.h in Headers */,
</span><span class="cx">                                 1F7D36C118DA513F00D9D659 /* APIDownloadClient.h in Headers */,
</span><ins>+                                6BE969CB1E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h in Headers */,
</ins><span class="cx">                                 516A4A5D120A2CCD00C05B7F /* APIError.h in Headers */,
</span><span class="cx">                                 317FE7C51C487A6C00A0CA89 /* APIExperimentalFeature.h in Headers */,
</span><span class="cx">                                 00B9661618E24CBA00CE1F88 /* APIFindClient.h in Headers */,
</span><span class="lines">@@ -8317,6 +8364,7 @@
</span><span class="cx">                                 3309344A1315B9220097A7BC /* WebCookieManagerProxyMessages.h in Headers */,
</span><span class="cx">                                 BC1DD7B2114DC396005ADAF3 /* WebCoreArgumentCoders.h in Headers */,
</span><span class="cx">                                 512F589B12A8838800629530 /* WebCredential.h in Headers */,
</span><ins>+                                6BE969C51E54D4A4008B7483 /* ResourceLoadStatisticsClassifier.h in Headers */,
</ins><span class="cx">                                 1AA83F6D1A5B63FF00026EC6 /* WebDatabaseProvider.h in Headers */,
</span><span class="cx">                                 CD19A26E1A13E834008D650E /* WebDiagnosticLoggingClient.h in Headers */,
</span><span class="cx">                                 1A5B1C5518987EDF004FCF9B /* WebDocumentLoader.h in Headers */,
</span><span class="lines">@@ -8402,6 +8450,7 @@
</span><span class="cx">                                 512127C41908239A00DAF35C /* WebPasteboardOverrides.h in Headers */,
</span><span class="cx">                                 7C4694D11A51E36800AD5845 /* WebPasteboardProxy.h in Headers */,
</span><span class="cx">                                 7C4694CA1A4B4EA100AD5845 /* WebPasteboardProxyMessages.h in Headers */,
</span><ins>+                                6B2E09BA1E57B88100C8A8B9 /* CorePredictionSPI.h in Headers */,
</ins><span class="cx">                                 1AB1F7971D1B3613007C9BD1 /* WebPaymentCoordinatorMessages.h in Headers */,
</span><span class="cx">                                 1AB1F78C1D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.h in Headers */,
</span><span class="cx">                                 1AB1F77E1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyCocoa.h in Headers */,
</span><span class="lines">@@ -8520,6 +8569,7 @@
</span><span class="cx">                                 BC7B633D12A45D1200D174A4 /* WKBundlePageGroup.h in Headers */,
</span><span class="cx">                                 1AB474D8184D43FD0051B622 /* WKBundlePageLoaderClient.h in Headers */,
</span><span class="cx">                                 ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */,
</span><ins>+                                6BE969CD1E54E054008B7483 /* ResourceLoadStatisticsClassifierBase.h in Headers */,
</ins><span class="cx">                                 1AB474EA184D45130051B622 /* WKBundlePagePolicyClient.h in Headers */,
</span><span class="cx">                                 BC1B419811D41D570011E8DD /* WKBundlePagePrivate.h in Headers */,
</span><span class="cx">                                 1AB474DA184D44250051B622 /* WKBundlePageResourceLoadClient.h in Headers */,
</span><span class="lines">@@ -9053,6 +9103,7 @@
</span><span class="cx">                                 7A5E394A1D5BD8BE00B4B7CE /* com.macromedia.Flash Player ESR.plugin.sb in Resources */,
</span><span class="cx">                                 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
</span><span class="cx">                                 93A2A3461D246125002B59D3 /* mediaIcon.pdf in Resources */,
</span><ins>+                                6BE969C11E54D452008B7483 /* corePrediction_model in Resources */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span><span class="lines">@@ -9641,6 +9692,7 @@
</span><span class="cx">                                 51795567162876CB00FA43B6 /* NetworkProcessMac.mm in Sources */,
</span><span class="cx">                                 5163199416289A6000E22F00 /* NetworkProcessMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 E14A954916E016A40068DE82 /* NetworkProcessPlatformStrategies.cpp in Sources */,
</span><ins>+                                6BE969CA1E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.cpp in Sources */,
</ins><span class="cx">                                 5179556D162877B100FA43B6 /* NetworkProcessProxy.cpp in Sources */,
</span><span class="cx">                                 516319921628980A00E22F00 /* NetworkProcessProxyMac.mm in Sources */,
</span><span class="cx">                                 513A163C163088F6005D7D22 /* NetworkProcessProxyMessageReceiver.cpp in Sources */,
</span><span class="lines">@@ -9985,6 +10037,7 @@
</span><span class="cx">                                 D3B9484611FF4B6500032B39 /* WebPopupMenu.cpp in Sources */,
</span><span class="cx">                                 BCC43AC7127B99DE00317F16 /* WebPopupMenuMac.mm in Sources */,
</span><span class="cx">                                 BC5750981268F3C6006F0F12 /* WebPopupMenuProxyMac.mm in Sources */,
</span><ins>+                                6BE969C71E54D4B6008B7483 /* ResourceLoadStatisticsClassifierBase.cpp in Sources */,
</ins><span class="cx">                                 BCD59800112B57BE00EC8C23 /* WebPreferences.cpp in Sources */,
</span><span class="cx">                                 7C85FD7F19341665000177C4 /* WebPreferencesKeys.cpp in Sources */,
</span><span class="cx">                                 BC84EB1812A7100C0083F2DA /* WebPreferencesMac.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Tools/ChangeLog        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2017-02-20  John Wilander  &lt;wilander@apple.com&gt;
+
+        Resource Load Statistics: Add alternate classification method
+        https://bugs.webkit.org/show_bug.cgi?id=168347
+        &lt;rdar://problem/30352793&gt;
+
+        Reviewed by Alex Christensen.
+
+        Added three testRunner functions to facilitate layout tests:
+        - setStatisticsSubframeUnderTopFrameOrigin()
+        - setStatisticsSubresourceUnderTopFrameOrigin()
+        - setStatisticsSubresourceUniqueRedirectTo()
+
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setStatisticsSubframeUnderTopFrameOrigin):
+        (WTR::TestRunner::setStatisticsSubresourceUnderTopFrameOrigin):
+        (WTR::TestRunner::setStatisticsSubresourceUniqueRedirectTo):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::setStatisticsSubframeUnderTopFrameOrigin):
+        (WTR::TestController::setStatisticsSubresourceUnderTopFrameOrigin):
+        (WTR::TestController::setStatisticsSubresourceUniqueRedirectTo):
+        * WebKitTestRunner/TestController.h:
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
+
</ins><span class="cx"> 2017-02-20  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use the new drag code path when dragging links
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -253,6 +253,9 @@
</span><span class="cx">     boolean isStatisticsPrevalentResource(DOMString hostName);
</span><span class="cx">     void setStatisticsHasHadUserInteraction(DOMString hostName, boolean value);
</span><span class="cx">     boolean isStatisticsHasHadUserInteraction(DOMString hostName);
</span><ins>+    void setStatisticsSubframeUnderTopFrameOrigin(DOMString hostName, DOMString topFrameHostName);
+    void setStatisticsSubresourceUnderTopFrameOrigin(DOMString hostName, DOMString topFrameHostName);
+    void setStatisticsSubresourceUniqueRedirectTo(DOMString hostName, DOMString hostNameRedirectedTo);
</ins><span class="cx">     void setStatisticsTimeToLiveUserInteraction(double seconds);
</span><span class="cx">     void statisticsFireDataModificationHandler();
</span><span class="cx">     void setStatisticsNotifyPagesWhenDataRecordsWereScanned(boolean value);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -1226,6 +1226,84 @@
</span><span class="cx">     return WKBooleanGetValue(static_cast&lt;WKBooleanRef&gt;(returnData));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TestRunner::setStatisticsSubframeUnderTopFrameOrigin(JSStringRef hostName, JSStringRef topFrameHostName)
+{
+    Vector&lt;WKRetainPtr&lt;WKStringRef&gt;&gt; keys;
+    Vector&lt;WKRetainPtr&lt;WKTypeRef&gt;&gt; values;
+    
+    keys.append({ AdoptWK, WKStringCreateWithUTF8CString(&quot;HostName&quot;) });
+    values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
+    
+    keys.append({ AdoptWK, WKStringCreateWithUTF8CString(&quot;TopFrameHostName&quot;) });
+    values.append({ AdoptWK, WKStringCreateWithJSString(topFrameHostName) });
+    
+    Vector&lt;WKStringRef&gt; rawKeys;
+    Vector&lt;WKTypeRef&gt; rawValues;
+    rawKeys.resize(keys.size());
+    rawValues.resize(values.size());
+    
+    for (size_t i = 0; i &lt; keys.size(); ++i) {
+        rawKeys[i] = keys[i].get();
+        rawValues[i] = values[i].get();
+    }
+    
+    WKRetainPtr&lt;WKStringRef&gt; messageName(AdoptWK, WKStringCreateWithUTF8CString(&quot;SetStatisticsSubframeUnderTopFrameOrigin&quot;));
+    WKRetainPtr&lt;WKDictionaryRef&gt; messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
+    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
+}
+
+void TestRunner::setStatisticsSubresourceUnderTopFrameOrigin(JSStringRef hostName, JSStringRef topFrameHostName)
+{
+    Vector&lt;WKRetainPtr&lt;WKStringRef&gt;&gt; keys;
+    Vector&lt;WKRetainPtr&lt;WKTypeRef&gt;&gt; values;
+    
+    keys.append({ AdoptWK, WKStringCreateWithUTF8CString(&quot;HostName&quot;) });
+    values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
+    
+    keys.append({ AdoptWK, WKStringCreateWithUTF8CString(&quot;TopFrameHostName&quot;) });
+    values.append({ AdoptWK, WKStringCreateWithJSString(topFrameHostName) });
+    
+    Vector&lt;WKStringRef&gt; rawKeys;
+    Vector&lt;WKTypeRef&gt; rawValues;
+    rawKeys.resize(keys.size());
+    rawValues.resize(values.size());
+    
+    for (size_t i = 0; i &lt; keys.size(); ++i) {
+        rawKeys[i] = keys[i].get();
+        rawValues[i] = values[i].get();
+    }
+    
+    WKRetainPtr&lt;WKStringRef&gt; messageName(AdoptWK, WKStringCreateWithUTF8CString(&quot;SetStatisticsSubresourceUnderTopFrameOrigin&quot;));
+    WKRetainPtr&lt;WKDictionaryRef&gt; messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
+    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
+}
+
+void TestRunner::setStatisticsSubresourceUniqueRedirectTo(JSStringRef hostName, JSStringRef hostNameRedirectedTo)
+{
+    Vector&lt;WKRetainPtr&lt;WKStringRef&gt;&gt; keys;
+    Vector&lt;WKRetainPtr&lt;WKTypeRef&gt;&gt; values;
+    
+    keys.append({ AdoptWK, WKStringCreateWithUTF8CString(&quot;HostName&quot;) });
+    values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
+    
+    keys.append({ AdoptWK, WKStringCreateWithUTF8CString(&quot;HostNameRedirectedTo&quot;) });
+    values.append({ AdoptWK, WKStringCreateWithJSString(hostNameRedirectedTo) });
+    
+    Vector&lt;WKStringRef&gt; rawKeys;
+    Vector&lt;WKTypeRef&gt; rawValues;
+    rawKeys.resize(keys.size());
+    rawValues.resize(values.size());
+    
+    for (size_t i = 0; i &lt; keys.size(); ++i) {
+        rawKeys[i] = keys[i].get();
+        rawValues[i] = values[i].get();
+    }
+    
+    WKRetainPtr&lt;WKStringRef&gt; messageName(AdoptWK, WKStringCreateWithUTF8CString(&quot;SetStatisticsSubresourceUniqueRedirectTo&quot;));
+    WKRetainPtr&lt;WKDictionaryRef&gt; messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
+    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
+}
+
</ins><span class="cx"> void TestRunner::setStatisticsTimeToLiveUserInteraction(double seconds)
</span><span class="cx"> {
</span><span class="cx">     WKRetainPtr&lt;WKStringRef&gt; messageName(AdoptWK, WKStringCreateWithUTF8CString(&quot;SetStatisticsTimeToLiveUserInteraction&quot;));
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -354,6 +354,9 @@
</span><span class="cx">     bool isStatisticsPrevalentResource(JSStringRef hostName);
</span><span class="cx">     void setStatisticsHasHadUserInteraction(JSStringRef hostName, bool value);
</span><span class="cx">     bool isStatisticsHasHadUserInteraction(JSStringRef hostName);
</span><ins>+    void setStatisticsSubframeUnderTopFrameOrigin(JSStringRef hostName, JSStringRef topFrameHostName);
+    void setStatisticsSubresourceUnderTopFrameOrigin(JSStringRef hostName, JSStringRef topFrameHostName);
+    void setStatisticsSubresourceUniqueRedirectTo(JSStringRef hostName, JSStringRef hostNameRedirectedTo);
</ins><span class="cx">     void setStatisticsTimeToLiveUserInteraction(double seconds);
</span><span class="cx">     void setStatisticsNotifyPagesWhenDataRecordsWereScanned(bool);
</span><span class="cx">     void setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(bool);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -2229,6 +2229,21 @@
</span><span class="cx">     return WKResourceLoadStatisticsManagerIsHasHadUserInteraction(hostName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TestController::setStatisticsSubframeUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName)
+{
+    WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin(hostName, topFrameHostName);
+}
+
+void TestController::setStatisticsSubresourceUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName)
+{
+    WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin(hostName, topFrameHostName);
+}
+    
+void TestController::setStatisticsSubresourceUniqueRedirectTo(WKStringRef hostName, WKStringRef hostNameRedirectedTo)
+{
+    WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo(hostName, hostNameRedirectedTo);
+}
+
</ins><span class="cx"> void TestController::setStatisticsTimeToLiveUserInteraction(double seconds)
</span><span class="cx"> {
</span><span class="cx">     WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction(seconds);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.h (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.h        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Tools/WebKitTestRunner/TestController.h        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -152,6 +152,9 @@
</span><span class="cx">     bool isStatisticsPrevalentResource(WKStringRef hostName);
</span><span class="cx">     void setStatisticsHasHadUserInteraction(WKStringRef hostName, bool value);
</span><span class="cx">     bool isStatisticsHasHadUserInteraction(WKStringRef hostName);
</span><ins>+    void setStatisticsSubframeUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName);
+    void setStatisticsSubresourceUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName);
+    void setStatisticsSubresourceUniqueRedirectTo(WKStringRef hostName, WKStringRef hostNameRedirectedTo);
</ins><span class="cx">     void setStatisticsTimeToLiveUserInteraction(double seconds);
</span><span class="cx">     void statisticsFireDataModificationHandler();
</span><span class="cx">     void setStatisticsNotifyPagesWhenDataRecordsWereScanned(bool);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestInvocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -932,6 +932,48 @@
</span><span class="cx">         return result;
</span><span class="cx">     }
</span><span class="cx">     
</span><ins>+    if (WKStringIsEqualToUTF8CString(messageName, &quot;SetStatisticsSubframeUnderTopFrameOrigin&quot;)) {
+        ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
+        
+        WKDictionaryRef messageBodyDictionary = static_cast&lt;WKDictionaryRef&gt;(messageBody);
+        WKRetainPtr&lt;WKStringRef&gt; hostNameKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;HostName&quot;));
+        WKRetainPtr&lt;WKStringRef&gt; topFrameHostNameKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;TopFrameHostName&quot;));
+        
+        WKStringRef hostName = static_cast&lt;WKStringRef&gt;(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
+        WKStringRef topFrameHostName = static_cast&lt;WKStringRef&gt;(WKDictionaryGetItemForKey(messageBodyDictionary, topFrameHostNameKey.get()));
+
+        TestController::singleton().setStatisticsSubframeUnderTopFrameOrigin(hostName, topFrameHostName);
+        return nullptr;
+    }
+    
+    if (WKStringIsEqualToUTF8CString(messageName, &quot;SetStatisticsSubresourceUnderTopFrameOrigin&quot;)) {
+        ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
+        
+        WKDictionaryRef messageBodyDictionary = static_cast&lt;WKDictionaryRef&gt;(messageBody);
+        WKRetainPtr&lt;WKStringRef&gt; hostNameKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;HostName&quot;));
+        WKRetainPtr&lt;WKStringRef&gt; topFrameHostNameKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;TopFrameHostName&quot;));
+        
+        WKStringRef hostName = static_cast&lt;WKStringRef&gt;(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
+        WKStringRef topFrameHostName = static_cast&lt;WKStringRef&gt;(WKDictionaryGetItemForKey(messageBodyDictionary, topFrameHostNameKey.get()));
+        
+        TestController::singleton().setStatisticsSubresourceUnderTopFrameOrigin(hostName, topFrameHostName);
+        return nullptr;
+    }
+    
+    if (WKStringIsEqualToUTF8CString(messageName, &quot;SetStatisticsSubresourceUniqueRedirectTo&quot;)) {
+        ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
+        
+        WKDictionaryRef messageBodyDictionary = static_cast&lt;WKDictionaryRef&gt;(messageBody);
+        WKRetainPtr&lt;WKStringRef&gt; hostNameKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;HostName&quot;));
+        WKRetainPtr&lt;WKStringRef&gt; hostNameRedirectedToKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;HostNameRedirectedTo&quot;));
+        
+        WKStringRef hostName = static_cast&lt;WKStringRef&gt;(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
+        WKStringRef hostNameRedirectedTo = static_cast&lt;WKStringRef&gt;(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameRedirectedToKey.get()));
+        
+        TestController::singleton().setStatisticsSubresourceUniqueRedirectTo(hostName, hostNameRedirectedTo);
+        return nullptr;
+    }
+
</ins><span class="cx">     if (WKStringIsEqualToUTF8CString(messageName, &quot;SetStatisticsTimeToLiveUserInteraction&quot;)) {
</span><span class="cx">         ASSERT(WKGetTypeID(messageBody) == WKDoubleGetTypeID());
</span><span class="cx">         WKDoubleRef seconds = static_cast&lt;WKDoubleRef&gt;(messageBody);
</span></span></pre></div>
<a id="trunkWebKitLibrariesChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKitLibraries/ChangeLog (212684 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitLibraries/ChangeLog        2017-02-21 00:29:39 UTC (rev 212684)
+++ trunk/WebKitLibraries/ChangeLog        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-02-20  John Wilander  &lt;wilander@apple.com&gt;
+
+        Resource Load Statistics: Add alternate classification method
+        https://bugs.webkit.org/show_bug.cgi?id=168347
+        &lt;rdar://problem/30352793&gt;
+
+        Reviewed by Alex Christensen.
+
+        * WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework: Added.
+        * WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework/CorePrediction.tbd: Added.
+            Stubs for private framework.
+
</ins><span class="cx"> 2017-01-12  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Purge GraphicsServices font cache on memory warning.
</span></span></pre></div>
<a id="trunkWebKitLibrariesWebKitPrivateFrameworkStubsiOS10CorePredictionframeworkCorePredictiontbd"></a>
<div class="addfile"><h4>Added: trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework/CorePrediction.tbd (0 => 212685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework/CorePrediction.tbd                                (rev 0)
+++ trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework/CorePrediction.tbd        2017-02-21 00:34:37 UTC (rev 212685)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+--- !tapi-tbd-v2
+archs:
+  - armv7
+  - armv7s
+  - arm64
+exports:
+  -
+    archs:
+      - armv7
+      - armv7s
+      - arm64
+    symbols:
+      - _svm_load_model
+      - _svm_predict_values
+install-name: /System/Library/PrivateFrameworks/CorePrediction.framework
+objc-constraint: none
+platform: ios
+...
</ins></span></pre>
</div>
</div>

</body>
</html>