<!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>[212449] 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/212449">212449</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2017-02-16 11:18:32 -0800 (Thu, 16 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Resource Timing] Support Resource Timing in Workers
https://bugs.webkit.org/show_bug.cgi?id=168086
&lt;rdar://problem/30430117&gt;

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/resource-timing/idlharness-expected.txt:
* web-platform-tests/resource-timing/resource-timing-expected.txt:
* web-platform-tests/resource-timing/resource_cached-expected.txt:
* web-platform-tests/resource-timing/resource_connection_reuse-expected.txt:
Progressions.

* web-platform-tests/resource-timing/resources/data.json: Added.
* web-platform-tests/resource-timing/resources/rt-iframe-1.html: Added.
* web-platform-tests/resource-timing/resources/rt-iframe-2.html: Added.
* web-platform-tests/resource-timing/resources/rt-module.js: Added.
* web-platform-tests/resource-timing/resources/rt-sub-module.js: Added.
* web-platform-tests/resource-timing/resources/rt-utilities.js: Added.
* web-platform-tests/resource-timing/resources/rt-worker-resources.js: Added.
New Resources.

* web-platform-tests/resource-timing/rt-cors-expected.txt: Added.
* web-platform-tests/resource-timing/rt-cors.html: Added.
* web-platform-tests/resource-timing/rt-cors.js: Added.
* web-platform-tests/resource-timing/rt-cors.worker-expected.txt: Added.
* web-platform-tests/resource-timing/rt-cors.worker.html: Added.
* web-platform-tests/resource-timing/rt-cors.worker.js: Added.
Tests for redirects and cross origin data hiding.

* web-platform-tests/resource-timing/rt-initiatorType-css-expected.txt: Added.
* web-platform-tests/resource-timing/rt-initiatorType-css.html: Added.
* web-platform-tests/resource-timing/rt-initiatorType-element-expected.txt: Added.
* web-platform-tests/resource-timing/rt-initiatorType-element.html: Added.
* web-platform-tests/resource-timing/rt-initiatorType-fetch-expected.txt: Added.
* web-platform-tests/resource-timing/rt-initiatorType-fetch.html: Added.
* web-platform-tests/resource-timing/rt-initiatorType-fetch.js: Added.
* web-platform-tests/resource-timing/rt-initiatorType-other-expected.txt: Added.
* web-platform-tests/resource-timing/rt-initiatorType-other.html: Added.
* web-platform-tests/resource-timing/rt-initiatorType-script-module-expected.txt: Added.
* web-platform-tests/resource-timing/rt-initiatorType-script-module.html: Added.
* web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest-expected.txt: Added.
* web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html: Added.
* web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.js: Added.
* web-platform-tests/resource-timing/rt-initiatorType.worker-expected.txt: Added.
* web-platform-tests/resource-timing/rt-initiatorType.worker.html: Added.
* web-platform-tests/resource-timing/rt-initiatorType.worker.js: Added.
Tests for producing different initiator types.

* web-platform-tests/resource-timing/rt-initiatorType-media-expected.txt: Added.
* web-platform-tests/resource-timing/rt-initiatorType-media.html: Added.
We currently fail these tests, so they are marked as fail.

* web-platform-tests/resource-timing/rt-performance-extensions-expected.txt: Added.
* web-platform-tests/resource-timing/rt-performance-extensions.html: Added.
* web-platform-tests/resource-timing/rt-performance-extensions.js: Added.
* web-platform-tests/resource-timing/rt-performance-extensions.worker-expected.txt: Added.
* web-platform-tests/resource-timing/rt-performance-extensions.worker.html: Added.
* web-platform-tests/resource-timing/rt-performance-extensions.worker.js: Added.
Tests for the new Performance APIs.

* web-platform-tests/resource-timing/rt-serialization-expected.txt: Added.
* web-platform-tests/resource-timing/rt-serialization.html: Added.
Tests for JSON serialization.

* web-platform-tests/resource-timing/rt-resource-errors-expected.txt: Added.
* web-platform-tests/resource-timing/rt-resource-errors.html: Added.
* web-platform-tests/resource-timing/rt-resource-ignored-expected.txt: Added.
* web-platform-tests/resource-timing/rt-resource-ignored.html: Added.
Tests for when PerformanceResourceTiming entries should not be included.

* web-platform-tests/resource-timing/rt-resources-per-frame-expected.txt: Added.
* web-platform-tests/resource-timing/rt-resources-per-frame.html: Added.
* web-platform-tests/resource-timing/rt-resources-per-worker-expected.txt: Added.
* web-platform-tests/resource-timing/rt-resources-per-worker.html: Added.
* web-platform-tests/resource-timing/rt-shared-resource-in-frames-expected.txt: Added.
* web-platform-tests/resource-timing/rt-shared-resource-in-frames.html: Added.
* web-platform-tests/resource-timing/rt-shared-resource-in-workers-expected.txt: Added.
* web-platform-tests/resource-timing/rt-shared-resource-in-workers.html: Added.
Tests for different entries in different contexts.

* web-platform-tests/serve:
Make executable.

Source/WebCore:

Worker's load resources through the Document that loaded them. However,
their PerformanceResourceTiming entries should be added to the Performance
object inside the Worker context, not the Document's context.

This change adds an InitiatorContext to ResourceLoadOptions so that loaders
can determine if the load was initiated by the Document or a Worker. This
allows loaders to then know if the ResourceTiming data they collect should
be added to the Document's Performance object or forwarded on to the Worker's.

This adds a new ThreadableLoaderClient method intended only for the purpose
of adding the ResourceTiming information to the Worker's Performance object.
Unlike other ThreadableLoaderClient methods that are bridged and forwarded
on to a client inside the worker (e.g. XMLHttpRequest or FetchLoader) this
method never needs to be handled by clients and can be uniformly handled by
the WorkerThreadableLoader itself.

We also add a new ResourceTiming object that encapsulates all of the data
ultimately needed for a PerformanceResourceTimingEntry object. This allows
for all of the information to be gathered while loading on the Document
before serializing across to the Worker. That includes the Timing-Allow-Origin
check which uses the SecurityOrigin of the Worker.

This also modernizes and addresses issues in the Resource Timing implementation.
Better handling cases like loading from the Cache, Synchronous Loads, and
improving initiatorType information.

Tests: imported/w3c/web-platform-tests/resource-timing/rt-cors.html
       imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.html
       imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css.html
       imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element.html
       imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.html
       imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media.html
       imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other.html
       imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module.html
       imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html
       imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.html
       imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.html
       imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.html
       imported/w3c/web-platform-tests/resource-timing/rt-resource-errors.html
       imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored.html
       imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame.html
       imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker.html
       imported/w3c/web-platform-tests/resource-timing/rt-serialization.html
       imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames.html
       imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers.html
       performance-api/resource-timing-apis.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
New files.

* platform/network/NetworkLoadTiming.h:
(WebCore::NetworkLoadTiming::reset): Deleted.
We no longer need to reset.

* loader/ResourceTiming.cpp: Added.
(WebCore::passesTimingAllowCheck):
(WebCore::ResourceTiming::fromCache):
(WebCore::ResourceTiming::fromLoad):
(WebCore::ResourceTiming::fromSynchronousLoad):
(WebCore::ResourceTiming::ResourceTiming):
(WebCore::ResourceTiming::isolatedCopy):
* loader/ResourceTiming.h: Added.
(WebCore::ResourceTiming::url):
(WebCore::ResourceTiming::initiator):
(WebCore::ResourceTiming::loadTiming):
(WebCore::ResourceTiming::networkLoadTiming):
(WebCore::ResourceTiming::allowTimingDetails):
(WebCore::ResourceTiming::overrideInitiatorName):
(WebCore::ResourceTiming::ResourceTiming):
Class that encapsulates all of the data needed for a PerformanceResourceTiming entry.
There are three static constructors indicating the different ways this object can
be constructed and the different data available at the time of construction.

* loader/ResourceLoaderOptions.h:
Add the new InitiatorContext, default to Document.

* loader/ThreadableLoaderClient.h:
(WebCore::ThreadableLoaderClient::didFinishTiming):
New client method only used by WorkerThreadableLoader.

* loader/WorkerThreadableLoader.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
All loads initiated in a WorkerThreadableLoader get identified as InitiatorContext::Worker.
Add timing information to the Performance object when received. No need to inform clients.

* loader/DocumentThreadableLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
(WebCore::DocumentThreadableLoader::loadRequest):
Provide APIs to pass timing data on to a WorkerThreadableLoader.
Create ResourceTiming data for synchronous loads.

* loader/LoadTiming.h:
* loader/LoadTiming.cpp:
(WebCore::LoadTiming::isolatedCopy):
Add isolatedCopy to allow this data to be passed across to a Worker.

* loader/ResourceTimingInformation.h:
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::shouldAddResourceTiming):
(WebCore::ResourceTimingInformation::addResourceTiming):
(WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation):
Refactor to remove unused / unnecessary bits. Extract out some helpful code.
Changed this to match when Blink decides when to add or ignore entries, however
this may change over time.

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::notifyDone):
(WebCore::SubresourceLoader::reportResourceTiming):
* loader/SubresourceLoader.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::finishedTimingForWorkerLoad):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedRawResourceClient.h:
(WebCore::CachedRawResourceClient::finishedTimingForWorkerLoad):
Plumbing to report timing information to Worker if this resource was loaded for a Worker.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::initiatorName):
Store the initiator name on the CachedResource like other data added to the original
CachedResourceRequest. This is a bit of a hack but follows an existing pattern, and
cleans up other hacks that worked around this later on.

* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
Simply the creation of a ResourceTiming object for cache hits.
Report timing information to Worker if this resource was loaded for a Worker.

(WebCore::CachedResourceLoader::loadDone):
Eliminate this redundant point attempting to add a ResourceTiming entry.

* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::initiatorName):
Update to match the spec. The fallback is &quot;other&quot;.

* page/Performance.h:
* page/Performance.cpp:
(WebCore::Performance::setResourceTimingBufferSize):
(WebCore::Performance::addResourceTiming):
Update to support PerformanceObservers.
Update to match spec (event should bubble).

* page/PerformanceResourceTiming.h:
* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::create):
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::fetchStart):
(WebCore::PerformanceResourceTiming::domainLookupStart):
(WebCore::PerformanceResourceTiming::domainLookupEnd):
(WebCore::PerformanceResourceTiming::connectStart):
(WebCore::PerformanceResourceTiming::connectEnd):
(WebCore::PerformanceResourceTiming::secureConnectionStart):
(WebCore::PerformanceResourceTiming::requestStart):
(WebCore::PerformanceResourceTiming::responseStart):
(WebCore::PerformanceResourceTiming::responseEnd):
(WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
Construct with a ResourceTiming object containing all the data we need for the entry.
Update to match spec for what is required, should fallback, should be zero, etc.

(WebCore::passesTimingAllowCheck): Deleted.
Extracted this to ResourceTiming creation time in the loading context,
since this can't be determined on the Worker context without also having
all of the header information from each resource response.

* page/PerformanceResourceTiming.idl:
Expose to Workers!

LayoutTests:

* TestExpectations:
Pre-emptively mark some tests as flakey that have seen flakiness.

* platform/mac/TestExpectations:
Skip some tests on ElCapitan because the network timing numbers appear incorrect.

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
PerformanceResourceTiming is now available in Workers.

* performance-api/resource-timing-apis-expected.txt: Added.
* performance-api/resource-timing-apis.html: Added.
* performance-api/resources/resource-timing-api.js: Added.
Basic API test. We expect to fail nextHopProtocol and size properties right now.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingidlharnessexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/idlharness-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcetimingexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_cachedexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_cached-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_connection_reuseexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserve">trunk/LayoutTests/imported/w3c/web-platform-tests/serve</a></li>
<li><a href="#trunkLayoutTestsjsdomglobalconstructorsattributesdedicatedworkerexpectedtxt">trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontSelectorcpp">trunk/Source/WebCore/css/CSSFontSelector.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderCrossOriginPreflightCheckercpp">trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentThreadableLoadercpp">trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentThreadableLoaderh">trunk/Source/WebCore/loader/DocumentThreadableLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderLoadTimingcpp">trunk/Source/WebCore/loader/LoadTiming.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderLoadTimingh">trunk/Source/WebCore/loader/LoadTiming.h</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadNotifiercpp">trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoaderOptionsh">trunk/Source/WebCore/loader/ResourceLoaderOptions.h</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceTimingInformationcpp">trunk/Source/WebCore/loader/ResourceTimingInformation.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceTimingInformationh">trunk/Source/WebCore/loader/ResourceTimingInformation.h</a></li>
<li><a href="#trunkSourceWebCoreloaderSubresourceLoadercpp">trunk/Source/WebCore/loader/SubresourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderSubresourceLoaderh">trunk/Source/WebCore/loader/SubresourceLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderThreadableLoaderClienth">trunk/Source/WebCore/loader/ThreadableLoaderClient.h</a></li>
<li><a href="#trunkSourceWebCoreloaderWorkerThreadableLoadercpp">trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderWorkerThreadableLoaderh">trunk/Source/WebCore/loader/WorkerThreadableLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedRawResourcecpp">trunk/Source/WebCore/loader/cache/CachedRawResource.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedRawResourceh">trunk/Source/WebCore/loader/cache/CachedRawResource.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedRawResourceClienth">trunk/Source/WebCore/loader/cache/CachedRawResourceClient.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourcecpp">trunk/Source/WebCore/loader/cache/CachedResource.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceh">trunk/Source/WebCore/loader/cache/CachedResource.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceLoadercpp">trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceLoaderh">trunk/Source/WebCore/loader/cache/CachedResourceLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceRequestcpp">trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp</a></li>
<li><a href="#trunkSourceWebCorepageEventSourceh">trunk/Source/WebCore/page/EventSource.h</a></li>
<li><a href="#trunkSourceWebCorepagePerformancecpp">trunk/Source/WebCore/page/Performance.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceh">trunk/Source/WebCore/page/Performance.h</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceResourceTimingcpp">trunk/Source/WebCore/page/PerformanceResourceTiming.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceResourceTimingh">trunk/Source/WebCore/page/PerformanceResourceTiming.h</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceResourceTimingidl">trunk/Source/WebCore/page/PerformanceResourceTiming.idl</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkNetworkLoadTimingh">trunk/Source/WebCore/platform/network/NetworkLoadTiming.h</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequesth">trunk/Source/WebCore/xml/XMLHttpRequest.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesdatajson">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/data.json</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesrtiframe1html">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-iframe-1.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesrtiframe2html">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-iframe-2.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesrtmodulejs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-module.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesrtsubmodulejs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-sub-module.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesrtutilitiesjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-utilities.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesrtworkerresourcesjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-worker-resources.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtcorsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtcorshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtcorsjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtcorsworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtcorsworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtcorsworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypecssexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypecsshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeelementexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeelementhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypefetchexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypefetchhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypefetchjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypemediaexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypemediahtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeotherexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeotherhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypescriptmoduleexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypescriptmodulehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypexmlhttprequestexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypexmlhttprequesthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypexmlhttprequestjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtperformanceextensionsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtperformanceextensionshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtperformanceextensionsjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtperformanceextensionsworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtperformanceextensionsworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtperformanceextensionsworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourceerrorsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-errors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourceerrorshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-errors.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourceignoredexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourceignoredhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourcesperframeexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourcesperframehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourcesperworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourcesperworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtserializationexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-serialization-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtserializationhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-serialization.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtsharedresourceinframesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtsharedresourceinframeshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtsharedresourceinworkersexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtsharedresourceinworkershtml">trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers.html</a></li>
<li><a href="#trunkLayoutTestsperformanceapiresourcetimingapisexpectedtxt">trunk/LayoutTests/performance-api/resource-timing-apis-expected.txt</a></li>
<li><a href="#trunkLayoutTestsperformanceapiresourcetimingapishtml">trunk/LayoutTests/performance-api/resource-timing-apis.html</a></li>
<li><a href="#trunkLayoutTestsperformanceapiresourcesresourcetimingapijs">trunk/LayoutTests/performance-api/resources/resource-timing-api.js</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceTimingcpp">trunk/Source/WebCore/loader/ResourceTiming.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceTimingh">trunk/Source/WebCore/loader/ResourceTiming.h</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserve">trunk/LayoutTests/imported/w3c/web-platform-tests/serve</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/LayoutTests/ChangeLog        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2017-02-16  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        [Resource Timing] Support Resource Timing in Workers
+        https://bugs.webkit.org/show_bug.cgi?id=168086
+        &lt;rdar://problem/30430117&gt;
+
+        Reviewed by Alex Christensen.
+
+        * TestExpectations:
+        Pre-emptively mark some tests as flakey that have seen flakiness.
+
+        * platform/mac/TestExpectations:
+        Skip some tests on ElCapitan because the network timing numbers appear incorrect.
+
+        * js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
+        PerformanceResourceTiming is now available in Workers.
+
+        * performance-api/resource-timing-apis-expected.txt: Added.
+        * performance-api/resource-timing-apis.html: Added.
+        * performance-api/resources/resource-timing-api.js: Added.
+        Basic API test. We expect to fail nextHopProtocol and size properties right now.
+
</ins><span class="cx"> 2017-02-16  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Mark media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html as flaky.
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/LayoutTests/TestExpectations        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -310,6 +310,12 @@
</span><span class="cx"> # Failing assertion with dynamic message
</span><span class="cx"> imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-document-properties.htm [ Failure ]
</span><span class="cx"> 
</span><ins>+# Failing with dynamic URLs.
+webkit.org/b/168357 imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media.html [ Failure ]
+
+webkit.org/b/168448 imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames.html [ Pass Failure ]
+webkit.org/b/168448 imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers.html [ Pass Failure ]
+
</ins><span class="cx"> webkit.org/b/161176 [ Debug ] imported/w3c/web-platform-tests/url/url-setters.html [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/157068 imported/w3c/web-platform-tests/fetch/nosniff/importscripts.html [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -1,3 +1,88 @@
</span><ins>+2017-02-16  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        [Resource Timing] Support Resource Timing in Workers
+        https://bugs.webkit.org/show_bug.cgi?id=168086
+        &lt;rdar://problem/30430117&gt;
+
+        Reviewed by Alex Christensen.
+
+        * web-platform-tests/resource-timing/idlharness-expected.txt:
+        * web-platform-tests/resource-timing/resource-timing-expected.txt:
+        * web-platform-tests/resource-timing/resource_cached-expected.txt:
+        * web-platform-tests/resource-timing/resource_connection_reuse-expected.txt:
+        Progressions.
+
+        * web-platform-tests/resource-timing/resources/data.json: Added.
+        * web-platform-tests/resource-timing/resources/rt-iframe-1.html: Added.
+        * web-platform-tests/resource-timing/resources/rt-iframe-2.html: Added.
+        * web-platform-tests/resource-timing/resources/rt-module.js: Added.
+        * web-platform-tests/resource-timing/resources/rt-sub-module.js: Added.
+        * web-platform-tests/resource-timing/resources/rt-utilities.js: Added.
+        * web-platform-tests/resource-timing/resources/rt-worker-resources.js: Added.
+        New Resources.
+
+        * web-platform-tests/resource-timing/rt-cors-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-cors.html: Added.
+        * web-platform-tests/resource-timing/rt-cors.js: Added.
+        * web-platform-tests/resource-timing/rt-cors.worker-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-cors.worker.html: Added.
+        * web-platform-tests/resource-timing/rt-cors.worker.js: Added.
+        Tests for redirects and cross origin data hiding.
+
+        * web-platform-tests/resource-timing/rt-initiatorType-css-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-css.html: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-element-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-element.html: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-fetch-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-fetch.html: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-fetch.js: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-other-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-other.html: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-script-module-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-script-module.html: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.js: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType.worker-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType.worker.html: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType.worker.js: Added.
+        Tests for producing different initiator types.
+
+        * web-platform-tests/resource-timing/rt-initiatorType-media-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-initiatorType-media.html: Added.
+        We currently fail these tests, so they are marked as fail.
+
+        * web-platform-tests/resource-timing/rt-performance-extensions-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-performance-extensions.html: Added.
+        * web-platform-tests/resource-timing/rt-performance-extensions.js: Added.
+        * web-platform-tests/resource-timing/rt-performance-extensions.worker-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-performance-extensions.worker.html: Added.
+        * web-platform-tests/resource-timing/rt-performance-extensions.worker.js: Added.
+        Tests for the new Performance APIs.
+
+        * web-platform-tests/resource-timing/rt-serialization-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-serialization.html: Added.
+        Tests for JSON serialization.
+
+        * web-platform-tests/resource-timing/rt-resource-errors-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-resource-errors.html: Added.
+        * web-platform-tests/resource-timing/rt-resource-ignored-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-resource-ignored.html: Added.
+        Tests for when PerformanceResourceTiming entries should not be included.
+
+        * web-platform-tests/resource-timing/rt-resources-per-frame-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-resources-per-frame.html: Added.
+        * web-platform-tests/resource-timing/rt-resources-per-worker-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-resources-per-worker.html: Added.
+        * web-platform-tests/resource-timing/rt-shared-resource-in-frames-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-shared-resource-in-frames.html: Added.
+        * web-platform-tests/resource-timing/rt-shared-resource-in-workers-expected.txt: Added.
+        * web-platform-tests/resource-timing/rt-shared-resource-in-workers.html: Added.
+        Tests for different entries in different contexts.
+
+        * web-platform-tests/serve:
+        Make executable.
+
</ins><span class="cx"> 2017-02-16  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Unreviewed test gardening
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingidlharnessexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/idlharness-expected.txt (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/idlharness-expected.txt        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/idlharness-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -15,23 +15,23 @@
</span><span class="cx"> PASS Performance interface: window.performance must inherit property &quot;setResourceTimingBufferSize&quot; with the proper type (4) 
</span><span class="cx"> PASS Performance interface: calling setResourceTimingBufferSize(unsigned long) on window.performance with too few arguments must throw TypeError 
</span><span class="cx"> PASS Performance interface: window.performance must inherit property &quot;onresourcetimingbufferfull&quot; with the proper type (5) 
</span><del>-FAIL PerformanceResourceTiming interface: existence and properties of interface object assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface object length assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface object name assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: existence and properties of interface prototype object assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: existence and properties of interface prototype object's &quot;constructor&quot; property assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: attribute initiatorType assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: attribute redirectStart assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: attribute redirectEnd assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: attribute fetchStart assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: attribute domainLookupStart assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: attribute domainLookupEnd assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: attribute connectStart assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: attribute connectEnd assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: attribute secureConnectionStart assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: attribute requestStart assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: attribute responseStart assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
-FAIL PerformanceResourceTiming interface: attribute responseEnd assert_own_property: self does not have own property &quot;PerformanceResourceTiming&quot; expected property &quot;PerformanceResourceTiming&quot; missing
</del><ins>+PASS PerformanceResourceTiming interface: existence and properties of interface object 
+PASS PerformanceResourceTiming interface object length 
+PASS PerformanceResourceTiming interface object name 
+PASS PerformanceResourceTiming interface: existence and properties of interface prototype object 
+PASS PerformanceResourceTiming interface: existence and properties of interface prototype object's &quot;constructor&quot; property 
+PASS PerformanceResourceTiming interface: attribute initiatorType 
+PASS PerformanceResourceTiming interface: attribute redirectStart 
+PASS PerformanceResourceTiming interface: attribute redirectEnd 
+PASS PerformanceResourceTiming interface: attribute fetchStart 
+PASS PerformanceResourceTiming interface: attribute domainLookupStart 
+PASS PerformanceResourceTiming interface: attribute domainLookupEnd 
+PASS PerformanceResourceTiming interface: attribute connectStart 
+PASS PerformanceResourceTiming interface: attribute connectEnd 
+PASS PerformanceResourceTiming interface: attribute secureConnectionStart 
+PASS PerformanceResourceTiming interface: attribute requestStart 
+PASS PerformanceResourceTiming interface: attribute responseStart 
+PASS PerformanceResourceTiming interface: attribute responseEnd 
</ins><span class="cx"> [Exposed=(Window)]
</span><span class="cx"> interface PerformanceResourceTiming : PerformanceEntry {
</span><span class="cx">     readonly attribute DOMString           initiatorType;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcetimingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-expected.txt (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-expected.txt        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -1,20 +1,20 @@
</span><ins>+CONSOLE MESSAGE: line 9: SecurityError (DOM Exception 18): The operation is insecure.
</ins><span class="cx"> 
</span><del>-FAIL No timeline entry for about:blank assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL Setting 'document.domain' does not effect same-origin checks assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'iframe (Populate cache): The initial request populates the cache (if appropriate). assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'iframe (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'xmlhttprequest (Populate cache): The initial request populates the cache (if appropriate). assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'xmlhttprequest (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'script (Populate cache): The initial request populates the cache (if appropriate). assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'script (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'link (Populate cache): The initial request populates the cache (if appropriate). assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'link (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'iframe: 1 second delay before 'responseStart', another 1 second delay before 'responseEnd'. assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'xmlhttprequest: 1 second delay before 'responseStart', another 1 second delay before 'responseEnd'. assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'script: 1 second delay before 'responseStart', another 1 second delay before 'responseEnd'. assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'link: 1 second delay before 'responseStart', another 1 second delay before 'responseEnd'. assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'iframe (Redirected): 1 second delay before 'redirectEnd', another 1 second delay before 'responseStart'. assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'xmlhttprequest (Redirected): 1 second delay before 'redirectEnd', another 1 second delay before 'responseStart'. assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'script (Redirected): 1 second delay before 'redirectEnd', another 1 second delay before 'responseStart'. assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
-FAIL 'link (Redirected): 1 second delay before 'redirectEnd', another 1 second delay before 'responseStart'. assert_less_than_equal: fetchStart &lt;= domainLookupStart expected a number less than or equal to 0 but got 103.4
</del><ins>+Harness Error (TIMEOUT), message = null
+
+PASS No timeline entry for about:blank 
+PASS Setting 'document.domain' does not effect same-origin checks 
+PASS 'iframe (Populate cache): The initial request populates the cache (if appropriate). 
+PASS 'iframe (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). 
+PASS 'xmlhttprequest (Populate cache): The initial request populates the cache (if appropriate). 
+PASS 'xmlhttprequest (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). 
+PASS 'script (Populate cache): The initial request populates the cache (if appropriate). 
+PASS 'script (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). 
+PASS 'link (Populate cache): The initial request populates the cache (if appropriate). 
+PASS 'link (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). 
+PASS 'iframe: 1 second delay before 'responseStart', another 1 second delay before 'responseEnd'. 
+PASS 'xmlhttprequest: 1 second delay before 'responseStart', another 1 second delay before 'responseEnd'. 
+PASS 'script: 1 second delay before 'responseStart', another 1 second delay before 'responseEnd'. 
+TIMEOUT 'link: 1 second delay before 'responseStart', another 1 second delay before 'responseEnd'. Test timed out
+TIMEOUT 'iframe (Redirected): 1 second delay before 'redirectEnd', another 1 second delay before 'responseStart'. Test timed out
</ins><span class="cx"> Show details
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_cachedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_cached-expected.txt (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_cached-expected.txt        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_cached-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -5,5 +5,6 @@
</span><span class="cx"> 
</span><span class="cx"> PASS window.performance is defined 
</span><span class="cx"> PASS window.performance.getEntriesByType is defined 
</span><del>-FAIL There should be two entries assert_equals: There should be two entries expected 2 but got 0
</del><ins>+PASS There should be two entries 
+PASS Both entries should have the same name 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresource_connection_reuseexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse-expected.txt (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse-expected.txt        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -1,12 +1,11 @@
</span><del>-CONSOLE MESSAGE: line 41: TypeError: undefined is not an object (evaluating 'entry.fetchStart')
</del><span class="cx"> Description
</span><span class="cx"> 
</span><span class="cx"> This test validates that connectStart and connectEnd are the same when a connection is reused (e.g. when a persistent connection is used).
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-Harness Error (FAIL), message = TypeError: undefined is not an object (evaluating 'entry.fetchStart')
-
</del><span class="cx"> PASS window.performance is defined 
</span><span class="cx"> PASS window.performance.getEntriesByType is defined 
</span><del>-FAIL There should be 2 PerformanceEntries assert_equals: There should be 2 PerformanceEntries expected 2 but got 0
</del><ins>+PASS There should be 2 PerformanceEntries 
+PASS connectStart and fetchStart should be the same 
+PASS connectEnd and fetchStart should be the same 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesdatajson"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/data.json (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/data.json                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/data.json        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+{a:1,b:2}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesrtiframe1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-iframe-1.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-iframe-1.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-iframe-1.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Frame 1&lt;/title&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Frame 1&lt;/h1&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesrtiframe2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-iframe-2.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-iframe-2.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-iframe-2.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Frame 2&lt;/title&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Frame 2&lt;/h1&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesrtmodulejs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-module.js (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-module.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-module.js        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+import &quot;./rt-sub-module.js&quot;;
+
+function rtModule(){}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesrtsubmodulejs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-sub-module.js (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-sub-module.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-sub-module.js        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+function rtSubModule(){}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesrtutilitiesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-utilities.js (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-utilities.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-utilities.js        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,152 @@
</span><ins>+let global = this;
+
+function hasNecessaryPerformanceFeatures() {
+    return !!(global.PerformanceObserver &amp;&amp; global.PerformanceResourceTiming);
+}
+
+function testNecessaryPerformanceFeatures() {
+    let supported = hasNecessaryPerformanceFeatures();
+
+    test(function() {
+        assert_true(supported);
+    }, &quot;Must have PerformanceObserver and PerformanceResourceTiming in &quot; + global.constructor.name);
+
+    return supported;
+}
+
+function wait() {
+    let now = performance.now();
+    while (now === performance.now())
+        continue;
+}
+
+function uniqueDataURL(key, crossOrigin) { return uniqueURL(key, crossOrigin, &quot;resource-timing/resources/data.json&quot;); }
+function uniqueImageURL(key, crossOrigin) { return uniqueURL(key, crossOrigin, &quot;resource-timing/resources/resource_timing_test0.png&quot;); }
+function uniqueScriptURL(key, crossOrigin) { return uniqueURL(key, crossOrigin, &quot;resource-timing/resources/resource_timing_test0.js&quot;); }
+function uniqueStylesheetURL(key, crossOrigin) { return uniqueURL(key, crossOrigin, &quot;resource-timing/resources/resource_timing_test0.css&quot;); }
+function uniqueDocumentURL(key, crossOrigin) { return uniqueURL(key, crossOrigin, &quot;resource-timing/resources/resource_timing_test0.html&quot;); }
+function uniqueEventSourceURL(key, crossOrigin) { return uniqueURL(key, crossOrigin, &quot;resource-timing/resources/rt-event-stream.py&quot;); }
+function uniqueURL(key, crossOrigin, path) {
+    let params = key ? `${key}&amp;${Math.random()}` : `${Math.random()}`;
+    if (crossOrigin === &quot;cross-origin&quot;)
+        return `http://{{host}}:{{ports[http][1]}}/${path}?${params}`;
+    return location.origin + `/${path}?${params}`;
+}
+
+function crossOriginURL(key, path) {
+    return `http://{{host}}:{{ports[http][1]}}/${path}?${key}`;
+}
+
+function urlWithRedirectTo(url) {
+    return `/common/redirect.py?location=${encodeURIComponent(url)}`;
+}
+
+function addPipeHeaders(url, headers) {
+    return `${url}&amp;pipe=${headers.join(&quot;|&quot;)}`;
+}
+
+function addTimingAllowOriginHeader(url, origin) {
+    if (!origin) throw `Invalid origin: ${origin}`;
+    return addPipeHeaders(url, [
+        `header(Access-Control-Allow-Origin,*)`,
+        `header(Timing-Allow-Origin,${origin})`,
+    ]);
+}
+
+function addMultipleTimingAllowOriginHeaders(url, origins) {
+    if (origins.length &lt; 2) throw &quot;Needs &gt;1 origins&quot;;
+    let allHeaders = [`header(Access-Control-Allow-Origin,*)`];
+    allHeaders = allHeaders.concat(origins.map((origin) =&gt; `header(Timing-Allow-Origin,${origin},True)`));
+    return addPipeHeaders(url, allHeaders);
+}
+
+function addCommaSeparatedTimingAllowOriginHeaders(url, origins) {
+    if (origins.length &lt; 2) throw &quot;Needs &gt;1 origins&quot;;
+    return addPipeHeaders(url, [
+        `header(Access-Control-Allow-Origin,*)`,
+        `header(Timing-Allow-Origin,${origins.join(&quot;\\,&quot;)})`
+    ]);
+}
+
+function observeResources(n) {
+    return new Promise(function(resolve, reject) {
+        let entries = [];
+        let observer = new PerformanceObserver(function(list) {
+            entries = entries.concat(list.getEntries());
+            if (entries.length &lt; n)
+                return;
+            if (entries.length &gt; n)
+                entries = entries.slice(0, n);
+            observer.disconnect();
+            resolve(entries);
+        });
+        observer.observe({entryTypes: [&quot;resource&quot;]});
+    });
+}
+
+function loadResources(n) {
+    let observePromise = observeResources(n);
+    for (let i = 0; i &lt; n; ++i)
+        fetch(uniqueDataURL());
+    return observePromise;
+}
+
+function restoreEnvironmentToCleanState() {
+    performance.clearResourceTimings();
+    performance.setResourceTimingBufferSize(200);
+    performance.onresourcetimingbufferfull = null;
+
+    assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 0, &quot;context should have no resources&quot;);
+}
+
+function checkResourceTimingEntryType(entry, expected) {
+    assert_true(entry instanceof PerformanceResourceTiming, &quot;entry should be a PerformanceResourceTiming instance&quot;);
+    assert_equals(entry.entryType, &quot;resource&quot;, &quot;entryType should be 'resource'&quot;);
+
+    if (expected.name)
+        assert_equals(entry.name, expected.name, &quot;name should be the url&quot;);
+    if (expected.initiatorType)
+        assert_equals(entry.initiatorType, expected.initiatorType, `initiatorType should be '${expected.initiatorType}'`);
+}
+
+function checkResourceTimingEntryTiming(entry) {
+    assert_true(entry instanceof PerformanceResourceTiming, &quot;entry should be a PerformanceResourceTiming instance&quot;);
+    assert_equals(entry.entryType, &quot;resource&quot;, &quot;entryType should be 'resource'&quot;);
+
+    assert_equals(entry.workerStart, 0, &quot;entry should not have a workerStart time&quot;);
+    assert_equals(entry.redirectStart, 0, &quot;entry should not have a redirectStart time&quot;);
+    assert_equals(entry.redirectEnd, 0, &quot;entry should not have a redirectEnd time&quot;);
+    assert_equals(entry.secureConnectionStart, 0, &quot;entry should not have a secureConnectionStart time&quot;);
+
+    assert_not_equals(entry.startTime, 0, &quot;entry should have a non-0 fetchStart time&quot;);
+    assert_not_equals(entry.fetchStart, 0, &quot;entry should have a non-0 startTime time&quot;);
+    assert_equals(entry.startTime, entry.fetchStart, &quot;entry startTime should be the same as fetchTime for non-redirect&quot;);
+    assert_greater_than_equal(entry.domainLookupStart, entry.fetchStart, &quot;domainLookupStart after fetchStart&quot;);
+    assert_greater_than_equal(entry.domainLookupEnd, entry.domainLookupStart, &quot;domainLookupEnd after domainLookupStart&quot;);
+    assert_greater_than_equal(entry.connectStart, entry.domainLookupEnd, &quot;connectStart after domainLookupEnd&quot;);
+    assert_greater_than_equal(entry.connectEnd, entry.connectStart, &quot;connectEnd after connectStart&quot;);
+    assert_greater_than_equal(entry.requestStart, entry.connectEnd, &quot;requestStart after connectEnd&quot;);
+    assert_greater_than_equal(entry.responseStart, entry.requestStart, &quot;responseStart after requestStart&quot;);
+    assert_greater_than_equal(entry.responseEnd, entry.responseStart, &quot;responseEnd after responseStart&quot;);
+}
+
+function resource_entry_type_test({name, url, initiatorType, generateResource}) {
+    let entry = null;
+
+    // Test type attributes.
+    promise_test(function(t) {
+        let promise = observeResources(1).then(function([observedEntry]) {
+            entry = observedEntry;
+            checkResourceTimingEntryType(entry, {name: url, initiatorType});
+        });
+        generateResource(url);
+        return promise;
+    }, &quot;Type: &quot; + name, {timeout: 3000});
+
+    // Test timing attributes.
+    promise_test(function(t) {        
+        assert_true(entry !== null, &quot;previous test should have produced an entry&quot;);
+        checkResourceTimingEntryTiming(entry);
+        return Promise.resolve(true);
+    }, &quot;Timing: &quot; + name);
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingresourcesrtworkerresourcesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-worker-resources.js (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-worker-resources.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/rt-worker-resources.js        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+importScripts(&quot;rt-utilities.js&quot;);
+
+addEventListener(&quot;message&quot;, function(event) {
+    if (!hasNecessaryPerformanceFeatures()) {
+        postMessage(&quot;error&quot;);
+        return;
+    }
+
+    performance.clearResourceTimings();
+
+    let promises = [];
+
+    if (event.data.n)
+        promises.push(loadResources(event.data.n));
+    if (event.data.sharedResourceURL);
+        promises.push(fetch(event.data.sharedResourceURL));
+
+    Promise.all(promises).then(function() {
+        let entries = performance.getEntriesByType(&quot;resource&quot;);
+        let serializedEntries = JSON.parse(JSON.stringify(entries));
+        postMessage(serializedEntries);
+    });
+});
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtcorsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+Resource Timing: CORS requests
+
+
+PASS Same Origin request must have timing data 
+PASS Cross Origin resource without Timing-Allow-Origin must have filtered timing data 
+PASS Cross Origin resource with Timing-Allow-Origin null value must have filtered timing data 
+PASS Cross Origin resource with Timing-Allow-Origin wildcard must have timing data 
+PASS Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (only entry) 
+PASS Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (middle entry, comma separated) 
+PASS Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (middle entry, multiple headers) 
+PASS Cross Origin resource with origin not in Timing-Allow-Origin list must have filtered timing data (other origins, comma separated) 
+PASS Cross Origin resource with origin not in Timing-Allow-Origin list must have filtered timing data (other origins, multiple headers) 
+PASS Cross Origin resource with origin not Timing-Allow-Origin list must have filtered timing data (case-sensitive) 
+PASS Redirect to Same Origin request must have timing data 
+PASS Redirect to Cross Origin resource without Timing-Allow-Origin must have filtered timing data 
+PASS Redirect to Cross Origin resource with Timing-Allow-Origin null value must have filtered timing data 
+PASS Redirect to Cross Origin resource with Timing-Allow-Origin wildcard must have timing data 
+PASS Redirect to Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (only entry) 
+PASS Redirect to Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (middle entry, comma separated) 
+PASS Redirect to Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (middle entry, multiple headers) 
+PASS Redirect to Cross Origin resource with origin not in Timing-Allow-Origin list must have filtered timing data (other origins, comma separated) 
+PASS Redirect to Cross Origin resource with origin not in Timing-Allow-Origin list must have filtered timing data (other origins, multiple headers) 
+PASS Redirect to Cross Origin resource with origin not Timing-Allow-Origin list must have filtered timing data (case-sensitive) 
+PASS Multiple level redirect to Same Origin resource must have timing data 
+PASS Multiple level redirect to Cross Origin resource without Timing-Allow-Origin must have must have filtered timing data 
+PASS Multiple level redirect to Cross Origin resource with Timing-Allow-Origin must have must have timing data 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtcorshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - CORS requests&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#cross-origin-resources&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js?pipe=sub&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: CORS requests&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script src=&quot;rt-cors.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtcorsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.js (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.js        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,328 @@
</span><ins>+function assertAlways(entry) {
+    assert_equals(entry.workerStart, 0, &quot;entry should not have a workerStart time&quot;);
+    assert_equals(entry.secureConnectionStart, 0, &quot;entry should not have a secureConnectionStart time&quot;);
+
+    assert_not_equals(entry.startTime, 0, &quot;entry should have a non-0 fetchStart time&quot;);
+    assert_not_equals(entry.fetchStart, 0, &quot;entry should have a non-0 startTime time&quot;);
+    assert_not_equals(entry.responseEnd, 0, &quot;entry should have a non-0 responseEnd time&quot;);
+
+    assert_greater_than_equal(entry.fetchStart, entry.startTime, &quot;fetchStart after startTime&quot;);
+    assert_greater_than_equal(entry.responseEnd, entry.fetchStart, &quot;responseEnd after fetchStart&quot;);
+}
+
+function assertRedirectTimingData(entry) {
+    assertAlways(entry);
+    assert_not_equals(entry.redirectStart, 0, &quot;entry should have a redirectStart time&quot;);
+    assert_not_equals(entry.redirectEnd, 0, &quot;entry should have a redirectEnd time&quot;);
+    assert_equals(entry.startTime, entry.redirectStart, &quot;entry startTime should be the same as redirectStart for a redirect&quot;);
+    assert_greater_than_equal(entry.redirectEnd, entry.redirectStart, &quot;redirectEnd after redirectStart&quot;);
+    assert_greater_than_equal(entry.fetchStart, entry.redirectEnd, &quot;fetchStart after redirectEnd&quot;);
+}
+
+function assertRedirectWithDisallowedTimingData(entry) {
+    assertAlways(entry);
+    assert_equals(entry.redirectStart, 0, &quot;entry should not have a redirectStart time&quot;);
+    assert_equals(entry.redirectEnd, 0, &quot;entry should not have a redirectEnd time&quot;);
+    assert_not_equals(entry.startTime, entry.fetchStart, &quot;entry startTime should have matched redirectStart but it was disallowed so it should not match fetchStart&quot;);
+}
+
+function assertNonRedirectTimingData(entry) {
+    assertAlways(entry);
+    assert_equals(entry.redirectStart, 0, &quot;entry should not have a redirectStart time&quot;);
+    assert_equals(entry.redirectEnd, 0, &quot;entry should not have a redirectEnd time&quot;);
+    assert_equals(entry.startTime, entry.fetchStart, &quot;entry startTime should be the same as fetchTime for non-redirect&quot;);
+}
+
+function assertAllowedTimingData(entry) {
+    assert_greater_than_equal(entry.domainLookupStart, entry.fetchStart, &quot;domainLookupStart after fetchStart&quot;);
+    assert_greater_than_equal(entry.domainLookupEnd, entry.domainLookupStart, &quot;domainLookupEnd after domainLookupStart&quot;);
+    assert_greater_than_equal(entry.connectStart, entry.domainLookupEnd, &quot;connectStart after domainLookupEnd&quot;);
+    assert_greater_than_equal(entry.connectEnd, entry.connectStart, &quot;connectEnd after connectStart&quot;);
+    assert_greater_than_equal(entry.requestStart, entry.connectEnd, &quot;requestStart after connectEnd&quot;);
+    assert_greater_than_equal(entry.responseStart, entry.requestStart, &quot;responseStart after requestStart&quot;);
+    assert_greater_than_equal(entry.responseEnd, entry.responseStart, &quot;responseEnd after responseStart&quot;);
+}
+
+function assertDisallowedTimingData(entry) {
+    // These attributes must be zero:
+    // https://w3c.github.io/resource-timing/#cross-origin-resources
+    const keys = [
+        &quot;redirectStart&quot;,
+        &quot;redirectEnd&quot;,
+        &quot;domainLookupStart&quot;,
+        &quot;domainLookupEnd&quot;,
+        &quot;connectStart&quot;,
+        &quot;connectEnd&quot;,
+        &quot;requestStart&quot;,
+        &quot;responseStart&quot;,
+        &quot;secureConnectionStart&quot;,
+    ];
+    for (let key of keys)
+        assert_equals(entry[key], 0, `entry ${key} must be zero for Cross Origin resource without passing Timing-Allow-Origin check`);
+}
+
+// No-redirect
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertNonRedirectTimingData(entry);
+        assertAllowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;same-origin-1&quot;, &quot;same-origin&quot;);
+    fetch(url);
+    return promise;
+}, &quot;Same Origin request must have timing data&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertNonRedirectTimingData(entry);
+        assertDisallowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;cross-origin-1&quot;, &quot;cross-origin&quot;);
+    url = url + &quot;&amp;pipe=header(Access-Control-Allow-Origin,*)&quot;;
+    fetch(url);
+    return promise;
+}, &quot;Cross Origin resource without Timing-Allow-Origin must have filtered timing data&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertNonRedirectTimingData(entry);
+        assertDisallowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;null&quot;, &quot;cross-origin&quot;);
+    url = addTimingAllowOriginHeader(url, &quot;null&quot;);
+    fetch(url);
+    return promise;
+}, &quot;Cross Origin resource with Timing-Allow-Origin null value must have filtered timing data&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertNonRedirectTimingData(entry);
+        assertAllowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;wildcard&quot;, &quot;cross-origin&quot;);
+    url = addTimingAllowOriginHeader(url, &quot;*&quot;);
+    fetch(url);
+    return promise;
+}, &quot;Cross Origin resource with Timing-Allow-Origin wildcard must have timing data&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertNonRedirectTimingData(entry);
+        assertAllowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;only-entry&quot;, &quot;cross-origin&quot;);
+    url = addTimingAllowOriginHeader(url, location.origin);
+    fetch(url);
+    return promise;
+}, &quot;Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (only entry)&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertNonRedirectTimingData(entry);
+        assertAllowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;middle-entry&quot;, &quot;cross-origin&quot;);
+    url = addCommaSeparatedTimingAllowOriginHeaders(url, [&quot;example.com&quot;, location.origin, &quot;example.com&quot;]);
+    fetch(url);
+    return promise;
+}, &quot;Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (middle entry, comma separated)&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertNonRedirectTimingData(entry);
+        assertAllowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;middle-entry&quot;, &quot;cross-origin&quot;);
+    url = addMultipleTimingAllowOriginHeaders(url, [&quot;example.com&quot;, location.origin, &quot;example.com&quot;]);
+    fetch(url);
+    return promise;
+}, &quot;Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (middle entry, multiple headers)&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertNonRedirectTimingData(entry);
+        assertDisallowedTimingData(entry); });
+    let url = uniqueDataURL(&quot;other-origins&quot;, &quot;cross-origin&quot;);
+    url = addCommaSeparatedTimingAllowOriginHeaders(url, [location.origin + &quot;.test&quot;, &quot;x&quot; + location.origin]);
+    fetch(url);
+    return promise;
+}, &quot;Cross Origin resource with origin not in Timing-Allow-Origin list must have filtered timing data (other origins, comma separated)&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertNonRedirectTimingData(entry);
+        assertDisallowedTimingData(entry); });
+    let url = uniqueDataURL(&quot;other-origins&quot;, &quot;cross-origin&quot;);
+    url = addMultipleTimingAllowOriginHeaders(url, [location.origin + &quot;.test&quot;, &quot;x&quot; + location.origin]);
+    fetch(url);
+    return promise;
+}, &quot;Cross Origin resource with origin not in Timing-Allow-Origin list must have filtered timing data (other origins, multiple headers)&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertNonRedirectTimingData(entry);
+        assertDisallowedTimingData(entry); });
+    let url = uniqueDataURL(&quot;case-sensitive&quot;, &quot;cross-origin&quot;);
+    url = addTimingAllowOriginHeader(url, location.origin.toUpperCase());
+    fetch(url);
+    return promise;
+}, &quot;Cross Origin resource with origin not Timing-Allow-Origin list must have filtered timing data (case-sensitive)&quot;);
+
+// Redirects
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectTimingData(entry);
+        assertAllowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;redirect-same-origin-1&quot;, &quot;same-origin&quot;);
+    fetch(urlWithRedirectTo(url));
+    return promise;
+}, &quot;Redirect to Same Origin request must have timing data&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectWithDisallowedTimingData(entry);
+        assertDisallowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;redirect-cross-origin-1&quot;, &quot;cross-origin&quot;);
+    url = url + &quot;&amp;pipe=header(Access-Control-Allow-Origin,*)&quot;;
+    fetch(urlWithRedirectTo(url));
+    return promise;
+}, &quot;Redirect to Cross Origin resource without Timing-Allow-Origin must have filtered timing data&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectWithDisallowedTimingData(entry);
+        assertDisallowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;redirect-null&quot;, &quot;cross-origin&quot;);
+    url = addTimingAllowOriginHeader(url, &quot;null&quot;);
+    fetch(urlWithRedirectTo(url));
+    return promise;
+}, &quot;Redirect to Cross Origin resource with Timing-Allow-Origin null value must have filtered timing data&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectTimingData(entry);
+        assertAllowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;redirect-wildcard&quot;, &quot;cross-origin&quot;);
+    url = addTimingAllowOriginHeader(url, &quot;*&quot;);
+    fetch(urlWithRedirectTo(url));
+    return promise;
+}, &quot;Redirect to Cross Origin resource with Timing-Allow-Origin wildcard must have timing data&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectTimingData(entry);
+        assertAllowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;redirect-only-entry&quot;, &quot;cross-origin&quot;);
+    url = addTimingAllowOriginHeader(url, location.origin);
+    fetch(urlWithRedirectTo(url));
+    return promise;
+}, &quot;Redirect to Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (only entry)&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectTimingData(entry);
+        assertAllowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;redirect-middle-entry&quot;, &quot;cross-origin&quot;);
+    url = addCommaSeparatedTimingAllowOriginHeaders(url, [&quot;example.com&quot;, location.origin, &quot;example.com&quot;]);
+    fetch(urlWithRedirectTo(url));
+    return promise;
+}, &quot;Redirect to Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (middle entry, comma separated)&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectTimingData(entry);
+        assertAllowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;redirect-middle-entry&quot;, &quot;cross-origin&quot;);
+    url = addMultipleTimingAllowOriginHeaders(url, [&quot;example.com&quot;, location.origin, &quot;example.com&quot;]);
+    fetch(urlWithRedirectTo(url));
+    return promise;
+}, &quot;Redirect to Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (middle entry, multiple headers)&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectWithDisallowedTimingData(entry);
+        assertDisallowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;redirect-other-origins&quot;, &quot;cross-origin&quot;);
+    url = addCommaSeparatedTimingAllowOriginHeaders(url, [location.origin + &quot;.test&quot;, &quot;x&quot; + location.origin]);
+    fetch(urlWithRedirectTo(url));
+    return promise;
+}, &quot;Redirect to Cross Origin resource with origin not in Timing-Allow-Origin list must have filtered timing data (other origins, comma separated)&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectWithDisallowedTimingData(entry);
+        assertDisallowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;redirect-other-origins&quot;, &quot;cross-origin&quot;);
+    url = addMultipleTimingAllowOriginHeaders(url, [location.origin + &quot;.test&quot;, &quot;x&quot; + location.origin]);
+    fetch(urlWithRedirectTo(url));
+    return promise;
+}, &quot;Redirect to Cross Origin resource with origin not in Timing-Allow-Origin list must have filtered timing data (other origins, multiple headers)&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectWithDisallowedTimingData(entry);
+        assertDisallowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;redirect-case-sensitive&quot;, &quot;cross-origin&quot;);
+    url = addTimingAllowOriginHeader(url, location.origin.toUpperCase());
+    fetch(urlWithRedirectTo(url));
+    return promise;
+}, &quot;Redirect to Cross Origin resource with origin not Timing-Allow-Origin list must have filtered timing data (case-sensitive)&quot;);
+
+
+// Multiple redirects
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectTimingData(entry);
+        assertAllowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;multiple-redirect-same-origin&quot;, &quot;same-origin&quot;);
+    let urlRedirect1 = urlWithRedirectTo(url);
+    let urlRedirect2 = urlWithRedirectTo(urlRedirect1);
+    let urlRedirect3 = urlWithRedirectTo(urlRedirect2);
+    fetch(urlRedirect3);
+    return promise;
+}, &quot;Multiple level redirect to Same Origin resource must have timing data&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectWithDisallowedTimingData(entry);
+        assertDisallowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;multiple-redirect-cross-origin&quot;, &quot;cross-origin&quot;);
+    url += &quot;&amp;pipe=header(Access-Control-Allow-Origin,*)&quot;;
+    let urlRedirect1 = urlWithRedirectTo(url);
+    let urlRedirect2 = urlWithRedirectTo(urlRedirect1);
+    let urlRedirect3 = urlWithRedirectTo(urlRedirect2);
+    fetch(urlRedirect3);
+    return promise;
+}, &quot;Multiple level redirect to Cross Origin resource without Timing-Allow-Origin must have must have filtered timing data&quot;);
+
+promise_test(function(t) {
+    let promise = observeResources(1).then(([entry]) =&gt; {
+        assertRedirectTimingData(entry);
+        assertAllowedTimingData(entry);
+    });
+    let url = uniqueDataURL(&quot;multiple-redirect-cross-origin-timing-allowed&quot;, &quot;cross-origin&quot;);
+    url = addTimingAllowOriginHeader(url, location.origin);
+    let urlRedirect1 = urlWithRedirectTo(url);
+    let urlRedirect2 = urlWithRedirectTo(urlRedirect1);
+    let urlRedirect3 = urlWithRedirectTo(urlRedirect2);
+    fetch(urlRedirect3);
+    return promise;
+}, &quot;Multiple level redirect to Cross Origin resource with Timing-Allow-Origin must have must have timing data&quot;);
+
+// FIXME: Same Origin -&gt; Cross Origin (no Timing-Allow-Origin) -&gt; Same Origin
+// FIXME: Same Origin -&gt; Cross Origin (with Timing-Allow-Origin) -&gt; Same Origin
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtcorsworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.worker-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.worker-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+
+PASS Must have PerformanceObserver and PerformanceResourceTiming in DedicatedWorkerGlobalScope 
+PASS Same Origin request must have timing data 
+PASS Cross Origin resource without Timing-Allow-Origin must have filtered timing data 
+PASS Cross Origin resource with Timing-Allow-Origin null value must have filtered timing data 
+PASS Cross Origin resource with Timing-Allow-Origin wildcard must have timing data 
+PASS Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (only entry) 
+PASS Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (middle entry, comma separated) 
+PASS Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (middle entry, multiple headers) 
+PASS Cross Origin resource with origin not in Timing-Allow-Origin list must have filtered timing data (other origins, comma separated) 
+PASS Cross Origin resource with origin not in Timing-Allow-Origin list must have filtered timing data (other origins, multiple headers) 
+PASS Cross Origin resource with origin not Timing-Allow-Origin list must have filtered timing data (case-sensitive) 
+PASS Redirect to Same Origin request must have timing data 
+PASS Redirect to Cross Origin resource without Timing-Allow-Origin must have filtered timing data 
+PASS Redirect to Cross Origin resource with Timing-Allow-Origin null value must have filtered timing data 
+PASS Redirect to Cross Origin resource with Timing-Allow-Origin wildcard must have timing data 
+PASS Redirect to Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (only entry) 
+PASS Redirect to Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (middle entry, comma separated) 
+PASS Redirect to Cross Origin resource with origin in Timing-Allow-Origin list must have timing data (middle entry, multiple headers) 
+PASS Redirect to Cross Origin resource with origin not in Timing-Allow-Origin list must have filtered timing data (other origins, comma separated) 
+PASS Redirect to Cross Origin resource with origin not in Timing-Allow-Origin list must have filtered timing data (other origins, multiple headers) 
+PASS Redirect to Cross Origin resource with origin not Timing-Allow-Origin list must have filtered timing data (case-sensitive) 
+PASS Multiple level redirect to Same Origin resource must have timing data 
+PASS Multiple level redirect to Cross Origin resource without Timing-Allow-Origin must have must have filtered timing data 
+PASS Multiple level redirect to Cross Origin resource with Timing-Allow-Origin must have must have timing data 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtcorsworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.html ( => )</h4>
<pre class="diff"><span>
<span class="info">Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.js
===================================================================
</span><del>--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.js                                (rev 0)
</del><ins>+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.js        2017-02-16 19:18:32 UTC (rev 212449)
</ins><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;resources/rt-utilities.js?pipe=sub&quot;);
+
+(function() {
+    if (!testNecessaryPerformanceFeatures()) {
+        done();
+        return;
+    }
+
+    importScripts(&quot;rt-cors.js&quot;);
+
+    done();
+})();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypecssexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+Resource Timing: CSS initiatorType
+
+
+PASS Type: css - background-image 
+PASS Timing: css - background-image 
+PASS Type: css - @import 
+PASS Timing: css - @import 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypecsshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - CSS initiatorType&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-initiatortype&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: CSS initiatorType&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+resource_entry_type_test({
+    name: &quot;css - background-image&quot;,
+    url: uniqueImageURL(&quot;background-image&quot;),
+    initiatorType: &quot;css&quot;,
+    generateResource(url) {
+        let div = document.createElement(&quot;div&quot;);
+        div.style.width = div.style.height = &quot;100px&quot;;
+        div.style.backgroundImage = `url(${url})`;
+        document.body.appendChild(div);
+    },
+});
+
+resource_entry_type_test({
+    name: &quot;css - @import&quot;,
+    url: uniqueStylesheetURL(&quot;import&quot;),
+    initiatorType: &quot;css&quot;,
+    generateResource(url) {
+        let style = document.createElement(&quot;style&quot;);
+        style.textContent = `@import &quot;${url}&quot;`;
+        document.head.appendChild(style);
+    }
+});
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeelementexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+Resource Timing: Element localName initiatorType
+
+
+PASS Type: img - &lt;img src&gt; 
+PASS Timing: img - &lt;img src&gt; 
+PASS Type: img - &lt;img srcset&gt; 
+PASS Timing: img - &lt;img srcset&gt; 
+PASS Type: img - &lt;picture&gt; 
+PASS Timing: img - &lt;picture&gt; 
+PASS Type: image - &lt;svg:image xlink:href&gt; 
+PASS Timing: image - &lt;svg:image xlink:href&gt; 
+PASS Type: input - &lt;input type=image&gt; 
+PASS Timing: input - &lt;input type=image&gt; 
+PASS Type: script - &lt;script type=script&gt; 
+PASS Timing: script - &lt;script type=script&gt; 
+PASS Type: link - &lt;link rel=stylesheet&gt; 
+PASS Timing: link - &lt;link rel=stylesheet&gt; 
+PASS Type: iframe - &lt;iframe src&gt; 
+PASS Timing: iframe - &lt;iframe src&gt; 
+PASS Type: object - &lt;object data&gt; 
+PASS Timing: object - &lt;object data&gt; 
+PASS Type: embed - &lt;embed data&gt; 
+PASS Timing: embed - &lt;embed data&gt; 
+PASS Type: video - &lt;video poster&gt; 
+PASS Timing: video - &lt;video poster&gt; 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeelementhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,146 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Element localName initiatorType&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-initiatortype&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Element localName initiatorType&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+resource_entry_type_test({
+    name: &quot;img - &lt;img src&gt;&quot;,
+    url: uniqueImageURL(&quot;img-src&quot;),
+    initiatorType: &quot;img&quot;,
+    generateResource(url) {
+        let img = document.createElement(&quot;img&quot;);
+        img.src = url;
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;img - &lt;img srcset&gt;&quot;,
+    url: uniqueImageURL(&quot;img-srcset&quot;),
+    initiatorType: &quot;img&quot;,
+    generateResource(url) {
+        let img = document.createElement(&quot;img&quot;);
+        img.srcset = `${url} 1x, ${url} 2x`;
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;img - &lt;picture&gt;&quot;,
+    url: uniqueImageURL(&quot;picture&quot;),
+    initiatorType: &quot;img&quot;,
+    generateResource(url) {
+        let picture = document.createElement(&quot;picture&quot;);
+        let source = picture.appendChild(document.createElement(&quot;source&quot;));
+        source.srcset = `${url} 1x, ${url} 2x`;
+        let img = picture.appendChild(document.createElement(&quot;img&quot;));
+        img.src = uniqueImageURL(&quot;inner-image&quot;); // Different URL.
+        document.body.appendChild(picture);
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;image - &lt;svg:image xlink:href&gt;&quot;,
+    url: uniqueImageURL(&quot;svg-image&quot;),
+    initiatorType: &quot;image&quot;,
+    generateResource(url) {
+        const svgNamespace = &quot;http://www.w3.org/2000/svg&quot;;
+        const xlinkNamespace = &quot;http://www.w3.org/1999/xlink&quot;;
+        let svgElement = document.createElementNS(svgNamespace, &quot;svg&quot;);
+        let imageElement = svgElement.appendChild(document.createElementNS(svgNamespace, &quot;image&quot;));
+        imageElement.setAttributeNS(xlinkNamespace, &quot;xlink:href&quot;, url);
+        document.body.appendChild(svgElement);
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;input - &lt;input type=image&gt;&quot;,
+    url: uniqueImageURL(&quot;input-image&quot;),
+    initiatorType: &quot;input&quot;,
+    generateResource(url) {
+        let input = document.createElement(&quot;input&quot;);
+        input.type = &quot;image&quot;;
+        input.src = url;
+        document.body.appendChild(input);
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;script - &lt;script type=script&gt;&quot;,
+    url: uniqueScriptURL(&quot;script&quot;),
+    initiatorType: &quot;script&quot;,
+    generateResource(url) {
+        let script = document.createElement(&quot;script&quot;);
+        script.src = url;
+        document.head.appendChild(script);
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;link - &lt;link rel=stylesheet&gt;&quot;,
+    url: uniqueStylesheetURL(&quot;link-stylesheet&quot;),
+    initiatorType: &quot;link&quot;,
+    generateResource(url) {
+        let link = document.createElement(&quot;link&quot;);
+        link.rel = &quot;stylesheet&quot;;
+        link.href = url;
+        document.head.appendChild(link);
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;iframe - &lt;iframe src&gt;&quot;,
+    url: uniqueDocumentURL(&quot;iframe&quot;),
+    initiatorType: &quot;iframe&quot;,
+    generateResource(url) {
+        let iframe = document.createElement(&quot;iframe&quot;);
+        iframe.src = url;
+        document.body.appendChild(iframe);
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;object - &lt;object data&gt;&quot;,
+    url: uniqueDataURL(&quot;object&quot;),
+    initiatorType: &quot;object&quot;,
+    generateResource(url) {
+        let object = document.createElement(&quot;object&quot;);
+        object.data = url;
+        document.body.appendChild(object);
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;embed - &lt;embed data&gt;&quot;,
+    url: uniqueDataURL(&quot;embed&quot;),
+    initiatorType: &quot;embed&quot;,
+    generateResource(url) {
+        let embed = document.createElement(&quot;embed&quot;);
+        embed.src = url;
+        document.body.appendChild(embed);
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;video - &lt;video poster&gt;&quot;,
+    url: uniqueImageURL(&quot;video&quot;),
+    initiatorType: &quot;video&quot;,
+    generateResource(url) {
+        let video = document.createElement(&quot;video&quot;);
+        video.poster = url;
+    }
+});
+
+// FIXME: &lt;html manifest&gt;?
+// FIXME: &lt;track&gt;?
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypefetchexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+Resource Timing: Fetch initiatorType
+
+
+PASS Type: fetch 
+PASS Timing: fetch 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypefetchhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Fetch initiatorType&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-initiatortype&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Fetch initiatorType&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script src=&quot;rt-initiatorType-fetch.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypefetchjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.js (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.js        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+resource_entry_type_test({
+    name: &quot;fetch&quot;,
+    url: uniqueDataURL(&quot;fetch&quot;),
+    initiatorType: &quot;fetch&quot;,
+    generateResource(url) {
+        fetch(url);
+    }
+});
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypemediaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+Resource Timing: Element localName initiatorType
+
+
+FAIL Type: video - &lt;video src&gt; assert_equals: initiatorType should be 'video' expected &quot;video&quot; but got &quot;other&quot;
+PASS Timing: video - &lt;video src&gt; 
+FAIL Type: audio - &lt;audio src&gt; assert_equals: name should be the url expected &quot;http://localhost:8800/resource-timing/resources/data.json?audio&amp;0.7734679755996403&quot; but got &quot;http://localhost:8800/resource-timing/resources/data.json?video&amp;0.5872075656484804&quot;
+PASS Timing: audio - &lt;audio src&gt; 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypemediahtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Element localName initiatorType&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-initiatortype&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Element localName initiatorType&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+resource_entry_type_test({
+    name: &quot;video - &lt;video src&gt;&quot;,
+    url: uniqueDataURL(&quot;video&quot;),
+    initiatorType: &quot;video&quot;,
+    generateResource(url) {
+        let video = document.createElement(&quot;video&quot;);
+        video.src = url;
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;audio - &lt;audio src&gt;&quot;,
+    url: uniqueDataURL(&quot;audio&quot;),
+    initiatorType: &quot;audio&quot;,
+    generateResource(url) {
+        let audio = document.createElement(&quot;audio&quot;);
+        audio.src = url;
+    }
+});
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeotherexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+Resource Timing: Other initiatorType
+
+
+PASS Type: other - Worker 
+PASS Timing: other - Worker 
+TIMEOUT Type: other - EventSource Test timed out
+FAIL Timing: other - EventSource assert_true: previous test should have produced an entry expected true got false
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeotherhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Other initiatorType&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-initiatortype&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Other initiatorType&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+resource_entry_type_test({
+    name: &quot;other - Worker&quot;,
+    url: uniqueScriptURL(&quot;worker&quot;),
+    initiatorType: &quot;other&quot;,
+    generateResource(url) {
+        let worker = new Worker(url);
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;other - EventSource&quot;,
+    url: uniqueEventSourceURL(&quot;event-source&quot;),
+    initiatorType: &quot;other&quot;,
+    generateResource(url) {
+        let eventSource = new EventSource(url);
+    }
+});
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypescriptmoduleexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+Resource Timing: Other initiatorType
+
+
+PASS script - module and sub-module imported scripts 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypescriptmodulehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Other initiatorType&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-initiatortype&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Other initiatorType&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+promise_test(function(t) {
+    return observeResources(2).then(([moduleEntry, subModuleEntry]) =&gt; {
+        checkResourceTimingEntryType(moduleEntry, {
+            name: location.origin + &quot;/resource-timing/resources/rt-module.js&quot;,
+            initiatorType: &quot;script&quot;,
+        });
+        checkResourceTimingEntryType(subModuleEntry, {
+            name: location.origin + &quot;/resource-timing/resources/rt-sub-module.js&quot;,
+            initiatorType: &quot;script&quot;,
+        });
+        checkResourceTimingEntryTiming(moduleEntry);
+        checkResourceTimingEntryTiming(subModuleEntry);
+    });
+}, &quot;script - module and sub-module imported scripts&quot;);
+&lt;/script&gt;
+&lt;script type=&quot;module&quot;&gt;
+import &quot;./resources/rt-module.js&quot;;
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypexmlhttprequestexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+Resource Timing: XMLHttpRequest initiatorType
+
+
+PASS Type: xmlhttprequest (asynchronous) 
+PASS Timing: xmlhttprequest (asynchronous) 
+PASS Type: xmlhttprequest (synchronous) 
+PASS Timing: xmlhttprequest (synchronous) 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypexmlhttprequesthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - XMLHttpRequest initiatorType&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-initiatortype&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: XMLHttpRequest initiatorType&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script src=&quot;rt-initiatorType-xmlhttprequest.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypexmlhttprequestjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.js (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.js        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+resource_entry_type_test({
+    name: &quot;xmlhttprequest (asynchronous)&quot;,
+    url: uniqueDataURL(&quot;xhr-async&quot;),
+    initiatorType: &quot;xmlhttprequest&quot;,
+    generateResource(url) {
+        let xhr = new XMLHttpRequest;
+        xhr.open(&quot;GET&quot;, url, true);
+        xhr.send();
+    }
+});
+
+resource_entry_type_test({
+    name: &quot;xmlhttprequest (synchronous)&quot;,
+    url: uniqueDataURL(&quot;xhr-sync&quot;),
+    initiatorType: &quot;xmlhttprequest&quot;,
+    generateResource(url) {
+        let xhr = new XMLHttpRequest;
+        xhr.open(&quot;GET&quot;, url, true);
+        xhr.send();
+    }
+});
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+
+PASS Must have PerformanceObserver and PerformanceResourceTiming in DedicatedWorkerGlobalScope 
+PASS Type: fetch 
+PASS Timing: fetch 
+PASS Type: xmlhttprequest (asynchronous) 
+PASS Timing: xmlhttprequest (asynchronous) 
+PASS Type: xmlhttprequest (synchronous) 
+PASS Timing: xmlhttprequest (synchronous) 
+PASS Type: other - importScripts 
+PASS Timing: other - importScripts 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtinitiatorTypeworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.html ( => )</h4>
<pre class="diff"><span>
<span class="info">Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.js
===================================================================
</span><del>--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.js                                (rev 0)
</del><ins>+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.js        2017-02-16 19:18:32 UTC (rev 212449)
</ins><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;resources/rt-utilities.js&quot;);
+
+(function() {
+    if (!testNecessaryPerformanceFeatures()) {
+        done();
+        return;
+    }
+
+    importScripts(&quot;rt-initiatorType-fetch.js&quot;);
+    importScripts(&quot;rt-initiatorType-xmlhttprequest.js&quot;);
+
+    resource_entry_type_test({
+        name: &quot;other - importScripts&quot;,
+        url: uniqueScriptURL(&quot;importScripts&quot;),
+        initiatorType: &quot;other&quot;,
+        generateResource(url) {
+            importScripts(url);
+        }
+    });
+
+    done();
+})();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtperformanceextensionsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Resource Timing: Performance Extensions
+
+
+PASS performance.clearResourceTimings clears the buffer 
+PASS performance.clearResourceTimings called multiple times is okay 
+PASS resourcetimingbufferfull event should not trigger for a small number of resources (browser default buffer size) 
+PASS PerformanceObserver sees all resource entries even after buffer is full 
+PASS resourcetimingbufferfull event should not trigger if less than the BufferSizeLimit number of resources are added to the buffer 
+PASS resourcetimingbufferfull event should not trigger if exactly the BufferSizeLimit number of resources are added to the buffer 
+PASS resourcetimingbufferfull event should only trigger once if more than the BufferSizeLimit number of resources are added to the buffer 
+PASS resourcetimingbufferfull event properties 
+PASS performance.setResourceTimingBufferSize set to value less than current BufferSize should not clear existing entries 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtperformanceextensionshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Performance Extensions&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;meta name=&quot;assert&quot; content=&quot;Resource Timing Performance Extensions&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#extensions-performance-interface&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Performance Extensions&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script src=&quot;rt-performance-extensions.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtperformanceextensionsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.js (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.js        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,136 @@
</span><ins>+test(function(t) {
+    assert_greater_than(performance.getEntriesByType(&quot;resource&quot;).length, 0, &quot;context should already have some resources&quot;);
+    performance.clearResourceTimings();
+    assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 0, &quot;clearResourceTimings should have cleared the buffer&quot;);
+}, &quot;performance.clearResourceTimings clears the buffer&quot;);
+
+test(function(t) {
+    performance.clearResourceTimings();
+    performance.clearResourceTimings();
+    performance.clearResourceTimings();
+    assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 0, &quot;clearResourceTimings should have cleared the buffer&quot;);
+}, &quot;performance.clearResourceTimings called multiple times is okay&quot;);
+
+promise_test(function(t) {
+    let bufferFullEventDispatched = false;
+    performance.onresourcetimingbufferfull = function(event) {
+        bufferFullEventDispatched = true;
+    };
+
+    return loadResources(3).then(function(entries) {
+        assert_equals(entries.length, 3, &quot;context should have observed 3 resources&quot;);
+        assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 3, &quot;context should have loaded 4 resources&quot;);
+        assert_false(bufferFullEventDispatched, &quot;context should not have dispatched buffer full event&quot;);
+    });
+}, &quot;resourcetimingbufferfull event should not trigger for a small number of resources (browser default buffer size)&quot;, {timeout: 3000});
+
+promise_test(function(t) {
+    restoreEnvironmentToCleanState();
+    assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 0, &quot;context should have no resources&quot;);
+
+    performance.setResourceTimingBufferSize(1);
+
+    return loadResources(3).then(function(entries) {
+        assert_equals(entries.length, 3, &quot;context should have observed 3 resources&quot;);
+        assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 1, &quot;context global buffer should be full at 1 resource&quot;);
+    });
+}, &quot;PerformanceObserver sees all resource entries even after buffer is full&quot;, {timeout: 3000});
+
+promise_test(function(t) {
+    restoreEnvironmentToCleanState();
+
+    performance.setResourceTimingBufferSize(3);
+
+    let bufferFullEventDispatched = false;
+    performance.onresourcetimingbufferfull = function(event) {
+        bufferFullEventDispatched = true;
+    };
+
+    return loadResources(2).then(function(entries) {
+        assert_equals(entries.length, 2, &quot;context should have observed 3 resources&quot;);
+        assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 2, &quot;context global buffer should have 2 resources when full&quot;);
+        assert_false(bufferFullEventDispatched, &quot;context should not have dispatched buffer full event&quot;);
+    });
+}, &quot;resourcetimingbufferfull event should not trigger if less than the BufferSizeLimit number of resources are added to the buffer&quot;, {timeout: 3000});
+
+promise_test(function(t) {
+    restoreEnvironmentToCleanState();
+
+    performance.setResourceTimingBufferSize(3);
+
+    let bufferFullEventDispatched = false;
+    performance.onresourcetimingbufferfull = function(event) {
+        bufferFullEventDispatched = true;
+    };
+
+    return loadResources(3).then(function(entries) {
+        assert_equals(entries.length, 3, &quot;context should have observed 3 resources&quot;);
+        assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 3, &quot;context global buffer should be full at 3 resources&quot;);
+        assert_true(bufferFullEventDispatched, &quot;context should not have dispatched buffer full event&quot;);
+    });
+}, &quot;resourcetimingbufferfull event should not trigger if exactly the BufferSizeLimit number of resources are added to the buffer&quot;, {timeout: 3000});
+
+promise_test(function(t) {
+    restoreEnvironmentToCleanState();
+    assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 0, &quot;context should have no resources&quot;);
+
+    performance.setResourceTimingBufferSize(3);
+
+    let bufferFullEventDispatchedCount = 0;
+    performance.onresourcetimingbufferfull = function(event) {
+        bufferFullEventDispatchedCount++;
+    };
+
+    return loadResources(5).then(function(entries) {
+        assert_equals(entries.length, 5, &quot;context should have observed 3 resources&quot;);
+        assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 3, &quot;context global buffer should be full at 3 resources&quot;);
+        assert_equals(bufferFullEventDispatchedCount, 1, &quot;context should have dispatched the buffer full event just once&quot;);
+    });
+}, &quot;resourcetimingbufferfull event should only trigger once if more than the BufferSizeLimit number of resources are added to the buffer&quot;, {timeout: 3000});
+
+promise_test(function(t) {
+    restoreEnvironmentToCleanState();
+
+    performance.setResourceTimingBufferSize(1);
+
+    let bufferFullEvent = null;
+    performance.onresourcetimingbufferfull = function(event) {
+        bufferFullEvent = event;
+    };
+
+    return loadResources(1).then(function(entries) {
+        assert_equals(entries.length, 1, &quot;context should have observed 1 resource&quot;);
+        assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 1, &quot;context global buffer should be full at 1 resource&quot;);
+        assert_equals(bufferFullEvent.target, performance, &quot;event should dispatch at the performance object&quot;);
+        assert_true(bufferFullEvent.bubbles, &quot;event should bubble&quot;);
+    });
+}, &quot;resourcetimingbufferfull event properties&quot;, {timeout: 3000});
+
+promise_test(function(t) {
+    restoreEnvironmentToCleanState();
+
+    performance.setResourceTimingBufferSize(100);
+
+    let bufferFullEventDispatched = false;
+    performance.onresourcetimingbufferfull = function(event) {
+        bufferFullEventDispatched = true;
+    };
+
+    return loadResources(3).then(function(entries) {
+        assert_equals(entries.length, 3, &quot;context should have observed 1 resource&quot;);
+        assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 3, &quot;context global buffer should be full at 3 resources&quot;);
+        assert_false(bufferFullEventDispatched, &quot;event should not have been dispatched&quot;);
+
+        let bufferFullEventDispatchedWithSizeChange = false;
+        performance.onresourcetimingbufferfull = function(event) {
+            bufferFullEventDispatchedWithSizeChange = true;
+        };
+
+        performance.setResourceTimingBufferSize(1);
+        assert_false(bufferFullEventDispatchedWithSizeChange, &quot;event should have been dispatched when size limit changed&quot;);
+        assert_equals(performance.getEntriesByType(&quot;resource&quot;).length, 3, &quot;context global buffer should still have 3 resources&quot;); 
+    });
+}, &quot;performance.setResourceTimingBufferSize set to value less than current BufferSize should not clear existing entries&quot;, {timeout: 3000});
+
+// FIXME: Clarify behavior of setResourceTimingBufferSize
+// &lt;https://github.com/w3c/resource-timing/issues/96&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtperformanceextensionsworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+
+PASS Must have PerformanceObserver and PerformanceResourceTiming in DedicatedWorkerGlobalScope 
+PASS performance.clearResourceTimings clears the buffer 
+PASS performance.clearResourceTimings called multiple times is okay 
+PASS resourcetimingbufferfull event should not trigger for a small number of resources (browser default buffer size) 
+PASS PerformanceObserver sees all resource entries even after buffer is full 
+PASS resourcetimingbufferfull event should not trigger if less than the BufferSizeLimit number of resources are added to the buffer 
+PASS resourcetimingbufferfull event should not trigger if exactly the BufferSizeLimit number of resources are added to the buffer 
+PASS resourcetimingbufferfull event should only trigger once if more than the BufferSizeLimit number of resources are added to the buffer 
+PASS resourcetimingbufferfull event properties 
+PASS performance.setResourceTimingBufferSize set to value less than current BufferSize should not clear existing entries 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtperformanceextensionsworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.html ( => )</h4>
<pre class="diff"><span>
<span class="info">Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.js
===================================================================
</span><del>--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.js                                (rev 0)
</del><ins>+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.js        2017-02-16 19:18:32 UTC (rev 212449)
</ins><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;resources/rt-utilities.js&quot;);
+
+(function() {
+    if (!testNecessaryPerformanceFeatures()) {
+        done();
+        return;
+    }
+
+    importScripts(&quot;rt-performance-extensions.js&quot;);
+
+    done();
+})();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourceerrorsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-errors-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-errors-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-errors-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+CONSOLE MESSAGE: Refused to load http://localhost:8801/resource-timing/resources/resource_timing_test0.png?csp-denied because it does not appear in the img-src directive of the Content Security Policy.
+CONSOLE MESSAGE: Origin http://localhost:8800 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Fetch API cannot load http://localhost:8801/resource-timing/resources/data.json?cors-denied. Origin http://localhost:8800 is not allowed by Access-Control-Allow-Origin.
+Resource Timing: Error cases
+
+
+PASS Content-Security-Policy rejections do not create entries 
+PASS CORS preflight failures do not create entries 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourceerrorshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-errors.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-errors.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-errors.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Error cases&lt;/title&gt;
+&lt;meta http-equiv=&quot;Content-Security-Policy&quot; content=&quot;img-src 'self'&quot;&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#resources-included&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js?pipe=sub&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Error cases&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+promise_test(function(t) {
+    let rejectedImageURL = crossOriginURL(&quot;csp-denied&quot;, &quot;resource-timing/resources/resource_timing_test0.png&quot;);
+    let allowedImageURL = uniqueImageURL(&quot;csp-allowed&quot;);
+
+    let rejectedImg = document.body.appendChild(document.createElement(&quot;img&quot;));
+    rejectedImg.src = rejectedImageURL;
+
+    let allowedImg = document.body.appendChild(document.createElement(&quot;img&quot;));
+    allowedImg.src = allowedImageURL;
+
+    return observeResources(1).then(([entry]) =&gt; {
+        checkResourceTimingEntryType(entry, {name: allowedImageURL});
+    });
+}, &quot;Content-Security-Policy rejections do not create entries&quot;);
+
+promise_test(function(t) {
+    let rejectedDataURL = crossOriginURL(&quot;cors-denied&quot;, &quot;resource-timing/resources/data.json&quot;);
+    let allowedDataURL = crossOriginURL(&quot;cors-allowed&quot;, &quot;resource-timing/resources/data.json&quot;) + &quot;&amp;pipe=header(Access-Control-Allow-Origin,*)&quot;;
+
+    fetch(rejectedDataURL);
+    fetch(allowedDataURL);
+
+    return observeResources(1).then(([entry]) =&gt; {
+        checkResourceTimingEntryType(entry, {name: allowedDataURL});
+    });
+}, &quot;CORS preflight failures do not create entries&quot;);
+
+// FIXME: Mixed content?
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourceignoredexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+Resource Timing: Ignored resources
+
+
+PASS data: URI resources do not create entries 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourceignoredhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Ignored resources&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#resources-included&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Ignored resources&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+promise_test(function(t) {
+    let ignoredImageURL = &quot;data:image/png,0&quot;;
+    let allowedImageURL = uniqueImageURL(&quot;img-allowed&quot;);
+
+    let ignoredImg = document.body.appendChild(document.createElement(&quot;img&quot;));
+    ignoredImg.src = ignoredImageURL;
+
+    let allowedImg = document.body.appendChild(document.createElement(&quot;img&quot;));
+    allowedImg.src = allowedImageURL;
+
+    return observeResources(1).then(([entry]) =&gt; {
+        checkResourceTimingEntryType(entry, {name: allowedImageURL});
+    });
+}, &quot;data: URI resources do not create entries&quot;);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourcesperframeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+Resource Timing: Entries per Frame
+
+
+PASS main frame resources differ from other frames 
+PASS iframe1 resources differ from other frames 
+PASS iframe2 resources differ from other frames 

</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourcesperframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Entries per Frame&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#processing-model&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Entries per Frame&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;iframe id=&quot;iframe1&quot; src=&quot;resources/rt-iframe-1.html&quot;&gt;&lt;/iframe&gt;
+&lt;iframe id=&quot;iframe2&quot; src=&quot;resources/rt-iframe-2.html&quot;&gt;&lt;/iframe&gt;
+&lt;script&gt;
+setup({explicit_done: true});
+
+window.addEventListener(&quot;load&quot;, function() {
+    let mainFrameWindow = window;
+    let iframe1Window = document.getElementById(&quot;iframe1&quot;).contentWindow;
+    let iframe2Window = document.getElementById(&quot;iframe2&quot;).contentWindow;
+
+    let promises = [];
+
+    mainFrameWindow.performance.clearResourceTimings();
+    promises.push(mainFrameWindow.loadResources(3));
+
+    wait(); // Ensure a DOMHighResTimeStamp change.
+
+    iframe1Window.performance.clearResourceTimings();
+    promises.push(iframe1Window.loadResources(2));
+
+    wait(); // Ensure a DOMHighResTimeStamp change.
+
+    iframe2Window.performance.clearResourceTimings();
+    promises.push(iframe2Window.loadResources(15));
+
+    Promise.all(promises).then(function() {
+        let mainFrameEntries = mainFrameWindow.performance.getEntriesByType(&quot;resource&quot;);
+        let iframe1Entries = iframe1Window.performance.getEntriesByType(&quot;resource&quot;);
+        let iframe2Entries = iframe2Window.performance.getEntriesByType(&quot;resource&quot;);
+
+        function checkContainsURL(url, list) {
+            for (let entry of list) {
+                if (entry.name === url)
+                    return true;
+            }
+            return false;
+        }
+
+        function assertDisjointEntries(list, otherList1, otherList2) {
+            for (let entry of list) {
+                assert_false(checkContainsURL(entry.name, otherList1), &quot;a resource that should have been unique was not unique across contexts&quot;);
+                assert_false(checkContainsURL(entry.name, otherList2), &quot;a resource that should have been unique was not unique across contexts&quot;);
+            }
+        }
+
+        test(function(t) {
+            assert_equals(mainFrameEntries.length, 3, &quot;window should have 3 resource entries&quot;);
+            assertDisjointEntries(mainFrameEntries, iframe1Entries, iframe2Entries);
+        }, &quot;main frame resources differ from other frames&quot;);
+
+        test(function(t) {
+            assert_equals(iframe1Entries.length, 2, &quot;iframe1 should have 2 resource entries&quot;);
+            assertDisjointEntries(iframe1Entries, mainFrameEntries, iframe2Entries);
+        }, &quot;iframe1 resources differ from other frames&quot;);
+
+        test(function(t) {
+            assert_equals(iframe2Entries.length, 15, &quot;iframe2 should have 15 resource entries&quot;);
+            assertDisjointEntries(iframe2Entries, iframe1Entries, mainFrameEntries);
+        }, &quot;iframe2 resources differ from other frames&quot;);
+
+        done();
+    });
+});
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourcesperworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+Resource Timing: Entries per Worker
+
+
+PASS Workers have PerformanceObserver and PerformanceResourceTiming 
+PASS window resources differ from other contexts 
+PASS worker1 resources differ from other contexts 
+PASS worker2 resources differ from other contexts 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtresourcesperworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Entries per Worker&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#processing-model&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Entries per Worker&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+setup({explicit_done: true});
+
+window.addEventListener(&quot;load&quot;, function() {
+    let worker1 = new Worker(&quot;resources/rt-worker-resources.js&quot;);
+    let worker2 = new Worker(&quot;resources/rt-worker-resources.js&quot;);
+
+    let worker1Entries = null;
+    let worker2Entries = null;
+
+    let promises = [];
+
+    window.performance.clearResourceTimings();
+    promises.push(window.loadResources(3));
+
+    wait(); // Ensure a DOMHighResTimeStamp change.
+
+    worker1.postMessage({n: 2});
+    promises.push(new Promise(function(resolve, reject) {
+        worker1.addEventListener(&quot;message&quot;, function(event) {
+            worker1Entries = event.data;
+            resolve();
+        });
+    }));
+
+    wait(); // Ensure a DOMHighResTimeStamp change.
+
+    worker2.postMessage({n: 15});
+    promises.push(new Promise(function(resolve, reject) {
+        worker2.addEventListener(&quot;message&quot;, function(event) {
+            worker2Entries = event.data;
+            resolve();
+        });
+    }));
+
+    Promise.all(promises).then(function() {
+        let supported = worker1Entries !== &quot;error&quot; &amp;&amp; worker2Entries !== &quot;error&quot;;
+        let windowEntries = window.performance.getEntriesByType(&quot;resource&quot;);
+
+        test(function() {
+            assert_true(supported);
+        }, &quot;Workers have PerformanceObserver and PerformanceResourceTiming&quot;);
+
+        if (!supported) {
+            done();
+            return;
+        }
+
+        function checkContainsURL(url, list) {
+            for (let entry of list) {
+                if (entry.name === url)
+                    return true;
+            }
+            return false;
+        }
+
+        function assertDisjointEntries(list, otherList1, otherList2) {
+            for (let entry of list) {
+                assert_false(checkContainsURL(entry.name, otherList1), &quot;a resource that should have been unique was not unique across contexts&quot;);
+                assert_false(checkContainsURL(entry.name, otherList2), &quot;a resource that should have been unique was not unique across contexts&quot;);
+            }
+        }
+
+        test(function(t) {
+            assert_equals(windowEntries.length, 3, &quot;window should have 3 resource entries&quot;);
+            assertDisjointEntries(windowEntries, worker1Entries, worker2Entries);
+        }, &quot;window resources differ from other contexts&quot;);
+
+        test(function(t) {
+            assert_equals(worker1Entries.length, 2, &quot;worker1 should have 2 resource entries&quot;);
+            assertDisjointEntries(worker1Entries, windowEntries, worker2Entries);
+        }, &quot;worker1 resources differ from other contexts&quot;);
+
+        test(function(t) {
+            assert_equals(worker2Entries.length, 15, &quot;worker2 should have 15 resource entries&quot;);
+            assertDisjointEntries(worker2Entries, worker1Entries, windowEntries);
+        }, &quot;worker2 resources differ from other contexts&quot;);
+
+        done();
+    });
+});
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtserializationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-serialization-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-serialization-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-serialization-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+Resource Timing: Serialization
+
+
+PASS Resource Timing - Serialization 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtserializationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-serialization.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-serialization.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-serialization.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Serialization&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;http://yoavweiss.github.io/resource-timing/#performanceresourcetiming&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Serialization&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+test(function(t) {
+    assert_true(typeof PerformanceResourceTiming.prototype.toJSON === &quot;function&quot;, &quot;PerformanceResourceTiming has toJSON serializer&quot;);
+
+    let entries = performance.getEntriesByType(&quot;resource&quot;);
+    let serializedEntries = JSON.parse(JSON.stringify(entries));
+
+    assert_true(serializedEntries instanceof Array, &quot;JSON.stringify and JSON.parse should have produced an object&quot;);
+    assert_greater_than_equal(serializedEntries.length, 2, &quot;serialization should have serialized all entries&quot;);
+
+    let entry = entries[0];
+    let serializedEntry = serializedEntries[0];
+
+    let properties = new Map([
+        [&quot;name&quot;, &quot;string&quot;],
+        [&quot;entryType&quot;, &quot;string&quot;],
+        [&quot;startTime&quot;, &quot;number&quot;],
+        [&quot;duration&quot;, &quot;number&quot;],
+        [&quot;initiatorType&quot;, &quot;string&quot;],
+        [&quot;nextHopProtocol&quot;, &quot;string&quot;],
+        [&quot;workerStart&quot;, &quot;number&quot;],
+        [&quot;redirectStart&quot;, &quot;number&quot;],
+        [&quot;redirectEnd&quot;, &quot;number&quot;],
+        [&quot;fetchStart&quot;, &quot;number&quot;],
+        [&quot;domainLookupStart&quot;, &quot;number&quot;],
+        [&quot;domainLookupEnd&quot;, &quot;number&quot;],
+        [&quot;connectStart&quot;, &quot;number&quot;],
+        [&quot;connectEnd&quot;, &quot;number&quot;],
+        [&quot;secureConnectionStart&quot;, &quot;number&quot;],
+        [&quot;requestStart&quot;, &quot;number&quot;],
+        [&quot;responseStart&quot;, &quot;number&quot;],
+        [&quot;responseEnd&quot;, &quot;number&quot;],
+        [&quot;transferSize&quot;, &quot;number&quot;],
+        [&quot;encodedBodySize&quot;, &quot;number&quot;],
+        [&quot;decodedBodySize&quot;, &quot;number&quot;],
+    ]);
+
+    let count = 0;
+    for (let [property, type] of properties) {
+        if (property in entry) {
+            assert_true(property in serializedEntry, `readonly property '${property}' should have been serialized`);
+            assert_equals(typeof serializedEntry[property], type, `property '${property}' had unexpected serialized type`);
+            count++;
+        }
+    }
+
+    assert_true(count &gt;= 7, &quot;more properties should have been serialized&quot;);
+});
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtsharedresourceinframesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+Resource Timing: Shared Entry has Distinct Entry per Frame
+
+
+PASS main frame has shared resource entry 
+PASS iframe1 has shared resource entry 
+PASS iframe2 has shared resource entry 

</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtsharedresourceinframeshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Shared Entry has Distinct Entry per Frame&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#processing-model&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Shared Entry has Distinct Entry per Frame&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;iframe id=&quot;iframe1&quot; src=&quot;resources/rt-iframe-1.html&quot;&gt;&lt;/iframe&gt;
+&lt;iframe id=&quot;iframe2&quot; src=&quot;resources/rt-iframe-2.html&quot;&gt;&lt;/iframe&gt;
+&lt;script&gt;
+setup({explicit_done: true});
+
+window.addEventListener(&quot;load&quot;, function() {
+    let mainFrameWindow = window;
+    let iframe1Window = document.getElementById(&quot;iframe1&quot;).contentWindow;
+    let iframe2Window = document.getElementById(&quot;iframe2&quot;).contentWindow;
+
+    let promises = [];
+    let sharedResourceURL = uniqueImageURL(&quot;shared&quot;);
+
+    mainFrameWindow.performance.clearResourceTimings();
+    promises.push(mainFrameWindow.fetch(sharedResourceURL));
+
+    wait(); // Ensure a DOMHighResTimeStamp change.
+
+    iframe1Window.performance.clearResourceTimings();
+    promises.push(iframe1Window.fetch(sharedResourceURL));
+
+    wait(); // Ensure a DOMHighResTimeStamp change.
+
+    iframe2Window.performance.clearResourceTimings();
+    promises.push(iframe2Window.fetch(sharedResourceURL));
+
+    Promise.all(promises).then(function() {
+        let mainFrameEntries = mainFrameWindow.performance.getEntriesByType(&quot;resource&quot;);
+        let iframe1Entries = iframe1Window.performance.getEntriesByType(&quot;resource&quot;);
+        let iframe2Entries = iframe2Window.performance.getEntriesByType(&quot;resource&quot;);
+
+        function checkContainsURL(url, list) {
+            for (let entry of list) {
+                if (entry.name === url)
+                    return true;
+            }
+            return false;
+        }
+
+        function assertSharedEntryIsDifferent(sharedEntry, list) {
+            for (let entry of list) {
+                if (entry.name === sharedResourceURL) {
+                    assert_not_equals(sharedEntry.startTime, entry.startTime, &quot;shared entry should be different between contexts&quot;);
+                    return;
+                }
+            }
+        }
+
+        test(function(t) {
+            assert_true(checkContainsURL(sharedResourceURL, mainFrameEntries), &quot;main frame should have an entry for the shared resource&quot;);
+            assert_equals(mainFrameEntries.length, 1, &quot;window should have 1 resource entry&quot;);
+            assertSharedEntryIsDifferent(mainFrameEntries[0], iframe1Entries);
+            assertSharedEntryIsDifferent(mainFrameEntries[0], iframe2Entries);
+        }, &quot;main frame has shared resource entry&quot;);
+
+        test(function(t) {
+            assert_true(checkContainsURL(sharedResourceURL, iframe1Entries), &quot;iframe1 should have an entry for the shared resource&quot;);
+            assert_equals(iframe1Entries.length, 1, &quot;iframe1 should have 1 resource entry&quot;);
+            assertSharedEntryIsDifferent(iframe1Entries[0], mainFrameEntries);
+            assertSharedEntryIsDifferent(iframe1Entries[0], iframe2Entries);
+        }, &quot;iframe1 has shared resource entry&quot;);
+
+        test(function(t) {
+            assert_true(checkContainsURL(sharedResourceURL, iframe2Entries), &quot;iframe2 should have an entry for the shared resource&quot;);
+            assert_equals(iframe2Entries.length, 1, &quot;iframe2 should have 1 resource entry&quot;);
+            assertSharedEntryIsDifferent(iframe2Entries[0], iframe1Entries);
+            assertSharedEntryIsDifferent(iframe2Entries[0], mainFrameEntries);
+        }, &quot;iframe2 has shared resource entry&quot;);
+
+        done();
+    });
+});
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtsharedresourceinworkersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+Resource Timing: Entries per Worker
+
+
+PASS Workers have PerformanceObserver and PerformanceResourceTiming 
+PASS window has shared entry 
+PASS worker1 has shared entry 
+PASS worker2 has shared entry 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsresourcetimingrtsharedresourceinworkershtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Resource Timing - Entries per Worker&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;JosephPecoraro&quot; href=&quot;mailto:joepeck@webkit.org&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/resource-timing/#processing-model&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/rt-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;h1&gt;Resource Timing: Entries per Worker&lt;/h1&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+setup({explicit_done: true});
+
+window.addEventListener(&quot;load&quot;, function() {
+    let worker1 = new Worker(&quot;resources/rt-worker-resources.js&quot;);
+    let worker2 = new Worker(&quot;resources/rt-worker-resources.js&quot;);
+
+    let worker1Entries = null;
+    let worker2Entries = null;
+
+    let promises = [];
+    let sharedResourceURL = uniqueImageURL(&quot;shared&quot;);
+
+    window.performance.clearResourceTimings();
+    promises.push(window.fetch(sharedResourceURL));
+
+    wait(); // Ensure a DOMHighResTimeStamp change.
+
+    worker1.postMessage({sharedResourceURL});
+    promises.push(new Promise(function(resolve, reject) {
+        worker1.addEventListener(&quot;message&quot;, function(event) {
+            worker1Entries = event.data;
+            resolve();
+        });
+    }));
+
+    worker2.postMessage({sharedResourceURL});
+    promises.push(new Promise(function(resolve, reject) {
+        worker2.addEventListener(&quot;message&quot;, function(event) {
+            worker2Entries = event.data;
+            resolve();
+        });
+    }));
+
+    Promise.all(promises).then(function() {
+        let supported = worker1Entries !== &quot;error&quot; &amp;&amp; worker2Entries !== &quot;error&quot;;
+        let windowEntries = window.performance.getEntriesByType(&quot;resource&quot;);
+
+        test(function() {
+            assert_true(supported);
+        }, &quot;Workers have PerformanceObserver and PerformanceResourceTiming&quot;);
+
+        if (!supported) {
+            done();
+            return;
+        }
+
+        function checkContainsURL(url, list) {
+            for (let entry of list) {
+                if (entry.name === url)
+                    return true;
+            }
+            return false;
+        }
+
+        function assertSharedEntryIsDifferent(sharedEntry, list) {
+            for (let entry of list) {
+                if (entry.name === sharedResourceURL) {
+                    assert_not_equals(sharedEntry.startTime, entry.startTime, &quot;shared entry should be different between contexts&quot;);
+                    return;
+                }
+            }
+        }
+
+        test(function(t) {
+            assert_true(checkContainsURL(sharedResourceURL, windowEntries), &quot;window should have an entry for the shared resource&quot;);
+            assert_equals(windowEntries.length, 1, &quot;window should have 1 resource entry&quot;);
+            assertSharedEntryIsDifferent(windowEntries[0], worker1Entries);
+            assertSharedEntryIsDifferent(windowEntries[0], worker2Entries);
+        }, &quot;window has shared entry&quot;);
+
+        test(function(t) {
+            assert_true(checkContainsURL(sharedResourceURL, worker1Entries), &quot;worker1 should have an entry for the shared resource&quot;);
+            assert_equals(worker1Entries.length, 1, &quot;worker1 should have 1 resource entry&quot;);
+        }, &quot;worker1 has shared entry&quot;);
+
+        test(function(t) {
+            assert_true(checkContainsURL(sharedResourceURL, worker2Entries), &quot;worker2 should have an entry for the shared resource&quot;);
+            assert_equals(worker2Entries.length, 1, &quot;worker2 should have 1 resource entry&quot;);
+        }, &quot;worker2 has shared entry&quot;);
+
+        done();
+    });
+});
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Index: trunk/LayoutTests/imported/w3c/web-platform-tests/serve
</span><span class="cx">===================================================================
</span><del>--- trunk/LayoutTests/imported/w3c/web-platform-tests/serve        2017-02-16 18:49:40 UTC (rev 212448)
</del><ins>+++ trunk/LayoutTests/imported/w3c/web-platform-tests/serve        2017-02-16 19:18:32 UTC (rev 212449)
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserve"></a>
<div class="propset"><h4>Property changes: trunk/LayoutTests/imported/w3c/web-platform-tests/serve</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<ins>+*
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsjsdomglobalconstructorsattributesdedicatedworkerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -224,6 +224,11 @@
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserverEntryList').hasOwnProperty('set') is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserverEntryList').enumerable is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserverEntryList').configurable is true
</span><ins>+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceResourceTiming').value is PerformanceResourceTiming
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceResourceTiming').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceResourceTiming').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceResourceTiming').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceResourceTiming').configurable is true
</ins><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ProgressEvent').value is ProgressEvent
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ProgressEvent').hasOwnProperty('get') is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ProgressEvent').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsperformanceapiresourcetimingapisexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/resource-timing-apis-expected.txt (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/resource-timing-apis-expected.txt                                (rev 0)
+++ trunk/LayoutTests/performance-api/resource-timing-apis-expected.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+Basic Interface test for resource-timing APIs.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PerformanceResourceTiming
+PASS PerformanceResourceTiming is defined.
+PASS &quot;initiatorType&quot; in PerformanceResourceTiming.prototype is true
+FAIL &quot;nextHopProtocol&quot; in PerformanceResourceTiming.prototype should be true. Was false.
+PASS &quot;workerStart&quot; in PerformanceResourceTiming.prototype is true
+PASS &quot;redirectStart&quot; in PerformanceResourceTiming.prototype is true
+PASS &quot;redirectEnd&quot; in PerformanceResourceTiming.prototype is true
+PASS &quot;fetchStart&quot; in PerformanceResourceTiming.prototype is true
+PASS &quot;domainLookupStart&quot; in PerformanceResourceTiming.prototype is true
+PASS &quot;domainLookupEnd&quot; in PerformanceResourceTiming.prototype is true
+PASS &quot;connectStart&quot; in PerformanceResourceTiming.prototype is true
+PASS &quot;connectEnd&quot; in PerformanceResourceTiming.prototype is true
+PASS &quot;secureConnectionStart&quot; in PerformanceResourceTiming.prototype is true
+PASS &quot;requestStart&quot; in PerformanceResourceTiming.prototype is true
+PASS &quot;responseStart&quot; in PerformanceResourceTiming.prototype is true
+PASS &quot;responseEnd&quot; in PerformanceResourceTiming.prototype is true
+FAIL &quot;transferSize&quot; in PerformanceResourceTiming.prototype should be true. Was false.
+FAIL &quot;encodedBodySize&quot; in PerformanceResourceTiming.prototype should be true. Was false.
+FAIL &quot;decodedBodySize&quot; in PerformanceResourceTiming.prototype should be true. Was false.
+PASS PerformanceResourceTiming.prototype.toJSON is defined.
+PASS new PerformanceResourceTiming() threw exception TypeError: function is not a constructor (evaluating 'new PerformanceResourceTiming()').
+
+Performance extensions
+PASS Performance.prototype.clearResourceTimings is defined.
+PASS Performance.prototype.setResourceTimingBufferSize is defined.
+PASS performance.onresourcetimingbufferfull is defined.
+PASS performance.clearResourceTimings() did not throw exception.
+PASS performance.setResourceTimingBufferSize() threw exception TypeError: Not enough arguments.
+PASS performance.setResourceTimingBufferSize(100) did not throw exception.
+
+Starting worker: resources/resource-timing-api.js
+[Worker] PerformanceResourceTiming
+PASS [Worker] PerformanceResourceTiming is defined.
+PASS [Worker] &quot;initiatorType&quot; in PerformanceResourceTiming.prototype is true
+FAIL [Worker] &quot;nextHopProtocol&quot; in PerformanceResourceTiming.prototype should be true. Was false.
+PASS [Worker] &quot;workerStart&quot; in PerformanceResourceTiming.prototype is true
+PASS [Worker] &quot;redirectStart&quot; in PerformanceResourceTiming.prototype is true
+PASS [Worker] &quot;redirectEnd&quot; in PerformanceResourceTiming.prototype is true
+PASS [Worker] &quot;fetchStart&quot; in PerformanceResourceTiming.prototype is true
+PASS [Worker] &quot;domainLookupStart&quot; in PerformanceResourceTiming.prototype is true
+PASS [Worker] &quot;domainLookupEnd&quot; in PerformanceResourceTiming.prototype is true
+PASS [Worker] &quot;connectStart&quot; in PerformanceResourceTiming.prototype is true
+PASS [Worker] &quot;connectEnd&quot; in PerformanceResourceTiming.prototype is true
+PASS [Worker] &quot;secureConnectionStart&quot; in PerformanceResourceTiming.prototype is true
+PASS [Worker] &quot;requestStart&quot; in PerformanceResourceTiming.prototype is true
+PASS [Worker] &quot;responseStart&quot; in PerformanceResourceTiming.prototype is true
+PASS [Worker] &quot;responseEnd&quot; in PerformanceResourceTiming.prototype is true
+FAIL [Worker] &quot;transferSize&quot; in PerformanceResourceTiming.prototype should be true. Was false.
+FAIL [Worker] &quot;encodedBodySize&quot; in PerformanceResourceTiming.prototype should be true. Was false.
+FAIL [Worker] &quot;decodedBodySize&quot; in PerformanceResourceTiming.prototype should be true. Was false.
+PASS [Worker] PerformanceResourceTiming.prototype.toJSON is defined.
+PASS [Worker] new PerformanceResourceTiming() threw exception TypeError: function is not a constructor (evaluating 'new PerformanceResourceTiming()').
+[Worker] 
+[Worker] Performance extensions
+PASS [Worker] Performance.prototype.clearResourceTimings is defined.
+PASS [Worker] Performance.prototype.setResourceTimingBufferSize is defined.
+PASS [Worker] performance.onresourcetimingbufferfull is defined.
+PASS [Worker] performance.clearResourceTimings() did not throw exception.
+PASS [Worker] performance.setResourceTimingBufferSize() threw exception TypeError: Not enough arguments.
+PASS [Worker] performance.setResourceTimingBufferSize(100) did not throw exception.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiresourcetimingapishtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/resource-timing-apis.html (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/resource-timing-apis.html                                (rev 0)
+++ trunk/LayoutTests/performance-api/resource-timing-apis.html        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/resource-timing-api.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+debug(&quot;&quot;);
+let worker = startWorker(&quot;resources/resource-timing-api.js&quot;);
+&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiresourcesresourcetimingapijs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/resources/resource-timing-api.js (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/resources/resource-timing-api.js                                (rev 0)
+++ trunk/LayoutTests/performance-api/resources/resource-timing-api.js        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+if (self.importScripts)
+    importScripts(&quot;../../resources/js-test-pre.js&quot;);
+
+if (self.window)
+    description(&quot;Basic Interface test for resource-timing APIs.&quot;);
+
+debug(&quot;PerformanceResourceTiming&quot;);
+shouldBeDefined(&quot;PerformanceResourceTiming&quot;);
+shouldBeTrue(`&quot;initiatorType&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;nextHopProtocol&quot; in PerformanceResourceTiming.prototype`); // Not yet implemented.
+shouldBeTrue(`&quot;workerStart&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;redirectStart&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;redirectEnd&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;fetchStart&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;domainLookupStart&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;domainLookupEnd&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;connectStart&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;connectEnd&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;secureConnectionStart&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;requestStart&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;responseStart&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;responseEnd&quot; in PerformanceResourceTiming.prototype`);
+shouldBeTrue(`&quot;transferSize&quot; in PerformanceResourceTiming.prototype`); // Unimplemented.
+shouldBeTrue(`&quot;encodedBodySize&quot; in PerformanceResourceTiming.prototype`); // Unimplemented.
+shouldBeTrue(`&quot;decodedBodySize&quot; in PerformanceResourceTiming.prototype`); // Unimplemented.
+shouldBeDefined(`PerformanceResourceTiming.prototype.toJSON`);
+shouldThrow(`new PerformanceResourceTiming()`);
+
+debug(&quot;&quot;);
+debug(&quot;Performance extensions&quot;);
+shouldBeDefined(`Performance.prototype.clearResourceTimings`);
+shouldBeDefined(`Performance.prototype.setResourceTimingBufferSize`);
+shouldBeDefined(`performance.onresourcetimingbufferfull`);
+shouldNotThrow(`performance.clearResourceTimings()`);
+shouldThrow(`performance.setResourceTimingBufferSize()`);
+shouldNotThrow(`performance.setResourceTimingBufferSize(100)`);
+
+if (self.importScripts)
+    finishJSTest();
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -1527,3 +1527,6 @@
</span><span class="cx"> [ Debug ] fast/frames/exponential-frames.html [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/167975 imported/w3c/web-platform-tests/media-source/SourceBuffer-abort-removed.html [ Pass Failure ]
</span><ins>+
+webkit.org/b/168415 [ ElCapitan ] imported/w3c/web-platform-tests/resource-timing/rt-cors.html [ Skip ]
+webkit.org/b/168415 [ ElCapitan ] imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.html [ Skip ]
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/CMakeLists.txt        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -1883,6 +1883,7 @@
</span><span class="cx">     loader/ResourceLoadStatistics.cpp
</span><span class="cx">     loader/ResourceLoadStatisticsStore.cpp
</span><span class="cx">     loader/ResourceLoader.cpp
</span><ins>+    loader/ResourceTiming.cpp
</ins><span class="cx">     loader/ResourceTimingInformation.cpp
</span><span class="cx">     loader/SinkDocument.cpp
</span><span class="cx">     loader/SubframeLoader.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/ChangeLog        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -1,3 +1,187 @@
</span><ins>+2017-02-16  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        [Resource Timing] Support Resource Timing in Workers
+        https://bugs.webkit.org/show_bug.cgi?id=168086
+        &lt;rdar://problem/30430117&gt;
+
+        Reviewed by Alex Christensen.
+
+        Worker's load resources through the Document that loaded them. However,
+        their PerformanceResourceTiming entries should be added to the Performance
+        object inside the Worker context, not the Document's context.
+
+        This change adds an InitiatorContext to ResourceLoadOptions so that loaders
+        can determine if the load was initiated by the Document or a Worker. This
+        allows loaders to then know if the ResourceTiming data they collect should
+        be added to the Document's Performance object or forwarded on to the Worker's.
+
+        This adds a new ThreadableLoaderClient method intended only for the purpose
+        of adding the ResourceTiming information to the Worker's Performance object.
+        Unlike other ThreadableLoaderClient methods that are bridged and forwarded
+        on to a client inside the worker (e.g. XMLHttpRequest or FetchLoader) this
+        method never needs to be handled by clients and can be uniformly handled by
+        the WorkerThreadableLoader itself.
+
+        We also add a new ResourceTiming object that encapsulates all of the data
+        ultimately needed for a PerformanceResourceTimingEntry object. This allows
+        for all of the information to be gathered while loading on the Document
+        before serializing across to the Worker. That includes the Timing-Allow-Origin
+        check which uses the SecurityOrigin of the Worker.
+
+        This also modernizes and addresses issues in the Resource Timing implementation.
+        Better handling cases like loading from the Cache, Synchronous Loads, and
+        improving initiatorType information.
+
+        Tests: imported/w3c/web-platform-tests/resource-timing/rt-cors.html
+               imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.html
+               imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css.html
+               imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element.html
+               imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.html
+               imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media.html
+               imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other.html
+               imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module.html
+               imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html
+               imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.html
+               imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.html
+               imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.html
+               imported/w3c/web-platform-tests/resource-timing/rt-resource-errors.html
+               imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored.html
+               imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame.html
+               imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker.html
+               imported/w3c/web-platform-tests/resource-timing/rt-serialization.html
+               imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames.html
+               imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers.html
+               performance-api/resource-timing-apis.html
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        New files.
+
+        * platform/network/NetworkLoadTiming.h:
+        (WebCore::NetworkLoadTiming::reset): Deleted.
+        We no longer need to reset.
+
+        * loader/ResourceTiming.cpp: Added.
+        (WebCore::passesTimingAllowCheck):
+        (WebCore::ResourceTiming::fromCache):
+        (WebCore::ResourceTiming::fromLoad):
+        (WebCore::ResourceTiming::fromSynchronousLoad):
+        (WebCore::ResourceTiming::ResourceTiming):
+        (WebCore::ResourceTiming::isolatedCopy):
+        * loader/ResourceTiming.h: Added.
+        (WebCore::ResourceTiming::url):
+        (WebCore::ResourceTiming::initiator):
+        (WebCore::ResourceTiming::loadTiming):
+        (WebCore::ResourceTiming::networkLoadTiming):
+        (WebCore::ResourceTiming::allowTimingDetails):
+        (WebCore::ResourceTiming::overrideInitiatorName):
+        (WebCore::ResourceTiming::ResourceTiming):
+        Class that encapsulates all of the data needed for a PerformanceResourceTiming entry.
+        There are three static constructors indicating the different ways this object can
+        be constructed and the different data available at the time of construction.
+
+        * loader/ResourceLoaderOptions.h:
+        Add the new InitiatorContext, default to Document.
+
+        * loader/ThreadableLoaderClient.h:
+        (WebCore::ThreadableLoaderClient::didFinishTiming):
+        New client method only used by WorkerThreadableLoader.
+
+        * loader/WorkerThreadableLoader.h:
+        * loader/WorkerThreadableLoader.cpp:
+        (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
+        (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
+        All loads initiated in a WorkerThreadableLoader get identified as InitiatorContext::Worker.
+        Add timing information to the Performance object when received. No need to inform clients.
+
+        * loader/DocumentThreadableLoader.h:
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
+        (WebCore::DocumentThreadableLoader::loadRequest):
+        Provide APIs to pass timing data on to a WorkerThreadableLoader.
+        Create ResourceTiming data for synchronous loads.
+
+        * loader/LoadTiming.h:
+        * loader/LoadTiming.cpp:
+        (WebCore::LoadTiming::isolatedCopy):
+        Add isolatedCopy to allow this data to be passed across to a Worker.
+
+        * loader/ResourceTimingInformation.h:
+        * loader/ResourceTimingInformation.cpp:
+        (WebCore::ResourceTimingInformation::shouldAddResourceTiming):
+        (WebCore::ResourceTimingInformation::addResourceTiming):
+        (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation):
+        Refactor to remove unused / unnecessary bits. Extract out some helpful code.
+        Changed this to match when Blink decides when to add or ignore entries, however
+        this may change over time.
+
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::didFinishLoading):
+        (WebCore::SubresourceLoader::notifyDone):
+        (WebCore::SubresourceLoader::reportResourceTiming):
+        * loader/SubresourceLoader.h:
+        * loader/cache/CachedRawResource.cpp:
+        (WebCore::CachedRawResource::finishedTimingForWorkerLoad):
+        * loader/cache/CachedRawResource.h:
+        * loader/cache/CachedRawResourceClient.h:
+        (WebCore::CachedRawResourceClient::finishedTimingForWorkerLoad):
+        Plumbing to report timing information to Worker if this resource was loaded for a Worker.
+
+        * loader/cache/CachedResource.cpp:
+        (WebCore::CachedResource::CachedResource):
+        * loader/cache/CachedResource.h:
+        (WebCore::CachedResource::initiatorName):
+        Store the initiator name on the CachedResource like other data added to the original
+        CachedResourceRequest. This is a bit of a hack but follows an existing pattern, and
+        cleans up other hacks that worked around this later on.
+
+        * loader/cache/CachedResourceLoader.h:
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::requestResource):
+        (WebCore::CachedResourceLoader::revalidateResource):
+        (WebCore::CachedResourceLoader::loadResource):
+        Simply the creation of a ResourceTiming object for cache hits.
+        Report timing information to Worker if this resource was loaded for a Worker.
+
+        (WebCore::CachedResourceLoader::loadDone):
+        Eliminate this redundant point attempting to add a ResourceTiming entry.
+
+        * loader/cache/CachedResourceRequest.cpp:
+        (WebCore::CachedResourceRequest::initiatorName):
+        Update to match the spec. The fallback is &quot;other&quot;.
+
+        * page/Performance.h:
+        * page/Performance.cpp:
+        (WebCore::Performance::setResourceTimingBufferSize):
+        (WebCore::Performance::addResourceTiming):
+        Update to support PerformanceObservers.
+        Update to match spec (event should bubble).
+
+        * page/PerformanceResourceTiming.h:
+        * page/PerformanceResourceTiming.cpp:
+        (WebCore::PerformanceResourceTiming::create):
+        (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
+        (WebCore::PerformanceResourceTiming::fetchStart):
+        (WebCore::PerformanceResourceTiming::domainLookupStart):
+        (WebCore::PerformanceResourceTiming::domainLookupEnd):
+        (WebCore::PerformanceResourceTiming::connectStart):
+        (WebCore::PerformanceResourceTiming::connectEnd):
+        (WebCore::PerformanceResourceTiming::secureConnectionStart):
+        (WebCore::PerformanceResourceTiming::requestStart):
+        (WebCore::PerformanceResourceTiming::responseStart):
+        (WebCore::PerformanceResourceTiming::responseEnd):
+        (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
+        Construct with a ResourceTiming object containing all the data we need for the entry.
+        Update to match spec for what is required, should fallback, should be zero, etc.
+
+        (WebCore::passesTimingAllowCheck): Deleted.
+        Extracted this to ResourceTiming creation time in the loading context,
+        since this can't be determined on the Worker context without also having
+        all of the header information from each resource response.
+
+        * page/PerformanceResourceTiming.idl:
+        Expose to Workers!
+
</ins><span class="cx"> 2017-02-16  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [JSC] Drop PassRefPtr in inspector/
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -4118,6 +4118,8 @@
</span><span class="cx">                 A5A9934D1E3809D7005B5E4D /* JSPerformanceObserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5A993421E380999005B5E4D /* JSPerformanceObserver.cpp */; };
</span><span class="cx">                 A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5AFB34D115151A700B045CB /* StepRange.cpp */; };
</span><span class="cx">                 A5AFB350115151A700B045CB /* StepRange.h in Headers */ = {isa = PBXBuildFile; fileRef = A5AFB34E115151A700B045CB /* StepRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                A5CE9F3F1E4C4174001BBE7C /* ResourceTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = A5CE9F3C1E4BC586001BBE7C /* ResourceTiming.h */; };
+                A5CE9F401E4C4178001BBE7C /* ResourceTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5CE9F3E1E4C416B001BBE7C /* ResourceTiming.cpp */; };
</ins><span class="cx">                 A5DEBDA316FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */; };
</span><span class="cx">                 A5DEBDA416FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */; };
</span><span class="cx">                 A5E2123B1E4924A100CE1044 /* WebHeapAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5E212391E49249200CE1044 /* WebHeapAgent.cpp */; };
</span><span class="lines">@@ -11930,6 +11932,8 @@
</span><span class="cx">                 A5AFB34E115151A700B045CB /* StepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StepRange.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyEventCocoa.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KeyEventCocoa.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A5CE9F3C1E4BC586001BBE7C /* ResourceTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceTiming.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5CE9F3E1E4C416B001BBE7C /* ResourceTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceTiming.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitPlaybackTargetAvailabilityEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitPlaybackTargetAvailabilityEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5DEBDA116FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitPlaybackTargetAvailabilityEvent.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16828,8 +16832,8 @@
</span><span class="cx">                                 415080341E3F00AA0051D75D /* LibWebRTCAudioModule.cpp */,
</span><span class="cx">                                 415080351E3F00AA0051D75D /* LibWebRTCAudioModule.h */,
</span><span class="cx">                                 415747431E38699E00E914D8 /* LibWebRTCMacros.h */,
</span><ins>+                                41A1B00D1E52656E007F3769 /* LibWebRTCProvider.cpp */,
</ins><span class="cx">                                 415747441E38699E00E914D8 /* LibWebRTCProvider.h */,
</span><del>-                                41A1B00D1E52656E007F3769 /* LibWebRTCProvider.cpp */,
</del><span class="cx">                         );
</span><span class="cx">                         name = libwebrtc;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -19960,8 +19964,6 @@
</span><span class="cx">                 A148328B187F506800DA63A6 /* wak */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                ECCDB8861E4BB63F00A1AEA6 /* WKGraphicsInternal.h */,
-                                ECCDB8801E4B8C5900A1AEA6 /* WKContentObservationInternal.h */,
</del><span class="cx">                                 FE69986F192087E7006936BD /* FloatingPointEnvironment.cpp */,
</span><span class="cx">                                 FE699870192087E7006936BD /* FloatingPointEnvironment.h */,
</span><span class="cx">                                 A148328C187F508700DA63A6 /* WAKAppKitStubs.h */,
</span><span class="lines">@@ -19987,8 +19989,10 @@
</span><span class="cx">                                 A14832A1187F508700DA63A6 /* WebCoreThreadSystemInterface.h */,
</span><span class="cx">                                 A14832A2187F508700DA63A6 /* WKContentObservation.cpp */,
</span><span class="cx">                                 A14832A3187F508700DA63A6 /* WKContentObservation.h */,
</span><ins>+                                ECCDB8801E4B8C5900A1AEA6 /* WKContentObservationInternal.h */,
</ins><span class="cx">                                 A14832A4187F508700DA63A6 /* WKGraphics.h */,
</span><span class="cx">                                 A14832A5187F508700DA63A6 /* WKGraphics.mm */,
</span><ins>+                                ECCDB8861E4BB63F00A1AEA6 /* WKGraphicsInternal.h */,
</ins><span class="cx">                                 A14832A6187F508700DA63A6 /* WKTypes.h */,
</span><span class="cx">                                 A14832A7187F508700DA63A6 /* WKUtilities.c */,
</span><span class="cx">                                 A14832A8187F508700DA63A6 /* WKUtilities.h */,
</span><span class="lines">@@ -21994,8 +21998,6 @@
</span><span class="cx">                 B2A015910AF6CD53006BCE0E /* graphics */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                C2F4E7881E45AEDF006D7105 /* ComplexTextController.cpp */,
-                                C2F4E7891E45AEDF006D7105 /* ComplexTextController.h */,
</del><span class="cx">                                 076F0D0812B8192700C26AA4 /* avfoundation */,
</span><span class="cx">                                 499B3EC0128CCC1800E726C2 /* ca */,
</span><span class="cx">                                 B27535290B053814002CE64F /* cg */,
</span><span class="lines">@@ -22019,6 +22021,8 @@
</span><span class="cx">                                 B27535390B053814002CE64F /* Color.h */,
</span><span class="cx">                                 3103B7DE1DB01556008BB890 /* ColorHash.h */,
</span><span class="cx">                                 9382DF5710A8D5C900925652 /* ColorSpace.h */,
</span><ins>+                                C2F4E7881E45AEDF006D7105 /* ComplexTextController.cpp */,
+                                C2F4E7891E45AEDF006D7105 /* ComplexTextController.h */,
</ins><span class="cx">                                 2D2FC0541460CD6F00263633 /* CrossfadeGeneratedImage.cpp */,
</span><span class="cx">                                 2D2FC0551460CD6F00263633 /* CrossfadeGeneratedImage.h */,
</span><span class="cx">                                 A8CB41020E85B8A50032C4F0 /* DashArray.h */,
</span><span class="lines">@@ -22782,6 +22786,8 @@
</span><span class="cx">                                 7A929CA21C598378004DF226 /* ResourceLoadStatistics.h */,
</span><span class="cx">                                 7A7CC8361C87506800366243 /* ResourceLoadStatisticsStore.cpp */,
</span><span class="cx">                                 7A7CC8371C87506800366243 /* ResourceLoadStatisticsStore.h */,
</span><ins>+                                A5CE9F3E1E4C416B001BBE7C /* ResourceTiming.cpp */,
+                                A5CE9F3C1E4BC586001BBE7C /* ResourceTiming.h */,
</ins><span class="cx">                                 CBC2D22D1CE5B77400D1880B /* ResourceTimingInformation.cpp */,
</span><span class="cx">                                 CBC2D22E1CE5B77D00D1880B /* ResourceTimingInformation.h */,
</span><span class="cx">                                 51327D5F11A33A2B004F9D65 /* SinkDocument.cpp */,
</span><span class="lines">@@ -25254,7 +25260,6 @@
</span><span class="cx">                                 FD31603E12B0267600C1A359 /* AnalyserNode.h in Headers */,
</span><span class="cx">                                 31A795C71888BCB200382F90 /* ANGLEInstancedArrays.h in Headers */,
</span><span class="cx">                                 490707E71219C04300D90E51 /* ANGLEWebKitBridge.h in Headers */,
</span><del>-                                C2F4E78C1E45C3EF006D7105 /* ComplexTextController.h in Headers */,
</del><span class="cx">                                 49E912AB0EFAC906009D0CAF /* Animation.h in Headers */,
</span><span class="cx">                                 316FE1120E6E1DA700BF6088 /* AnimationBase.h in Headers */,
</span><span class="cx">                                 319848011A1D817B00A13318 /* AnimationEvent.h in Headers */,
</span><span class="lines">@@ -25373,7 +25378,6 @@
</span><span class="cx">                                 379E61CA126CA5C400B63E8D /* BaseButtonInputType.h in Headers */,
</span><span class="cx">                                 379E61CC126CA5C400B63E8D /* BaseCheckableInputType.h in Headers */,
</span><span class="cx">                                 F5E0C65C1643C42C00D6CB69 /* BaseChooserOnlyDateAndTimeInputType.h in Headers */,
</span><del>-                                7C8E34C01E4A33B00054CE23 /* JSDOMConvertSequences.h in Headers */,
</del><span class="cx">                                 C33EE5C514FB49610002095A /* BaseClickableWithKeyInputType.h in Headers */,
</span><span class="cx">                                 F59C96001255B23F000623C0 /* BaseDateAndTimeInputType.h in Headers */,
</span><span class="cx">                                 F55B3DAE1251F12D003EF269 /* BaseTextInputType.h in Headers */,
</span><span class="lines">@@ -25518,6 +25522,7 @@
</span><span class="cx">                                 E1FE137518402A6700892F13 /* CommonCryptoUtilities.h in Headers */,
</span><span class="cx">                                 0F60F32B1DFBB10700416D6C /* CommonVM.h in Headers */,
</span><span class="cx">                                 7C93F34A1AA6BA5E00A98BAB /* CompiledContentExtension.h in Headers */,
</span><ins>+                                C2F4E78C1E45C3EF006D7105 /* ComplexTextController.h in Headers */,
</ins><span class="cx">                                 E4BA50901BCFBD9500E34EF7 /* ComposedTreeAncestorIterator.h in Headers */,
</span><span class="cx">                                 E44FA1851BCA6B5A0091B6EF /* ComposedTreeIterator.h in Headers */,
</span><span class="cx">                                 316FE1160E6E1DA700BF6088 /* CompositeAnimation.h in Headers */,
</span><span class="lines">@@ -25619,7 +25624,6 @@
</span><span class="cx">                                 E19AC3F51824DC7900349426 /* CryptoAlgorithmSHA512.h in Headers */,
</span><span class="cx">                                 E157A8E518173A3A009F821D /* CryptoKey.h in Headers */,
</span><span class="cx">                                 E125F84E1824289D00D84CD9 /* CryptoKeyAES.h in Headers */,
</span><del>-                                7C8E34B81E4A33B00054CE23 /* JSDOMConvertInterface.h in Headers */,
</del><span class="cx">                                 E125F85E182C2DF600D84CD9 /* CryptoKeyData.h in Headers */,
</span><span class="cx">                                 E125F864182C303A00D84CD9 /* CryptoKeyDataOctetSequence.h in Headers */,
</span><span class="cx">                                 E1C266DF18319F31003F8B33 /* CryptoKeyDataRSAComponents.h in Headers */,
</span><span class="lines">@@ -26082,7 +26086,6 @@
</span><span class="cx">                                 516C62211950D48700337E75 /* GamepadEvent.h in Headers */,
</span><span class="cx">                                 51A9D9EA195B931F001B2B5C /* GamepadManager.h in Headers */,
</span><span class="cx">                                 515BE1921D54F5FB00DD7C68 /* GamepadProvider.h in Headers */,
</span><del>-                                7C8E34B31E4A33B00054CE23 /* JSDOMConvertDate.h in Headers */,
</del><span class="cx">                                 515BE1931D54F5FB00DD7C68 /* GamepadProviderClient.h in Headers */,
</span><span class="cx">                                 935C477509AC4D8E00A6AAB4 /* GapRects.h in Headers */,
</span><span class="cx">                                 1432E8470C51493800B1500F /* GCController.h in Headers */,
</span><span class="lines">@@ -26124,7 +26127,6 @@
</span><span class="cx">                                 CD3E251C18046B0600E27F56 /* GridArea.h in Headers */,
</span><span class="cx">                                 CDEF4FD717E85C8F00AEE24B /* GridLength.h in Headers */,
</span><span class="cx">                                 A12705C31656BD6500C2E27C /* GridPosition.h in Headers */,
</span><del>-                                7CB5CA401E525C7300FAEF13 /* MediaQueryExpression.h in Headers */,
</del><span class="cx">                                 CDF7483F18FEBCEC0006ECC0 /* GridPositionsResolver.h in Headers */,
</span><span class="cx">                                 A12A1050166444FD008FA311 /* GridTrackSize.h in Headers */,
</span><span class="cx">                                 26EA89A71B4F2B75008C5FD2 /* HashableActionList.h in Headers */,
</span><span class="lines">@@ -26433,7 +26435,6 @@
</span><span class="cx">                                 B27535740B053814002CE64F /* IntRect.h in Headers */,
</span><span class="cx">                                 A2B9217316C5CC420041DCD9 /* IntRectExtent.h in Headers */,
</span><span class="cx">                                 E134F5AB12EE343F004EC58D /* IntRectHash.h in Headers */,
</span><del>-                                7C8E34C61E4A33B00054CE23 /* JSDOMConvertWebGL.h in Headers */,
</del><span class="cx">                                 B27535750B053814002CE64F /* IntSize.h in Headers */,
</span><span class="cx">                                 B27535760B053814002CE64F /* IntSizeHash.h in Headers */,
</span><span class="cx">                                 CE12524D1A1A77DE00864480 /* IOPMLibSPI.h in Headers */,
</span><span class="lines">@@ -26558,6 +26559,30 @@
</span><span class="cx">                                 7C45C9D41E3FCBDF00AAB558 /* JSDOMBindingSecurity.h in Headers */,
</span><span class="cx">                                 413C2C341BC29A8F0075204C /* JSDOMConstructor.h in Headers */,
</span><span class="cx">                                 930841341CDDB15500B0958C /* JSDOMConvert.h in Headers */,
</span><ins>+                                7C8E34AD1E4A33AF0054CE23 /* JSDOMConvertAny.h in Headers */,
+                                7C8E34AE1E4A33AF0054CE23 /* JSDOMConvertBase.h in Headers */,
+                                7C8E34AF1E4A33AF0054CE23 /* JSDOMConvertBoolean.h in Headers */,
+                                7C8E34B01E4A33AF0054CE23 /* JSDOMConvertBufferSource.h in Headers */,
+                                7C8E34B11E4A33B00054CE23 /* JSDOMConvertCallbacks.h in Headers */,
+                                7C8E34B31E4A33B00054CE23 /* JSDOMConvertDate.h in Headers */,
+                                7C8E34B41E4A33B00054CE23 /* JSDOMConvertDictionary.h in Headers */,
+                                7C8E34B51E4A33B00054CE23 /* JSDOMConvertEnumeration.h in Headers */,
+                                7C8E34B61E4A33B00054CE23 /* JSDOMConvertEventListener.h in Headers */,
+                                7C8E34B71E4A33B00054CE23 /* JSDOMConvertIndexedDB.h in Headers */,
+                                7C8E34B81E4A33B00054CE23 /* JSDOMConvertInterface.h in Headers */,
+                                7C8E34B91E4A33B00054CE23 /* JSDOMConvertJSON.h in Headers */,
+                                7C8E34BA1E4A33B00054CE23 /* JSDOMConvertNull.h in Headers */,
+                                7C8E34BB1E4A33B00054CE23 /* JSDOMConvertNullable.h in Headers */,
+                                7C8E34BD1E4A33B00054CE23 /* JSDOMConvertNumbers.h in Headers */,
+                                7C8E34BE1E4A33B00054CE23 /* JSDOMConvertObject.h in Headers */,
+                                7C8E34BF1E4A33B00054CE23 /* JSDOMConvertRecord.h in Headers */,
+                                7C8E34C01E4A33B00054CE23 /* JSDOMConvertSequences.h in Headers */,
+                                7C8E34C11E4A33B00054CE23 /* JSDOMConvertSerializedScriptValue.h in Headers */,
+                                7C8E34C31E4A33B00054CE23 /* JSDOMConvertStrings.h in Headers */,
+                                7C8E34C41E4A33B00054CE23 /* JSDOMConvertUnion.h in Headers */,
+                                7C8E34C51E4A33B00054CE23 /* JSDOMConvertVariadic.h in Headers */,
+                                7C8E34C61E4A33B00054CE23 /* JSDOMConvertWebGL.h in Headers */,
+                                7C8E34C71E4A33B00054CE23 /* JSDOMConvertXPathNSResolver.h in Headers */,
</ins><span class="cx">                                 BC60D7C10D29A46300B9918F /* JSDOMCoreException.h in Headers */,
</span><span class="cx">                                 FC9E0E4D16419C1E00392BE3 /* JSDOMCSSNamespace.h in Headers */,
</span><span class="cx">                                 40ECAE7E16B8B67200C36103 /* JSDOMError.h in Headers */,
</span><span class="lines">@@ -26650,7 +26675,6 @@
</span><span class="cx">                                 76808B50159DADFA002B5233 /* JSHTMLDialogElement.h in Headers */,
</span><span class="cx">                                 1A85B1E70A1B240500D8C87C /* JSHTMLDirectoryElement.h in Headers */,
</span><span class="cx">                                 1A85B2B70A1B2AC700D8C87C /* JSHTMLDivElement.h in Headers */,
</span><del>-                                7C8E34C71E4A33B00054CE23 /* JSDOMConvertXPathNSResolver.h in Headers */,
</del><span class="cx">                                 1A85B1E90A1B240500D8C87C /* JSHTMLDListElement.h in Headers */,
</span><span class="cx">                                 1A494E350A12358B00FDAFC1 /* JSHTMLDocument.h in Headers */,
</span><span class="cx">                                 1A494BFB0A122F4400FDAFC1 /* JSHTMLElement.h in Headers */,
</span><span class="lines">@@ -26685,7 +26709,6 @@
</span><span class="cx">                                 1A85B1EB0A1B240500D8C87C /* JSHTMLOListElement.h in Headers */,
</span><span class="cx">                                 A80E7E9B0A1A83E3007FB8C5 /* JSHTMLOptGroupElement.h in Headers */,
</span><span class="cx">                                 A80E7E990A1A83E3007FB8C5 /* JSHTMLOptionElement.h in Headers */,
</span><del>-                                7C8E34BD1E4A33B00054CE23 /* JSDOMConvertNumbers.h in Headers */,
</del><span class="cx">                                 448A29BF0A46D9CB0030759F /* JSHTMLOptionsCollection.h in Headers */,
</span><span class="cx">                                 4AD0173D127E82860015035F /* JSHTMLOutputElement.h in Headers */,
</span><span class="cx">                                 1AE2ABA70A1CE90500B42B25 /* JSHTMLParagraphElement.h in Headers */,
</span><span class="lines">@@ -26828,7 +26851,6 @@
</span><span class="cx">                                 B658FFA21522EF3A00DD5595 /* JSRadioNodeList.h in Headers */,
</span><span class="cx">                                 65DF320209D1CC60000BE325 /* JSRange.h in Headers */,
</span><span class="cx">                                 6C4C96DF1AD4483500363F64 /* JSReadableByteStreamController.h in Headers */,
</span><del>-                                7C8E34B41E4A33B00054CE23 /* JSDOMConvertDictionary.h in Headers */,
</del><span class="cx">                                 7C4C96DD1AD4483500365A50 /* JSReadableStream.h in Headers */,
</span><span class="cx">                                 6C4C96DF1AD4483500365A50 /* JSReadableStreamDefaultController.h in Headers */,
</span><span class="cx">                                 7C4C96DF1AD4483500365A50 /* JSReadableStreamDefaultReader.h in Headers */,
</span><span class="lines">@@ -26986,7 +27008,6 @@
</span><span class="cx">                                 B2FA3DD10AB75A6F000E5AC4 /* JSSVGPathSegLinetoHorizontalAbs.h in Headers */,
</span><span class="cx">                                 B2FA3DD30AB75A6F000E5AC4 /* JSSVGPathSegLinetoHorizontalRel.h in Headers */,
</span><span class="cx">                                 B2FA3DD50AB75A6F000E5AC4 /* JSSVGPathSegLinetoRel.h in Headers */,
</span><del>-                                7C8E34AF1E4A33AF0054CE23 /* JSDOMConvertBoolean.h in Headers */,
</del><span class="cx">                                 B2FA3DD70AB75A6F000E5AC4 /* JSSVGPathSegLinetoVerticalAbs.h in Headers */,
</span><span class="cx">                                 B2FA3DD90AB75A6F000E5AC4 /* JSSVGPathSegLinetoVerticalRel.h in Headers */,
</span><span class="cx">                                 B2FA3DDB0AB75A6F000E5AC4 /* JSSVGPathSegList.h in Headers */,
</span><span class="lines">@@ -27042,7 +27063,6 @@
</span><span class="cx">                                 E17B492116A9B8FF001C8839 /* JSTransitionEvent.h in Headers */,
</span><span class="cx">                                 1A750D5D0A90DEE1000FF215 /* JSTreeWalker.h in Headers */,
</span><span class="cx">                                 A86629CF09DA2B47009633A5 /* JSUIEvent.h in Headers */,
</span><del>-                                CDE667A51E4BBF1500E8154A /* WebAudioBufferList.h in Headers */,
</del><span class="cx">                                 465307D01DB6EE4800E4137C /* JSUIEventInit.h in Headers */,
</span><span class="cx">                                 7C73FB12191EF6F4007DE061 /* JSUserMessageHandler.h in Headers */,
</span><span class="cx">                                 7C73FB0D191EF5A8007DE061 /* JSUserMessageHandlersNamespace.h in Headers */,
</span><span class="lines">@@ -27082,7 +27102,6 @@
</span><span class="cx">                                 0C45342810CDBBFA00869157 /* JSWebGLUniformLocation.h in Headers */,
</span><span class="cx">                                 6F995A3A1A70833700A735F4 /* JSWebGLVertexArrayObject.h in Headers */,
</span><span class="cx">                                 77EF62F412F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.h in Headers */,
</span><del>-                                7C8E34C11E4A33B00054CE23 /* JSDOMConvertSerializedScriptValue.h in Headers */,
</del><span class="cx">                                 31C0FF3E0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h in Headers */,
</span><span class="cx">                                 498391400F1E767500C23782 /* JSWebKitCSSMatrix.h in Headers */,
</span><span class="cx">                                 8AD0A59514C88336000D83C5 /* JSWebKitCSSRegionRule.h in Headers */,
</span><span class="lines">@@ -27107,7 +27126,6 @@
</span><span class="cx">                                 BCDFD4960E30592F009D10AD /* JSXMLHttpRequestUpload.h in Headers */,
</span><span class="cx">                                 1ACE53F70A8D19470022947D /* JSXMLSerializer.h in Headers */,
</span><span class="cx">                                 1A762C740A074F2600989F5B /* JSXPathEvaluator.h in Headers */,
</span><del>-                                7C8E34BB1E4A33B00054CE23 /* JSDOMConvertNullable.h in Headers */,
</del><span class="cx">                                 BC60DB4A0D2A3D1E00B9918F /* JSXPathException.h in Headers */,
</span><span class="cx">                                 1A762C760A074F2600989F5B /* JSXPathExpression.h in Headers */,
</span><span class="cx">                                 1A762C780A074F2600989F5B /* JSXPathNSResolver.h in Headers */,
</span><span class="lines">@@ -27186,7 +27204,6 @@
</span><span class="cx">                                 06E81ED70AB5D5E900C87837 /* LocalCurrentGraphicsContext.h in Headers */,
</span><span class="cx">                                 F5973DE015CFB2030027F804 /* LocaleMac.h in Headers */,
</span><span class="cx">                                 7633A72613D8B33A008501B6 /* LocaleToScriptMapping.h in Headers */,
</span><del>-                                ECCDB8811E4B8C5900A1AEA6 /* WKContentObservationInternal.h in Headers */,
</del><span class="cx">                                 A516E8B7136E04DB0076C3C0 /* LocalizedDateCache.h in Headers */,
</span><span class="cx">                                 935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */,
</span><span class="cx">                                 BCE1C41B0D982980003B02F2 /* Location.h in Headers */,
</span><span class="lines">@@ -27274,6 +27291,7 @@
</span><span class="cx">                                 4E19592A0A39DACC00220FE5 /* MediaQuery.h in Headers */,
</span><span class="cx">                                 9493B6BF1D74B4120088E780 /* MediaQueryBlockWatcher.h in Headers */,
</span><span class="cx">                                 4E19592C0A39DACC00220FE5 /* MediaQueryEvaluator.h in Headers */,
</span><ins>+                                7CB5CA401E525C7300FAEF13 /* MediaQueryExpression.h in Headers */,
</ins><span class="cx">                                 D3A94A39122DABAC00A37BBC /* MediaQueryList.h in Headers */,
</span><span class="cx">                                 D3A94A3B122DABAC00A37BBC /* MediaQueryListListener.h in Headers */,
</span><span class="cx">                                 D3AA10F4123A98AA0092152B /* MediaQueryMatcher.h in Headers */,
</span><span class="lines">@@ -27368,7 +27386,6 @@
</span><span class="cx">                                 D6E276B014637455001D280A /* MutationObserverRegistration.h in Headers */,
</span><span class="cx">                                 C6F08FBD1430FE8F00685849 /* MutationRecord.h in Headers */,
</span><span class="cx">                                 52B6C9C615E3F4DF00690B05 /* NamedFlowCollection.h in Headers */,
</span><del>-                                7C8E34B61E4A33B00054CE23 /* JSDOMConvertEventListener.h in Headers */,
</del><span class="cx">                                 314BE3A71B3103FB00141982 /* NamedImageGeneratedImage.h in Headers */,
</span><span class="cx">                                 A81872230977D3C0005826D9 /* NamedNodeMap.h in Headers */,
</span><span class="cx">                                 A818721E0977D3C0005826D9 /* NameNodeList.h in Headers */,
</span><span class="lines">@@ -27555,7 +27572,6 @@
</span><span class="cx">                                 0F13163E16ED0CC80035CC04 /* PlatformCAFilters.h in Headers */,
</span><span class="cx">                                 499B3EC5128CCC4700E726C2 /* PlatformCALayer.h in Headers */,
</span><span class="cx">                                 493E5E0912D6420500020081 /* PlatformCALayerClient.h in Headers */,
</span><del>-                                7C8E34B71E4A33B00054CE23 /* JSDOMConvertIndexedDB.h in Headers */,
</del><span class="cx">                                 2D70BA1318074DDF0001908A /* PlatformCALayerCocoa.h in Headers */,
</span><span class="cx">                                 A14978711ABAF3A500CEF7E4 /* PlatformContentFilter.h in Headers */,
</span><span class="cx">                                 E1424C8A164B3B4E00F32D40 /* PlatformCookieJar.h in Headers */,
</span><span class="lines">@@ -27564,9 +27580,7 @@
</span><span class="cx">                                 BCAA487014A052530088FAC4 /* PlatformEventFactoryMac.h in Headers */,
</span><span class="cx">                                 A723F77B1484CA4C008C6DBE /* PlatformExportMacros.h in Headers */,
</span><span class="cx">                                 515BE1951D54F5FB00DD7C68 /* PlatformGamepad.h in Headers */,
</span><del>-                                7C8E34B01E4A33AF0054CE23 /* JSDOMConvertBufferSource.h in Headers */,
</del><span class="cx">                                 935C476809AC4D4300A6AAB4 /* PlatformKeyboardEvent.h in Headers */,
</span><del>-                                7C8E34AE1E4A33AF0054CE23 /* JSDOMConvertBase.h in Headers */,
</del><span class="cx">                                 0562F9611573F88F0031CA16 /* PlatformLayer.h in Headers */,
</span><span class="cx">                                 F544F78915CFB2A800AF33A8 /* PlatformLocale.h in Headers */,
</span><span class="cx">                                 CEEFCD7C19DB33DC003876D7 /* PlatformMediaResourceLoader.h in Headers */,
</span><span class="lines">@@ -27850,6 +27864,7 @@
</span><span class="cx">                                 7EE6846F12D26E3800E79415 /* ResourceRequestCFNet.h in Headers */,
</span><span class="cx">                                 7EE6847012D26E3800E79415 /* ResourceResponse.h in Headers */,
</span><span class="cx">                                 514C767F0CE923A1007EF3CD /* ResourceResponseBase.h in Headers */,
</span><ins>+                                A5CE9F3F1E4C4174001BBE7C /* ResourceTiming.h in Headers */,
</ins><span class="cx">                                 CBC2D2301CE5B8A100D1880B /* ResourceTimingInformation.h in Headers */,
</span><span class="cx">                                 A5071E851C56D0DC009951BE /* ResourceUsageData.h in Headers */,
</span><span class="cx">                                 ADBAD6EF1BCDD95700381325 /* ResourceUsageOverlay.h in Headers */,
</span><span class="lines">@@ -27876,7 +27891,6 @@
</span><span class="cx">                                 078E092117D14D1C00420AA1 /* RTCDTMFToneChangeEvent.h in Headers */,
</span><span class="cx">                                 078E092317D14D1C00420AA1 /* RTCIceCandidate.h in Headers */,
</span><span class="cx">                                 078E094017D16E1C00420AA1 /* RTCIceCandidateDescriptor.h in Headers */,
</span><del>-                                7C8E34BF1E4A33B00054CE23 /* JSDOMConvertRecord.h in Headers */,
</del><span class="cx">                                 078E092417D14D1C00420AA1 /* RTCIceCandidateEvent.h in Headers */,
</span><span class="cx">                                 07AB996B18DA3C010018771E /* RTCIceServer.h in Headers */,
</span><span class="cx">                                 073794FE19F5864E00E5A045 /* RTCNotifiersMock.h in Headers */,
</span><span class="lines">@@ -27964,7 +27978,6 @@
</span><span class="cx">                                 0FC4E410187F82E10045882C /* ScrollingTreeIOS.h in Headers */,
</span><span class="cx">                                 0FE5806419327A6200DE32EB /* ScrollingTreeMac.h in Headers */,
</span><span class="cx">                                 1AAADDE414DC8C8F00AF64B3 /* ScrollingTreeNode.h in Headers */,
</span><del>-                                ECCDB8871E4BB63F00A1AEA6 /* WKGraphicsInternal.h in Headers */,
</del><span class="cx">                                 0FEA3E80191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.h in Headers */,
</span><span class="cx">                                 9391A99D1629D70000297330 /* ScrollingTreeScrollingNode.h in Headers */,
</span><span class="cx">                                 0FB8890A167D2FA10010CDA5 /* ScrollingTreeStickyNode.h in Headers */,
</span><span class="lines">@@ -27971,7 +27984,6 @@
</span><span class="cx">                                 7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */,
</span><span class="cx">                                 F478755419983AFF0024A287 /* ScrollSnapAnimatorState.h in Headers */,
</span><span class="cx">                                 F46729281E0DE68500ACC3D8 /* ScrollSnapOffsetsInfo.h in Headers */,
</span><del>-                                7C8E34B11E4A33B00054CE23 /* JSDOMConvertCallbacks.h in Headers */,
</del><span class="cx">                                 83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */,
</span><span class="cx">                                 93C09C860B0657AA005ABD4D /* ScrollTypes.h in Headers */,
</span><span class="cx">                                 BC6D6E2609AF943500F59759 /* ScrollView.h in Headers */,
</span><span class="lines">@@ -28406,7 +28418,6 @@
</span><span class="cx">                                 B2227AD40D00BF220071B782 /* SVGTitleElement.h in Headers */,
</span><span class="cx">                                 1CCDF5BE1990332400BCEBAD /* SVGToOTFFontConversion.h in Headers */,
</span><span class="cx">                                 B2227AD70D00BF220071B782 /* SVGTransform.h in Headers */,
</span><del>-                                7C8E34AD1E4A33AF0054CE23 /* JSDOMConvertAny.h in Headers */,
</del><span class="cx">                                 B2227ADA0D00BF220071B782 /* SVGTransformable.h in Headers */,
</span><span class="cx">                                 B2227ADD0D00BF220071B782 /* SVGTransformDistance.h in Headers */,
</span><span class="cx">                                 B2227ADF0D00BF220071B782 /* SVGTransformList.h in Headers */,
</span><span class="lines">@@ -28502,7 +28513,6 @@
</span><span class="cx">                                 E1FF57A30F01255B00891EBB /* ThreadGlobalData.h in Headers */,
</span><span class="cx">                                 51D7EFEA1BDE8F8C00E93E10 /* ThreadSafeDataBuffer.h in Headers */,
</span><span class="cx">                                 185BCF290F3279CE000EA262 /* ThreadTimers.h in Headers */,
</span><del>-                                7C8E34C41E4A33B00054CE23 /* JSDOMConvertUnion.h in Headers */,
</del><span class="cx">                                 7AA3A69A194A64E7001CBD24 /* TileController.h in Headers */,
</span><span class="cx">                                 1F72BF0B187FD45C0009BCB3 /* TileControllerMemoryHandlerIOS.h in Headers */,
</span><span class="cx">                                 7AA3A6A4194B5C22001CBD24 /* TileCoverageMap.h in Headers */,
</span><span class="lines">@@ -28512,7 +28522,6 @@
</span><span class="cx">                                 F55B3DDC1251F12D003EF269 /* TimeInputType.h in Headers */,
</span><span class="cx">                                 7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */,
</span><span class="cx">                                 9305B24D098F1B6B00C28855 /* Timer.h in Headers */,
</span><del>-                                7C8E34C31E4A33B00054CE23 /* JSDOMConvertStrings.h in Headers */,
</del><span class="cx">                                 E44613B00CD6331000FADA75 /* TimeRanges.h in Headers */,
</span><span class="cx">                                 2D7ED0AB1BAE99170043B3E5 /* TimerEventBasedMock.h in Headers */,
</span><span class="cx">                                 49E912AE0EFAC906009D0CAF /* TimingFunction.h in Headers */,
</span><span class="lines">@@ -28558,7 +28567,6 @@
</span><span class="cx">                                 BCBD21AB0E417AD400A070F2 /* URLHash.h in Headers */,
</span><span class="cx">                                 F55B3DDE1251F12D003EF269 /* URLInputType.h in Headers */,
</span><span class="cx">                                 5C6E65431D5CEFBF00F7862E /* URLParser.h in Headers */,
</span><del>-                                7C8E34B51E4A33B00054CE23 /* JSDOMConvertEnumeration.h in Headers */,
</del><span class="cx">                                 7CC289DF1AA0FE5D009A9CE3 /* URLRegistry.h in Headers */,
</span><span class="cx">                                 93D437A21D57B3FE00AB85EA /* URLUtils.h in Headers */,
</span><span class="cx">                                 A72763BF16689BFB002FCACB /* UserActionElementSet.h in Headers */,
</span><span class="lines">@@ -28631,12 +28639,12 @@
</span><span class="cx">                                 AAA728F716D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.h in Headers */,
</span><span class="cx">                                 AA478A7F16CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.h in Headers */,
</span><span class="cx">                                 2D3EF4481917915C00034184 /* WebActionDisablingCALayerDelegate.h in Headers */,
</span><ins>+                                CDE667A51E4BBF1500E8154A /* WebAudioBufferList.h in Headers */,
</ins><span class="cx">                                 07D637401BB0B11300256CE9 /* WebAudioSourceProviderAVFObjC.h in Headers */,
</span><span class="cx">                                 1F36EA9C1E21BA1700621E25 /* WebBackgroundTaskController.h in Headers */,
</span><span class="cx">                                 A56C5B9B189F34570082D13C /* WebConsoleAgent.h in Headers */,
</span><span class="cx">                                 419BE7591BC7F42B00E1C85B /* WebCoreBuiltinNames.h in Headers */,
</span><span class="cx">                                 2D3EF44A1917915C00034184 /* WebCoreCALayerExtras.h in Headers */,
</span><del>-                                7C8E34BE1E4A33B00054CE23 /* JSDOMConvertObject.h in Headers */,
</del><span class="cx">                                 515F79541CFCA3D500CCED93 /* WebCoreCrossThreadCopier.h in Headers */,
</span><span class="cx">                                 93F199A808245E59001E9ABC /* WebCoreFrameView.h in Headers */,
</span><span class="cx">                                 CDC69DDA16371FD4007C38DF /* WebCoreFullScreenPlaceholderView.h in Headers */,
</span><span class="lines">@@ -28722,7 +28730,6 @@
</span><span class="cx">                                 7C48A6D1191C9D6500026674 /* WebKitNamespace.h in Headers */,
</span><span class="cx">                                 A5DEBDA416FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h in Headers */,
</span><span class="cx">                                 494BD7950F55C8EE00747828 /* WebKitPoint.h in Headers */,
</span><del>-                                7C8E34C51E4A33B00054CE23 /* JSDOMConvertVariadic.h in Headers */,
</del><span class="cx">                                 5709E8CF1D413D9A003244AC /* WebKitSubtleCrypto.h in Headers */,
</span><span class="cx">                                 31C0FF250E4CEB6E007D6FE5 /* WebKitTransitionEvent.h in Headers */,
</span><span class="cx">                                 0FCF332F0F2B9A25004B6795 /* WebLayer.h in Headers */,
</span><span class="lines">@@ -28781,7 +28788,9 @@
</span><span class="cx">                                 E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */,
</span><span class="cx">                                 501BAAA913950E2C00F7ACEB /* WindRule.h in Headers */,
</span><span class="cx">                                 A14832BE187F64CC00DA63A6 /* WKContentObservation.h in Headers */,
</span><ins>+                                ECCDB8811E4B8C5900A1AEA6 /* WKContentObservationInternal.h in Headers */,
</ins><span class="cx">                                 A14832BF187F652C00DA63A6 /* WKGraphics.h in Headers */,
</span><ins>+                                ECCDB8871E4BB63F00A1AEA6 /* WKGraphicsInternal.h in Headers */,
</ins><span class="cx">                                 A14832C1187F657A00DA63A6 /* WKTypes.h in Headers */,
</span><span class="cx">                                 A14832C3187F65DF00DA63A6 /* WKUtilities.h in Headers */,
</span><span class="cx">                                 A14832C4187F663C00DA63A6 /* WKView.h in Headers */,
</span><span class="lines">@@ -28820,7 +28829,6 @@
</span><span class="cx">                                 416E6FE81BBD12DF000A6053 /* WritableStreamInternalsBuiltins.h in Headers */,
</span><span class="cx">                                 9BAF3B2412C1A39800014BF1 /* WritingDirection.h in Headers */,
</span><span class="cx">                                 14476AA815DC4BB100305DB2 /* WritingMode.h in Headers */,
</span><del>-                                7C8E34BA1E4A33B00054CE23 /* JSDOMConvertNull.h in Headers */,
</del><span class="cx">                                 6565820209D1508D000E61D7 /* XLinkNames.h in Headers */,
</span><span class="cx">                                 830784B21C52EE2C00104D1D /* XMLDocument.h in Headers */,
</span><span class="cx">                                 00B9318813BA8DBA0035A948 /* XMLDocumentParser.h in Headers */,
</span><span class="lines">@@ -28833,7 +28841,6 @@
</span><span class="cx">                                 BCDFD48E0E305290009D10AD /* XMLHttpRequestUpload.h in Headers */,
</span><span class="cx">                                 A833C80D0A2CF25600D57664 /* XMLNames.h in Headers */,
</span><span class="cx">                                 E15A36D71104572000B7B639 /* XMLNSNames.h in Headers */,
</span><del>-                                7C8E34B91E4A33B00054CE23 /* JSDOMConvertJSON.h in Headers */,
</del><span class="cx">                                 1ACE53EB0A8D18E70022947D /* XMLSerializer.h in Headers */,
</span><span class="cx">                                 5905ADC01302F3CE00F116DF /* XMLTreeViewer.h in Headers */,
</span><span class="cx">                                 1AB7FC690A8B92EC00D9D37B /* XPathEvaluator.h in Headers */,
</span><span class="lines">@@ -29441,6 +29448,7 @@
</span><span class="cx">                                 E1FE137418402A6700892F13 /* CommonCryptoUtilities.cpp in Sources */,
</span><span class="cx">                                 0F60F32C1DFBB10B00416D6C /* CommonVM.cpp in Sources */,
</span><span class="cx">                                 7C93F3491AA6BA5E00A98BAB /* CompiledContentExtension.cpp in Sources */,
</span><ins>+                                C2F4E78A1E45BEA1006D7105 /* ComplexTextController.cpp in Sources */,
</ins><span class="cx">                                 37C238221098C84200EF9F72 /* ComplexTextControllerCoreText.mm in Sources */,
</span><span class="cx">                                 E44FA1871BCA91560091B6EF /* ComposedTreeIterator.cpp in Sources */,
</span><span class="cx">                                 316FE1150E6E1DA700BF6088 /* CompositeAnimation.cpp in Sources */,
</span><span class="lines">@@ -29501,7 +29509,6 @@
</span><span class="cx">                                 975CA28A130365F800E99AD9 /* Crypto.cpp in Sources */,
</span><span class="cx">                                 E172AF6D180F24C600FBADB9 /* CryptoAlgorithm.cpp in Sources */,
</span><span class="cx">                                 E125F8411824253A00D84CD9 /* CryptoAlgorithmAES_CBC.cpp in Sources */,
</span><del>-                                7CC01D0C1E4A7B0400E529CC /* JSDOMConstructorWithDocument.cpp in Sources */,
</del><span class="cx">                                 E125F845182425C900D84CD9 /* CryptoAlgorithmAES_CBCMac.cpp in Sources */,
</span><span class="cx">                                 E1FE137A184D21BB00892F13 /* CryptoAlgorithmAES_KW.cpp in Sources */,
</span><span class="cx">                                 E1FE137E184D270200892F13 /* CryptoAlgorithmAES_KWMac.cpp in Sources */,
</span><span class="lines">@@ -29545,7 +29552,6 @@
</span><span class="cx">                                 9444CBE31D8861980073A074 /* CSSCustomIdentValue.cpp in Sources */,
</span><span class="cx">                                 94D4AC621DC24C8E0080F02D /* CSSCustomPropertyValue.cpp in Sources */,
</span><span class="cx">                                 4A9CC81716BB9AC600EC645A /* CSSDefaultStyleSheets.cpp in Sources */,
</span><del>-                                7CC01D0A1E4A7B0400E529CC /* JSDOMBuiltinConstructorBase.cpp in Sources */,
</del><span class="cx">                                 94476BDA1DFCAC0300690E23 /* CSSDeferredParser.cpp in Sources */,
</span><span class="cx">                                 FBB0C5B717BBD626003D3677 /* CSSFilterImageValue.cpp in Sources */,
</span><span class="cx">                                 BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */,
</span><span class="lines">@@ -29592,7 +29598,6 @@
</span><span class="cx">                                 A80E6CF70A1989CA007FB8C5 /* CSSProperty.cpp in Sources */,
</span><span class="cx">                                 78D02BC5154A18DF00B62D05 /* CSSPropertyAnimation.cpp in Sources */,
</span><span class="cx">                                 1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */,
</span><del>-                                7C8E34B21E4A33B00054CE23 /* JSDOMConvertDate.cpp in Sources */,
</del><span class="cx">                                 946D37451D6D01D40077084F /* CSSPropertyParser.cpp in Sources */,
</span><span class="cx">                                 949C77041D6E39EA00C0DE4F /* CSSPropertyParserHelpers.cpp in Sources */,
</span><span class="cx">                                 82E3D8DE122EA0D1003AE5BC /* CSSPropertySourceData.cpp in Sources */,
</span><span class="lines">@@ -29847,8 +29852,9 @@
</span><span class="cx">                                 2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */,
</span><span class="cx">                                 C57FEDE11212EE9C0097BE65 /* FileSystem.cpp in Sources */,
</span><span class="cx">                                 5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */,
</span><ins>+                                514B3F760C722055000530DF /* FileSystemCocoa.mm in Sources */,
</ins><span class="cx">                                 26C17A3F1491D2D400D12BA2 /* FileSystemIOS.mm in Sources */,
</span><del>-                                514B3F760C722055000530DF /* FileSystemCocoa.mm in Sources */,
</del><ins>+                                A1CC11641E493D0100EFA69C /* FileSystemMac.mm in Sources */,
</ins><span class="cx">                                 5160300B0CC4251200C8AC25 /* FileSystemPOSIX.cpp in Sources */,
</span><span class="cx">                                 BC5EB69E0E81DAEB00B25965 /* FillLayer.cpp in Sources */,
</span><span class="cx">                                 08C925190FCC7C4A00480DEC /* FilterEffect.cpp in Sources */,
</span><span class="lines">@@ -29859,7 +29865,6 @@
</span><span class="cx">                                 9A528E8317D7F52F00AA9518 /* FloatingObjects.cpp in Sources */,
</span><span class="cx">                                 FE699871192087E7006936BD /* FloatingPointEnvironment.cpp in Sources */,
</span><span class="cx">                                 B27535680B053814002CE64F /* FloatPoint.cpp in Sources */,
</span><del>-                                7C8E34C21E4A33B00054CE23 /* JSDOMConvertStrings.cpp in Sources */,
</del><span class="cx">                                 B2E27C9F0B0F2B0900F17C7B /* FloatPoint3D.cpp in Sources */,
</span><span class="cx">                                 B27535590B053814002CE64F /* FloatPointCG.cpp in Sources */,
</span><span class="cx">                                 B27535780B053814002CE64F /* FloatPointMac.mm in Sources */,
</span><span class="lines">@@ -30360,6 +30365,12 @@
</span><span class="cx">                                 65DF31F509D1CC60000BE325 /* JSDocumentType.cpp in Sources */,
</span><span class="cx">                                 1AC2260C0DB69F190089B669 /* JSDOMApplicationCache.cpp in Sources */,
</span><span class="cx">                                 7C45C9CF1E3EFDF700AAB558 /* JSDOMBindingSecurity.cpp in Sources */,
</span><ins>+                                7CC01D0A1E4A7B0400E529CC /* JSDOMBuiltinConstructorBase.cpp in Sources */,
+                                7CC01D0B1E4A7B0400E529CC /* JSDOMConstructorBase.cpp in Sources */,
+                                7CC01D0C1E4A7B0400E529CC /* JSDOMConstructorWithDocument.cpp in Sources */,
+                                7C8E34B21E4A33B00054CE23 /* JSDOMConvertDate.cpp in Sources */,
+                                7C8E34BC1E4A33B00054CE23 /* JSDOMConvertNumbers.cpp in Sources */,
+                                7C8E34C21E4A33B00054CE23 /* JSDOMConvertStrings.cpp in Sources */,
</ins><span class="cx">                                 BC60D7C00D29A46300B9918F /* JSDOMCoreException.cpp in Sources */,
</span><span class="cx">                                 FD67773B195CB1E60072E0D3 /* JSDOMCSSNamespace.cpp in Sources */,
</span><span class="cx">                                 40ECAE8116B8B68A00C36103 /* JSDOMError.cpp in Sources */,
</span><span class="lines">@@ -30393,9 +30404,7 @@
</span><span class="cx">                                 BC6932730D7E293900AE44D1 /* JSDOMWindowBase.cpp in Sources */,
</span><span class="cx">                                 BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */,
</span><span class="cx">                                 460CBF351D4BCD0E0092E88E /* JSDOMWindowProperties.cpp in Sources */,
</span><del>-                                CDE667A41E4BBF1500E8154A /* WebAudioBufferList.cpp in Sources */,
</del><span class="cx">                                 BCBFB53C0DCD29CF0019B3E5 /* JSDOMWindowShell.cpp in Sources */,
</span><del>-                                A1CC11641E493D0100EFA69C /* FileSystemMac.mm in Sources */,
</del><span class="cx">                                 4170A2EA1D8C0CCA00318452 /* JSDOMWrapper.cpp in Sources */,
</span><span class="cx">                                 7C45C9D01E3EFDFB00AAB558 /* JSDOMWrapperCache.cpp in Sources */,
</span><span class="cx">                                 93A8061D1E03B585008A1F26 /* JSDoubleRange.cpp in Sources */,
</span><span class="lines">@@ -30643,7 +30652,6 @@
</span><span class="cx">                                 1A0D57400A5C7867007EDD4C /* JSOverflowEvent.cpp in Sources */,
</span><span class="cx">                                 E1284BB210449FFA00EAEB52 /* JSPageTransitionEvent.cpp in Sources */,
</span><span class="cx">                                 FDA15EB112B03EE1003A583A /* JSPannerNode.cpp in Sources */,
</span><del>-                                7CB5CA3F1E525C7100FAEF13 /* MediaQueryExpression.cpp in Sources */,
</del><span class="cx">                                 E51A81DF17298D7700BFCA61 /* JSPerformance.cpp in Sources */,
</span><span class="cx">                                 CB38FD511CCF938900592A3F /* JSPerformanceEntry.cpp in Sources */,
</span><span class="cx">                                 CB38FD571CD21E2A00592A3F /* JSPerformanceEntryCustom.cpp in Sources */,
</span><span class="lines">@@ -31025,6 +31033,7 @@
</span><span class="cx">                                 5CDD83641E4325A000621E92 /* LibWebRTCDataChannelHandler.cpp in Sources */,
</span><span class="cx">                                 417612AF1E3A994000C3D81D /* LibWebRTCMediaEndpoint.cpp in Sources */,
</span><span class="cx">                                 417612B11E3A994000C3D81D /* LibWebRTCPeerConnectionBackend.cpp in Sources */,
</span><ins>+                                41A1B00E1E526579007F3769 /* LibWebRTCProvider.cpp in Sources */,
</ins><span class="cx">                                 FFB698CC1833EE0D00158A31 /* LineBreaker.cpp in Sources */,
</span><span class="cx">                                 89B5EAA111E8003D00F2367E /* LineEnding.cpp in Sources */,
</span><span class="cx">                                 FFB698CF183402BB00158A31 /* LineInfo.cpp in Sources */,
</span><span class="lines">@@ -31124,6 +31133,7 @@
</span><span class="cx">                                 4E1959290A39DACC00220FE5 /* MediaQuery.cpp in Sources */,
</span><span class="cx">                                 9493B6BE1D74B4120088E780 /* MediaQueryBlockWatcher.cpp in Sources */,
</span><span class="cx">                                 4E19592B0A39DACC00220FE5 /* MediaQueryEvaluator.cpp in Sources */,
</span><ins>+                                7CB5CA3F1E525C7100FAEF13 /* MediaQueryExpression.cpp in Sources */,
</ins><span class="cx">                                 D3A94A38122DABAC00A37BBC /* MediaQueryList.cpp in Sources */,
</span><span class="cx">                                 D3AA10F3123A98AA0092152B /* MediaQueryMatcher.cpp in Sources */,
</span><span class="cx">                                 9493B6C01D74B4120088E780 /* MediaQueryParser.cpp in Sources */,
</span><span class="lines">@@ -31409,7 +31419,6 @@
</span><span class="cx">                                 D06C0D900CFD11460065F43F /* RemoveFormatCommand.cpp in Sources */,
</span><span class="cx">                                 93309E04099E64920056E581 /* RemoveNodeCommand.cpp in Sources */,
</span><span class="cx">                                 93309E06099E64920056E581 /* RemoveNodePreservingChildrenCommand.cpp in Sources */,
</span><del>-                                C2F4E78A1E45BEA1006D7105 /* ComplexTextController.cpp in Sources */,
</del><span class="cx">                                 7CD494CC1A86EB1D000A87EC /* RenderAttachment.cpp in Sources */,
</span><span class="cx">                                 BCEA485F097D93020094C9E4 /* RenderBlock.cpp in Sources */,
</span><span class="cx">                                 BC10D76717D8EE6E005E2626 /* RenderBlockFlow.cpp in Sources */,
</span><span class="lines">@@ -31474,7 +31483,6 @@
</span><span class="cx">                                 BCE32B9E1517C22700F542EC /* RenderMultiColumnSet.cpp in Sources */,
</span><span class="cx">                                 BC1A7D9718FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.cpp in Sources */,
</span><span class="cx">                                 8AC822FC180FC03300FB64D5 /* RenderNamedFlowFragment.cpp in Sources */,
</span><del>-                                7C8E34BC1E4A33B00054CE23 /* JSDOMConvertNumbers.cpp in Sources */,
</del><span class="cx">                                 1A3FF9C315265359002288A1 /* RenderNamedFlowThread.cpp in Sources */,
</span><span class="cx">                                 BCEA487F097D93020094C9E4 /* RenderObject.cpp in Sources */,
</span><span class="cx">                                 A43BF59C1149292800C643CA /* RenderProgress.cpp in Sources */,
</span><span class="lines">@@ -31556,6 +31564,7 @@
</span><span class="cx">                                 514C767E0CE923A1007EF3CD /* ResourceResponseBase.cpp in Sources */,
</span><span class="cx">                                 7EE6847112D26E3800E79415 /* ResourceResponseCFNet.cpp in Sources */,
</span><span class="cx">                                 A1F78D0C1C25424C00245446 /* ResourceResponseCocoa.mm in Sources */,
</span><ins>+                                A5CE9F401E4C4178001BBE7C /* ResourceTiming.cpp in Sources */,
</ins><span class="cx">                                 CBC2D22F1CE5B89D00D1880B /* ResourceTimingInformation.cpp in Sources */,
</span><span class="cx">                                 A5071E8B1C56FB31009951BE /* ResourceUsageData.cpp in Sources */,
</span><span class="cx">                                 ADBAD6EE1BCDD95500381325 /* ResourceUsageOverlay.cpp in Sources */,
</span><span class="lines">@@ -31568,7 +31577,6 @@
</span><span class="cx">                                 FD3160AA12B026F700C1A359 /* ReverbConvolverStage.cpp in Sources */,
</span><span class="cx">                                 FD3160AC12B026F700C1A359 /* ReverbInputBuffer.cpp in Sources */,
</span><span class="cx">                                 BC74DA381013F3F7007987AD /* RGBColor.cpp in Sources */,
</span><del>-                                7CC01D0B1E4A7B0400E529CC /* JSDOMConstructorBase.cpp in Sources */,
</del><span class="cx">                                 A8CFF5E70A155A05000A4234 /* RootInlineBox.cpp in Sources */,
</span><span class="cx">                                 49E911C80EF86D47009D0CAF /* RotateTransformOperation.cpp in Sources */,
</span><span class="cx">                                 A73F95FE12C97BFE0031AAF9 /* RoundedRect.cpp in Sources */,
</span><span class="lines">@@ -32171,6 +32179,7 @@
</span><span class="cx">                                 AA478A8016CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.mm in Sources */,
</span><span class="cx">                                 2D3EF4491917915C00034184 /* WebActionDisablingCALayerDelegate.mm in Sources */,
</span><span class="cx">                                 120DE3ED1C86CA3E00B6D4DD /* WebAnimation.cpp in Sources */,
</span><ins>+                                CDE667A41E4BBF1500E8154A /* WebAudioBufferList.cpp in Sources */,
</ins><span class="cx">                                 07D637411BB0B11300256CE9 /* WebAudioSourceProviderAVFObjC.mm in Sources */,
</span><span class="cx">                                 CDA29A311CBF74DA00901CCF /* WebAVPlayerController.mm in Sources */,
</span><span class="cx">                                 1F36EA9D1E21BA1700621E25 /* WebBackgroundTaskController.mm in Sources */,
</span><span class="lines">@@ -32186,7 +32195,6 @@
</span><span class="cx">                                 0F7DF1481E2BF1B10095951B /* WebCoreJSClientData.cpp in Sources */,
</span><span class="cx">                                 3140379C124BEA7F00AF40E4 /* WebCoreMotionManager.mm in Sources */,
</span><span class="cx">                                 CDC979F41C498C0900DB50D4 /* WebCoreNSErrorExtras.mm in Sources */,
</span><del>-                                41A1B00E1E526579007F3769 /* LibWebRTCProvider.cpp in Sources */,
</del><span class="cx">                                 934D9BA50B8C116B007B42A9 /* WebCoreNSStringExtras.mm in Sources */,
</span><span class="cx">                                 C5B4C24E1509236C00A6EF37 /* WebCoreNSURLExtras.mm in Sources */,
</span><span class="cx">                                 CD225C0B1C46FBF400140761 /* WebCoreNSURLSession.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontSelector.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -356,7 +356,7 @@
</span><span class="cx">         cachedResourceLoader.decrementRequestCount(*fontHandle);
</span><span class="cx">     }
</span><span class="cx">     // Ensure that if the request count reaches zero, the frame loader will know about it.
</span><del>-    cachedResourceLoader.loadDone(nullptr);
</del><ins>+    cachedResourceLoader.loadDone();
</ins><span class="cx">     // New font loads may be triggered by layout after the document load is complete but before we have dispatched
</span><span class="cx">     // didFinishLoading for the frame. Make sure the delegate is always dispatched by checking explicitly.
</span><span class="cx">     if (m_document &amp;&amp; m_document-&gt;frame())
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderCrossOriginPreflightCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -40,7 +40,6 @@
</span><span class="cx"> #include &quot;DocumentThreadableLoader.h&quot;
</span><span class="cx"> #include &quot;InspectorInstrumentation.h&quot;
</span><span class="cx"> #include &quot;RuntimeEnabledFeatures.h&quot;
</span><del>-#include &quot;ThreadableLoaderClient.h&quot;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentThreadableLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -38,13 +38,17 @@
</span><span class="cx"> #include &quot;CrossOriginAccessControl.h&quot;
</span><span class="cx"> #include &quot;CrossOriginPreflightChecker.h&quot;
</span><span class="cx"> #include &quot;CrossOriginPreflightResultCache.h&quot;
</span><ins>+#include &quot;DOMWindow.h&quot;
</ins><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><span class="cx"> #include &quot;InspectorInstrumentation.h&quot;
</span><ins>+#include &quot;LoadTiming.h&quot;
+#include &quot;Performance.h&quot;
</ins><span class="cx"> #include &quot;ProgressTracker.h&quot;
</span><span class="cx"> #include &quot;ResourceError.h&quot;
</span><span class="cx"> #include &quot;ResourceRequest.h&quot;
</span><ins>+#include &quot;ResourceTiming.h&quot;
</ins><span class="cx"> #include &quot;RuntimeEnabledFeatures.h&quot;
</span><span class="cx"> #include &quot;SchemeRegistry.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="lines">@@ -323,6 +327,26 @@
</span><span class="cx">     m_client-&gt;didReceiveData(data, dataLength);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void DocumentThreadableLoader::finishedTimingForWorkerLoad(CachedResource&amp; resource, const ResourceTiming&amp; resourceTiming)
+{
+    ASSERT(m_client);
+    ASSERT_UNUSED(resource, &amp;resource == m_resource);
+    UNUSED_PARAM(resourceTiming);
+
+#if ENABLE(WEB_TIMING)
+    finishedTimingForWorkerLoad(resourceTiming);
+#endif
+}
+
+#if ENABLE(WEB_TIMING)
+void DocumentThreadableLoader::finishedTimingForWorkerLoad(const ResourceTiming&amp; resourceTiming)
+{
+    ASSERT(m_options.initiatorContext == InitiatorContext::Worker);
+
+    m_client-&gt;didFinishTiming(resourceTiming);
+}
+#endif
+
</ins><span class="cx"> void DocumentThreadableLoader::notifyFinished(CachedResource&amp; resource)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_client);
</span><span class="lines">@@ -411,6 +435,11 @@
</span><span class="cx">     // If credentials mode is 'Omit', we should disable cookie sending.
</span><span class="cx">     ASSERT(m_options.credentials != FetchOptions::Credentials::Omit);
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEB_TIMING)
+    LoadTiming loadTiming;
+    loadTiming.markStartTimeAndFetchStart();
+#endif
+
</ins><span class="cx">     // FIXME: ThreadableLoaderOptions.sniffContent is not supported for synchronous requests.
</span><span class="cx">     RefPtr&lt;SharedBuffer&gt; data;
</span><span class="cx">     ResourceError error;
</span><span class="lines">@@ -423,6 +452,10 @@
</span><span class="cx">         identifier = frameLoader.loadResourceSynchronously(request, m_options.allowCredentials, m_options.clientCredentialPolicy, error, response, data);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEB_TIMING)
+    loadTiming.setResponseEnd(MonotonicTime::now());
+#endif
+
</ins><span class="cx">     if (!error.isNull() &amp;&amp; response.httpStatusCode() &lt;= 0) {
</span><span class="cx">         if (requestURL.isLocalFile()) {
</span><span class="cx">             // We don't want XMLHttpRequest to raise an exception for file:// resources, see &lt;rdar://problem/4962298&gt;.
</span><span class="lines">@@ -468,6 +501,19 @@
</span><span class="cx"> 
</span><span class="cx">     if (data)
</span><span class="cx">         didReceiveData(identifier, data-&gt;data(), data-&gt;size());
</span><ins>+
+#if ENABLE(WEB_TIMING)
+    if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled()) {
+        ResourceTiming resourceTiming = ResourceTiming::fromSynchronousLoad(requestURL, m_options.initiator, loadTiming, response.networkLoadTiming(), response, securityOrigin());
+        if (options().initiatorContext == InitiatorContext::Worker)
+            finishedTimingForWorkerLoad(resourceTiming);
+        else {
+            if (document().domWindow() &amp;&amp; document().domWindow()-&gt;performance())
+                document().domWindow()-&gt;performance()-&gt;addResourceTiming(WTFMove(resourceTiming));
+        }        
+    }
+#endif
+
</ins><span class="cx">     didFinishLoading(identifier, 0.0);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentThreadableLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentThreadableLoader.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -84,6 +84,7 @@
</span><span class="cx">         void responseReceived(CachedResource&amp;, const ResourceResponse&amp;) override;
</span><span class="cx">         void dataReceived(CachedResource&amp;, const char* data, int dataLength) override;
</span><span class="cx">         void redirectReceived(CachedResource&amp;, ResourceRequest&amp;, const ResourceResponse&amp;) override;
</span><ins>+        void finishedTimingForWorkerLoad(CachedResource&amp;, const ResourceTiming&amp;) override;
</ins><span class="cx">         void notifyFinished(CachedResource&amp;) override;
</span><span class="cx"> 
</span><span class="cx">         void didReceiveResponse(unsigned long identifier, const ResourceResponse&amp;, ResourceResponse::Tainting);
</span><span class="lines">@@ -96,6 +97,10 @@
</span><span class="cx">         void preflightSuccess(ResourceRequest&amp;&amp;);
</span><span class="cx">         void preflightFailure(unsigned long identifier, const ResourceError&amp;);
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEB_TIMING)
+        void finishedTimingForWorkerLoad(const ResourceTiming&amp;);
+#endif
+
</ins><span class="cx">         void loadRequest(ResourceRequest&amp;&amp;, SecurityCheckPolicy);
</span><span class="cx">         bool isAllowedRedirect(const URL&amp;);
</span><span class="cx">         bool isAllowedByContentSecurityPolicy(const URL&amp;, ContentSecurityPolicy::RedirectResponseReceived);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderLoadTimingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/LoadTiming.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/LoadTiming.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/LoadTiming.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -70,4 +70,26 @@
</span><span class="cx">     m_hasCrossOriginRedirect = !redirectedSecurityOrigin.get().canRequest(redirectingUrl);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LoadTiming LoadTiming::isolatedCopy() const
+{
+    LoadTiming result;
+
+    result.m_referenceWallTime = m_referenceWallTime;
+    result.m_referenceMonotonicTime = m_referenceMonotonicTime;
+    result.m_startTime = m_startTime;
+    result.m_unloadEventStart = m_unloadEventStart;
+    result.m_unloadEventEnd = m_unloadEventEnd;
+    result.m_redirectStart = m_redirectStart;
+    result.m_redirectEnd = m_redirectEnd;
+    result.m_fetchStart = m_fetchStart;
+    result.m_responseEnd = m_responseEnd;
+    result.m_loadEventStart = m_loadEventStart;
+    result.m_loadEventEnd = m_loadEventEnd;
+    result.m_redirectCount = m_redirectCount;
+    result.m_hasCrossOriginRedirect = m_hasCrossOriginRedirect;
+    result.m_hasSameOriginAsPreviousDocument = m_hasSameOriginAsPreviousDocument;
+
+    return result;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderLoadTimingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/LoadTiming.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/LoadTiming.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/LoadTiming.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -70,6 +70,8 @@
</span><span class="cx">     MonotonicTime referenceMonotonicTime() const { return m_referenceMonotonicTime; }
</span><span class="cx">     WallTime referenceWallTime() const { return m_referenceWallTime; }
</span><span class="cx"> 
</span><ins>+    LoadTiming isolatedCopy() const;
+
</ins><span class="cx"> private:
</span><span class="cx">     WallTime m_referenceWallTime;
</span><span class="cx">     MonotonicTime m_referenceMonotonicTime;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadNotifiercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -133,12 +133,12 @@
</span><span class="cx"> 
</span><span class="cx">     InspectorInstrumentation::willSendRequest(&amp;m_frame, identifier, loader, request, redirectResponse);
</span><span class="cx"> 
</span><del>-    // Report WebTiming for all frames.
-    if (loader &amp;&amp; !request.isNull() &amp;&amp; request.url() == loader-&gt;url())
-        request.setReportLoadTiming(true);
-
</del><span class="cx">     if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
</span><span class="cx">         request.setReportLoadTiming(true);
</span><ins>+    else if (loader &amp;&amp; !request.isNull() &amp;&amp; request.url() == loader-&gt;url()) {
+        // Report WebTiming for all frames.
+        request.setReportLoadTiming(true);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ResourceLoadNotifier::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse&amp; r, ResourceLoader* resourceLoader)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoaderOptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoaderOptions.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoaderOptions.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/ResourceLoaderOptions.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -87,6 +87,11 @@
</span><span class="cx">     Unset
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+enum class InitiatorContext {
+    Document,
+    Worker,
+};
+
</ins><span class="cx"> struct ResourceLoaderOptions : public FetchOptions {
</span><span class="cx">     ResourceLoaderOptions() { }
</span><span class="cx"> 
</span><span class="lines">@@ -118,6 +123,7 @@
</span><span class="cx">     DefersLoadingPolicy defersLoadingPolicy { DefersLoadingPolicy::AllowDefersLoading };
</span><span class="cx">     CachingPolicy cachingPolicy { CachingPolicy::AllowCaching };
</span><span class="cx">     SameOriginDataURLFlag sameOriginDataURLFlag { SameOriginDataURLFlag::Unset };
</span><ins>+    InitiatorContext initiatorContext { InitiatorContext::Document };
</ins><span class="cx"> 
</span><span class="cx">     ClientCredentialPolicy clientCredentialPolicy { ClientCredentialPolicy::CannotAskClientForCredentials };
</span><span class="cx">     unsigned maxRedirectCount { 20 };
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceTimingcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/loader/ResourceTiming.cpp (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceTiming.cpp                                (rev 0)
+++ trunk/Source/WebCore/loader/ResourceTiming.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,104 @@
</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;ResourceTiming.h&quot;
+
+#include &quot;CachedResource.h&quot;
+#include &quot;SecurityOrigin.h&quot;
+
+namespace WebCore {
+
+static bool passesTimingAllowCheck(const ResourceResponse&amp; response, const SecurityOrigin&amp; initiatorSecurityOrigin)
+{
+    Ref&lt;SecurityOrigin&gt; resourceOrigin = SecurityOrigin::create(response.url());
+    if (resourceOrigin-&gt;isSameSchemeHostPort(initiatorSecurityOrigin))
+        return true;
+
+    const String&amp; timingAllowOriginString = response.httpHeaderField(HTTPHeaderName::TimingAllowOrigin);
+    if (timingAllowOriginString.isEmpty() || equalLettersIgnoringASCIICase(timingAllowOriginString, &quot;null&quot;))
+        return false;
+
+    if (timingAllowOriginString == &quot;*&quot;)
+        return true;
+
+    const String&amp; securityOrigin = initiatorSecurityOrigin.toString();
+    Vector&lt;String&gt; timingAllowOrigins;
+    timingAllowOriginString.split(',', timingAllowOrigins);
+    for (auto&amp; origin : timingAllowOrigins) {
+        if (origin.stripWhiteSpace() == securityOrigin)
+            return true;
+    }
+
+    return false;
+}
+
+ResourceTiming ResourceTiming::fromCache(const URL&amp; url, const String&amp; initiator, const LoadTiming&amp; loadTiming)
+{
+    return ResourceTiming(url, initiator, loadTiming);
+}
+
+ResourceTiming ResourceTiming::fromLoad(CachedResource&amp; resource, const String&amp; initiator, const LoadTiming&amp; loadTiming, const SecurityOrigin&amp; securityOrigin)
+{
+    return ResourceTiming(resource, initiator, loadTiming, securityOrigin);
+}
+
+ResourceTiming ResourceTiming::fromSynchronousLoad(const URL&amp; url, const String&amp; initiator, const LoadTiming&amp; loadTiming, const NetworkLoadTiming&amp; networkLoadTiming, const ResourceResponse&amp; response, const SecurityOrigin&amp; securityOrigin)
+{
+    return ResourceTiming(url, initiator, loadTiming, networkLoadTiming, response, securityOrigin);
+}
+
+ResourceTiming::ResourceTiming(const URL&amp; url, const String&amp; initiator, const LoadTiming&amp; loadTiming)
+    : m_url(url)
+    , m_initiator(initiator)
+    , m_loadTiming(loadTiming)
+    , m_allowTimingDetails(true)
+{
+}
+
+ResourceTiming::ResourceTiming(CachedResource&amp; resource, const String&amp; initiator, const LoadTiming&amp; loadTiming, const SecurityOrigin&amp; securityOrigin)
+    : m_url(resource.resourceRequest().url())
+    , m_initiator(initiator)
+    , m_loadTiming(loadTiming)
+    , m_networkLoadTiming(resource.response().networkLoadTiming())
+    , m_allowTimingDetails(passesTimingAllowCheck(resource.response(), securityOrigin))
+{
+}
+
+ResourceTiming::ResourceTiming(const URL&amp; url, const String&amp; initiator, const LoadTiming&amp; loadTiming, const NetworkLoadTiming&amp; networkLoadTiming, const ResourceResponse&amp; response, const SecurityOrigin&amp; securityOrigin)
+    : m_url(url)
+    , m_initiator(initiator)
+    , m_loadTiming(loadTiming)
+    , m_networkLoadTiming(networkLoadTiming)
+    , m_allowTimingDetails(passesTimingAllowCheck(response, securityOrigin))
+{
+}
+
+ResourceTiming ResourceTiming::isolatedCopy() const
+{
+    return ResourceTiming(m_url.isolatedCopy(), m_initiator.isolatedCopy(), m_loadTiming.isolatedCopy(), m_networkLoadTiming.isolatedCopy(), m_allowTimingDetails);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceTimingh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/loader/ResourceTiming.h (0 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceTiming.h                                (rev 0)
+++ trunk/Source/WebCore/loader/ResourceTiming.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -0,0 +1,75 @@
</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 &quot;LoadTiming.h&quot;
+#include &quot;NetworkLoadTiming.h&quot;
+#include &quot;URL.h&quot;
+
+namespace WebCore {
+
+class CachedResource;
+class ResourceResponse;
+class SecurityOrigin;
+
+class ResourceTiming {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    static ResourceTiming fromCache(const URL&amp;, const String&amp; initiator, const LoadTiming&amp;);
+    static ResourceTiming fromLoad(CachedResource&amp;, const String&amp; initiator, const LoadTiming&amp;, const SecurityOrigin&amp;);
+    static ResourceTiming fromSynchronousLoad(const URL&amp;, const String&amp; initiator, const LoadTiming&amp;, const NetworkLoadTiming&amp;, const ResourceResponse&amp;, const SecurityOrigin&amp;);
+
+    URL url() const { return m_url; }
+    String initiator() const { return m_initiator; }
+    LoadTiming loadTiming() const { return m_loadTiming; }
+    NetworkLoadTiming networkLoadTiming() const { return m_networkLoadTiming; }
+    bool allowTimingDetails() const { return m_allowTimingDetails; }
+
+    ResourceTiming isolatedCopy() const;
+
+    void overrideInitiatorName(const String&amp; name) { m_initiator = name; }
+
+private:
+    ResourceTiming(CachedResource&amp;, const String&amp; initiator, const LoadTiming&amp;, const SecurityOrigin&amp;);
+    ResourceTiming(const URL&amp;, const String&amp; initiator, const LoadTiming&amp;, const NetworkLoadTiming&amp;, const ResourceResponse&amp;, const SecurityOrigin&amp;);
+    ResourceTiming(const URL&amp;, const String&amp; initiator, const LoadTiming&amp;);
+    ResourceTiming(const URL&amp; url, const String&amp; initiator, const LoadTiming&amp; loadTiming, const NetworkLoadTiming&amp; networkLoadTiming, bool allowTimingDetails)
+        : m_url(url)
+        , m_initiator(initiator)
+        , m_loadTiming(loadTiming)
+        , m_networkLoadTiming(networkLoadTiming)
+        , m_allowTimingDetails(allowTimingDetails)
+    {
+    }
+
+    URL m_url;
+    String m_initiator;
+    LoadTiming m_loadTiming;
+    NetworkLoadTiming m_networkLoadTiming;
+    bool m_allowTimingDetails { false };
+};
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceTimingInformationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceTimingInformation.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceTimingInformation.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/ResourceTimingInformation.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -35,31 +35,56 @@
</span><span class="cx"> #include &quot;HTMLFrameOwnerElement.h&quot;
</span><span class="cx"> #include &quot;LoadTiming.h&quot;
</span><span class="cx"> #include &quot;Performance.h&quot;
</span><ins>+#include &quot;ResourceTiming.h&quot;
</ins><span class="cx"> #include &quot;RuntimeEnabledFeatures.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-void ResourceTimingInformation::addResourceTiming(CachedResource* resource, Document&amp; document, const LoadTiming&amp; loadTiming)
</del><ins>+bool ResourceTimingInformation::shouldAddResourceTiming(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><ins>+    // FIXME: We can be less restrictive here.
+    // &lt;https://github.com/w3c/resource-timing/issues/100&gt;
+    if (!resource.resourceRequest().url().protocolIsInHTTPFamily())
+        return false;
+    if (resource.response().httpStatusCode() &gt;= 400)
+        return false;
+    if (resource.errorOccurred())
+        return false;
+    if (resource.wasCanceled())
+        return false;
+
+    return true;
+}
+
+void ResourceTimingInformation::addResourceTiming(CachedResource&amp; resource, Document&amp; document, ResourceTiming&amp;&amp; resourceTiming)
+{
</ins><span class="cx">     ASSERT(RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled());
</span><del>-    if (resource &amp;&amp; resource-&gt;resourceRequest().url().protocolIsInHTTPFamily()
-        &amp;&amp; ((!resource-&gt;errorOccurred() &amp;&amp; !resource-&gt;wasCanceled()) || resource-&gt;response().httpStatusCode() == 304)) {
-        auto initiatorIt = m_initiatorMap.find(resource);
-        if (initiatorIt != m_initiatorMap.end() &amp;&amp; initiatorIt-&gt;value.added == NotYetAdded) {
-            Document* initiatorDocument = &amp;document;
-            if (resource-&gt;type() == CachedResource::MainResource)
-                initiatorDocument = document.parentDocument();
-            if (!initiatorDocument)
-                return;
-            if (!initiatorDocument-&gt;domWindow())
-                return;
-            if (!initiatorDocument-&gt;domWindow()-&gt;performance())
-                return;
-            const InitiatorInfo&amp; info = initiatorIt-&gt;value;
-            initiatorDocument-&gt;domWindow()-&gt;performance()-&gt;addResourceTiming(info.name, resource-&gt;resourceRequest().url(), resource-&gt;response(), loadTiming);
-            initiatorIt-&gt;value.added = Added;
-        }
-    }
</del><ins>+    if (!ResourceTimingInformation::shouldAddResourceTiming(resource))
+        return;
+
+    auto iterator = m_initiatorMap.find(&amp;resource);
+    if (iterator == m_initiatorMap.end())
+        return;
+
+    InitiatorInfo&amp; info = iterator-&gt;value;
+    if (info.added == Added)
+        return;
+
+    Document* initiatorDocument = &amp;document;
+    if (resource.type() == CachedResource::MainResource)
+        initiatorDocument = document.parentDocument();
+    if (!initiatorDocument)
+        return;
+    if (!initiatorDocument-&gt;domWindow())
+        return;
+    if (!initiatorDocument-&gt;domWindow()-&gt;performance())
+        return;
+
+    resourceTiming.overrideInitiatorName(info.name);
+
+    initiatorDocument-&gt;domWindow()-&gt;performance()-&gt;addResourceTiming(WTFMove(resourceTiming));
+
+    info.added = Added;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ResourceTimingInformation::storeResourceTimingInitiatorInformation(const CachedResourceHandle&lt;CachedResource&gt;&amp; resource, const AtomicString&amp; initiatorName, Frame* frame)
</span><span class="lines">@@ -66,15 +91,16 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled());
</span><span class="cx">     ASSERT(resource.get());
</span><ins>+
</ins><span class="cx">     if (resource-&gt;type() == CachedResource::MainResource) {
</span><span class="cx">         // &lt;iframe&gt;s should report the initial navigation requested by the parent document, but not subsequent navigations.
</span><span class="cx">         ASSERT(frame);
</span><span class="cx">         if (frame-&gt;ownerElement()) {
</span><del>-            InitiatorInfo info = { frame-&gt;ownerElement()-&gt;localName(), monotonicallyIncreasingTime(), NotYetAdded };
</del><ins>+            InitiatorInfo info = { frame-&gt;ownerElement()-&gt;localName(), NotYetAdded };
</ins><span class="cx">             m_initiatorMap.add(resource.get(), info);
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><del>-        InitiatorInfo info = { initiatorName, monotonicallyIncreasingTime(), NotYetAdded };
</del><ins>+        InitiatorInfo info = { initiatorName, NotYetAdded };
</ins><span class="cx">         m_initiatorMap.add(resource.get(), info);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceTimingInformationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceTimingInformation.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceTimingInformation.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/ResourceTimingInformation.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -36,12 +36,13 @@
</span><span class="cx"> class CachedResource;
</span><span class="cx"> class Document;
</span><span class="cx"> class Frame;
</span><del>-class LoadTiming;
</del><ins>+class ResourceTiming;
</ins><span class="cx"> 
</span><span class="cx"> class ResourceTimingInformation {
</span><span class="cx"> public:
</span><ins>+    static bool shouldAddResourceTiming(CachedResource&amp;);
</ins><span class="cx"> 
</span><del>-    void addResourceTiming(CachedResource*, Document&amp;, const LoadTiming&amp;);
</del><ins>+    void addResourceTiming(CachedResource&amp;, Document&amp;, ResourceTiming&amp;&amp;);
</ins><span class="cx">     void storeResourceTimingInitiatorInformation(const CachedResourceHandle&lt;CachedResource&gt;&amp;, const AtomicString&amp;, Frame*);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -48,7 +49,6 @@
</span><span class="cx">     enum AlreadyAdded { NotYetAdded, Added };
</span><span class="cx">     struct InitiatorInfo {
</span><span class="cx">         AtomicString name;
</span><del>-        double startTime;
</del><span class="cx">         AlreadyAdded added;
</span><span class="cx">     };
</span><span class="cx">     HashMap&lt;CachedResource*, InitiatorInfo&gt; m_initiatorMap;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubresourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubresourceLoader.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;SubresourceLoader.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;CachedRawResource.h&quot;
</ins><span class="cx"> #include &quot;CachedResourceLoader.h&quot;
</span><span class="cx"> #include &quot;CrossOriginAccessControl.h&quot;
</span><span class="cx"> #include &quot;DiagnosticLoggingClient.h&quot;
</span><span class="lines">@@ -42,10 +43,10 @@
</span><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;ResourceLoadObserver.h&quot;
</span><ins>+#include &quot;ResourceTiming.h&quot;
</ins><span class="cx"> #include &quot;RuntimeEnabledFeatures.h&quot;
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCountedLeakCounter.h&gt;
</span><del>-#include &lt;wtf/SetForScope.h&gt;
</del><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -530,19 +531,19 @@
</span><span class="cx">     Ref&lt;SubresourceLoader&gt; protectedThis(*this);
</span><span class="cx">     CachedResourceHandle&lt;CachedResource&gt; protectResource(m_resource);
</span><span class="cx"> 
</span><del>-    // FIXME: The finishTime that is passed in is from the NetworkProcess and is more accurate.
</del><ins>+    // FIXME: &lt;https://webkit.org/b/168351&gt; [Resource Timing] Gather timing information with reliable responseEnd time
+    // The finishTime that is passed in is from the NetworkProcess and is more accurate.
</ins><span class="cx">     // However, all other load times are generated from the web process or offsets.
</span><span class="cx">     // Mixing times from different processes can cause the finish time to be earlier than
</span><del>-    // the response received time due to inter-process communication lag.
</del><ins>+    // the response received time due to inter-process communication lag. This could be solved
+    // by gathering NetworkLoadTiming information at completion time instead of at
+    // didReceiveResponse time.
</ins><span class="cx">     UNUSED_PARAM(finishTime);
</span><span class="cx">     MonotonicTime responseEndTime = MonotonicTime::now();
</span><span class="cx">     m_loadTiming.setResponseEnd(responseEndTime);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><del>-    if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled()) {
-        if (Document* document = m_documentLoader-&gt;cachedResourceLoader().document())
-            m_documentLoader-&gt;cachedResourceLoader().resourceTimingInformation().addResourceTiming(m_resource, *document, m_resource-&gt;loader()-&gt;loadTiming());
-    }
</del><ins>+    reportResourceTiming();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     m_state = Finishing;
</span><span class="lines">@@ -638,9 +639,9 @@
</span><span class="cx"> 
</span><span class="cx">     m_requestCountTracker = std::nullopt;
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    m_documentLoader-&gt;cachedResourceLoader().loadDone(m_resource, m_state != CancelledWhileInitializing);
</del><ins>+    m_documentLoader-&gt;cachedResourceLoader().loadDone(m_state != CancelledWhileInitializing);
</ins><span class="cx"> #else
</span><del>-    m_documentLoader-&gt;cachedResourceLoader().loadDone(m_resource);
</del><ins>+    m_documentLoader-&gt;cachedResourceLoader().loadDone();
</ins><span class="cx"> #endif
</span><span class="cx">     if (reachedTerminalState())
</span><span class="cx">         return;
</span><span class="lines">@@ -660,4 +661,35 @@
</span><span class="cx">     ResourceLoader::releaseResources();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEB_TIMING)
+void SubresourceLoader::reportResourceTiming()
+{
+    if (!RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
+        return;
+
+    if (!ResourceTimingInformation::shouldAddResourceTiming(*m_resource))
+        return;
+
+    Document* document = m_documentLoader-&gt;cachedResourceLoader().document();
+    if (!document)
+        return;
+    
+    SecurityOrigin&amp; origin = m_origin ? *m_origin : document-&gt;securityOrigin();
+    ResourceTiming resourceTiming = ResourceTiming::fromLoad(*m_resource, m_resource-&gt;initiatorName(), m_loadTiming, origin);
+
+    // Worker resources loaded here are all CachedRawResources loaded through WorkerThreadableLoader.
+    // Pass the ResourceTiming information on so that WorkerThreadableLoader may add them to the
+    // Worker's Performance object.
+    if (options().initiatorContext == InitiatorContext::Worker) {
+        ASSERT(m_origin);
+        ASSERT(is&lt;CachedRawResource&gt;(m_resource));
+        downcast&lt;CachedRawResource&gt;(*m_resource).finishedTimingForWorkerLoad(WTFMove(resourceTiming));
+        return;
+    }
+
+    ASSERT(options().initiatorContext == InitiatorContext::Document);
+    m_documentLoader-&gt;cachedResourceLoader().resourceTimingInformation().addResourceTiming(*m_resource, *document, WTFMove(resourceTiming));
</ins><span class="cx"> }
</span><ins>+#endif
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreloaderSubresourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubresourceLoader.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubresourceLoader.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/SubresourceLoader.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -102,6 +102,10 @@
</span><span class="cx"> 
</span><span class="cx">     void notifyDone();
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEB_TIMING)
+    void reportResourceTiming();
+#endif
+
</ins><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx">     bool shouldCreateQuickLookHandleForResponse(const ResourceResponse&amp;) const;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderThreadableLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ThreadableLoaderClient.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ThreadableLoaderClient.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/ThreadableLoaderClient.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> 
</span><span class="cx">     class ResourceError;
</span><span class="cx">     class ResourceResponse;
</span><ins>+    class ResourceTiming;
</ins><span class="cx"> 
</span><span class="cx">     class ThreadableLoaderClient {
</span><span class="cx">         WTF_MAKE_NONCOPYABLE(ThreadableLoaderClient); WTF_MAKE_FAST_ALLOCATED;
</span><span class="lines">@@ -45,6 +46,10 @@
</span><span class="cx">         virtual void didFinishLoading(unsigned long /*identifier*/, double /*finishTime*/) { }
</span><span class="cx">         virtual void didFail(const ResourceError&amp;) { }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEB_TIMING)
+        virtual void didFinishTiming(const ResourceTiming&amp;) { }
+#endif
+
</ins><span class="cx">     protected:
</span><span class="cx">         ThreadableLoaderClient() { }
</span><span class="cx">         virtual ~ThreadableLoaderClient() { }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderWorkerThreadableLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -35,9 +35,11 @@
</span><span class="cx"> #include &quot;ContentSecurityPolicy.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;DocumentThreadableLoader.h&quot;
</span><ins>+#include &quot;Performance.h&quot;
</ins><span class="cx"> #include &quot;ResourceError.h&quot;
</span><span class="cx"> #include &quot;ResourceRequest.h&quot;
</span><span class="cx"> #include &quot;ResourceResponse.h&quot;
</span><ins>+#include &quot;ResourceTiming.h&quot;
</ins><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #include &quot;ThreadableLoader.h&quot;
</span><span class="cx"> #include &quot;WorkerGlobalScope.h&quot;
</span><span class="lines">@@ -115,6 +117,10 @@
</span><span class="cx"> 
</span><span class="cx">     auto optionsCopy = std::make_unique&lt;LoaderTaskOptions&gt;(options, request.httpReferrer().isNull() ? outgoingReferrer : request.httpReferrer(), WTFMove(securityOriginCopy));
</span><span class="cx"> 
</span><ins>+    // All loads start out as Document. Inside WorkerThreadableLoader we upgrade this to a Worker load.
+    ASSERT(optionsCopy-&gt;options.initiatorContext == InitiatorContext::Document);
+    optionsCopy-&gt;options.initiatorContext = InitiatorContext::Worker;
+
</ins><span class="cx">     // Can we benefit from request being an r-value to create more efficiently its isolated copy?
</span><span class="cx">     m_loaderProxy.postTaskToLoader([this, request = request.isolatedCopy(), options = WTFMove(optionsCopy), contentSecurityPolicyCopy = WTFMove(contentSecurityPolicyCopy)](ScriptExecutionContext&amp; context) mutable {
</span><span class="cx">         ASSERT(isMainThread());
</span><span class="lines">@@ -171,8 +177,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WorkerThreadableLoader::MainThreadBridge::didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent)
</span><span class="cx"> {
</span><del>-    Ref&lt;ThreadableLoaderClientWrapper&gt; protectedWorkerClientWrapper = *m_workerClientWrapper;
-    m_loaderProxy.postTaskForModeToWorkerGlobalScope([protectedWorkerClientWrapper = WTFMove(protectedWorkerClientWrapper), bytesSent, totalBytesToBeSent] (ScriptExecutionContext&amp; context) mutable {
</del><ins>+    m_loaderProxy.postTaskForModeToWorkerGlobalScope([protectedWorkerClientWrapper = makeRef(*m_workerClientWrapper), bytesSent, totalBytesToBeSent] (ScriptExecutionContext&amp; context) mutable {
</ins><span class="cx">         ASSERT_UNUSED(context, context.isWorkerGlobalScope());
</span><span class="cx">         protectedWorkerClientWrapper-&gt;didSendData(bytesSent, totalBytesToBeSent);
</span><span class="cx">     }, m_taskMode);
</span><span class="lines">@@ -180,8 +185,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WorkerThreadableLoader::MainThreadBridge::didReceiveResponse(unsigned long identifier, const ResourceResponse&amp; response)
</span><span class="cx"> {
</span><del>-    Ref&lt;ThreadableLoaderClientWrapper&gt; protectedWorkerClientWrapper = *m_workerClientWrapper;
-    m_loaderProxy.postTaskForModeToWorkerGlobalScope([protectedWorkerClientWrapper = WTFMove(protectedWorkerClientWrapper), identifier, responseData = response.crossThreadData()] (ScriptExecutionContext&amp; context) mutable {
</del><ins>+    m_loaderProxy.postTaskForModeToWorkerGlobalScope([protectedWorkerClientWrapper = makeRef(*m_workerClientWrapper), identifier, responseData = response.crossThreadData()] (ScriptExecutionContext&amp; context) mutable {
</ins><span class="cx">         ASSERT_UNUSED(context, context.isWorkerGlobalScope());
</span><span class="cx">         protectedWorkerClientWrapper-&gt;didReceiveResponse(identifier, ResourceResponse::fromCrossThreadData(WTFMove(responseData)));
</span><span class="cx">     }, m_taskMode);
</span><span class="lines">@@ -189,10 +193,9 @@
</span><span class="cx"> 
</span><span class="cx"> void WorkerThreadableLoader::MainThreadBridge::didReceiveData(const char* data, int dataLength)
</span><span class="cx"> {
</span><del>-    Ref&lt;ThreadableLoaderClientWrapper&gt; protectedWorkerClientWrapper = *m_workerClientWrapper;
</del><span class="cx">     Vector&lt;char&gt; vector(dataLength);
</span><span class="cx">     memcpy(vector.data(), data, dataLength);
</span><del>-    m_loaderProxy.postTaskForModeToWorkerGlobalScope([protectedWorkerClientWrapper = WTFMove(protectedWorkerClientWrapper), vector = WTFMove(vector)] (ScriptExecutionContext&amp; context) mutable {
</del><ins>+    m_loaderProxy.postTaskForModeToWorkerGlobalScope([protectedWorkerClientWrapper = makeRef(*m_workerClientWrapper), vector = WTFMove(vector)] (ScriptExecutionContext&amp; context) mutable {
</ins><span class="cx">         ASSERT_UNUSED(context, context.isWorkerGlobalScope());
</span><span class="cx">         protectedWorkerClientWrapper-&gt;didReceiveData(vector.data(), vector.size());
</span><span class="cx">     }, m_taskMode);
</span><span class="lines">@@ -201,8 +204,7 @@
</span><span class="cx"> void WorkerThreadableLoader::MainThreadBridge::didFinishLoading(unsigned long identifier, double finishTime)
</span><span class="cx"> {
</span><span class="cx">     m_loadingFinished = true;
</span><del>-    Ref&lt;ThreadableLoaderClientWrapper&gt; protectedWorkerClientWrapper = *m_workerClientWrapper;
-    m_loaderProxy.postTaskForModeToWorkerGlobalScope([protectedWorkerClientWrapper = WTFMove(protectedWorkerClientWrapper), identifier, finishTime] (ScriptExecutionContext&amp; context) mutable {
</del><ins>+    m_loaderProxy.postTaskForModeToWorkerGlobalScope([protectedWorkerClientWrapper = makeRef(*m_workerClientWrapper), identifier, finishTime] (ScriptExecutionContext&amp; context) mutable {
</ins><span class="cx">         ASSERT_UNUSED(context, context.isWorkerGlobalScope());
</span><span class="cx">         protectedWorkerClientWrapper-&gt;didFinishLoading(identifier, finishTime);
</span><span class="cx">     }, m_taskMode);
</span><span class="lines">@@ -220,4 +222,17 @@
</span><span class="cx">     }, m_taskMode);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEB_TIMING)
+void WorkerThreadableLoader::MainThreadBridge::didFinishTiming(const ResourceTiming&amp; resourceTiming)
+{
+    m_loaderProxy.postTaskForModeToWorkerGlobalScope([protectedWorkerClientWrapper = makeRef(*m_workerClientWrapper), resourceTiming = resourceTiming.isolatedCopy()] (ScriptExecutionContext&amp; context) mutable {
+        ASSERT(context.isWorkerGlobalScope());
+        ASSERT(!resourceTiming.initiator().isEmpty());
+
+        // No need to notify clients, just add the performance timing entry.
+        downcast&lt;WorkerGlobalScope&gt;(context).performance().addResourceTiming(WTFMove(resourceTiming));
+    }, m_taskMode);
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderWorkerThreadableLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/WorkerThreadableLoader.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/WorkerThreadableLoader.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/WorkerThreadableLoader.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -104,6 +104,10 @@
</span><span class="cx">             void didFinishLoading(unsigned long identifier, double finishTime) override;
</span><span class="cx">             void didFail(const ResourceError&amp;) override;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEB_TIMING)
+            void didFinishTiming(const ResourceTiming&amp;) override;
+#endif
+
</ins><span class="cx">             // Only to be used on the main thread.
</span><span class="cx">             RefPtr&lt;ThreadableLoader&gt; m_mainThreadLoader;
</span><span class="cx">             bool m_loadingFinished { false };
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedRawResourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedRawResource.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedRawResource.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -204,6 +204,13 @@
</span><span class="cx">         c-&gt;dataSent(*this, bytesSent, totalBytesToBeSent);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CachedRawResource::finishedTimingForWorkerLoad(ResourceTiming&amp;&amp; resourceTiming)
+{
+    CachedResourceClientWalker&lt;CachedRawResourceClient&gt; w(m_clients);
+    while (CachedRawResourceClient* c = w.next())
+        c-&gt;finishedTimingForWorkerLoad(*this, resourceTiming);
+}
+
</ins><span class="cx"> void CachedRawResource::switchClientsToRevalidatedResource()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_loader);
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedRawResourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedRawResource.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedRawResource.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CachedResourceClient;
</span><ins>+class ResourceTiming;
</ins><span class="cx"> class SubresourceLoader;
</span><span class="cx"> 
</span><span class="cx"> class CachedRawResource final : public CachedResource {
</span><span class="lines">@@ -40,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void setDataBufferingPolicy(DataBufferingPolicy);
</span><span class="cx"> 
</span><del>-    // FIXME: This is exposed for the InpsectorInstrumentation for preflights in DocumentThreadableLoader. It's also really lame.
</del><ins>+    // FIXME: This is exposed for the InspectorInstrumentation for preflights in DocumentThreadableLoader. It's also really lame.
</ins><span class="cx">     unsigned long identifier() const { return m_identifier; }
</span><span class="cx"> 
</span><span class="cx">     void clear();
</span><span class="lines">@@ -49,6 +50,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool wasRedirected() const { return !m_redirectChain.isEmpty(); };
</span><span class="cx"> 
</span><ins>+    void finishedTimingForWorkerLoad(ResourceTiming&amp;&amp;);
+
</ins><span class="cx"> private:
</span><span class="cx">     void didAddClient(CachedResourceClient&amp;) final;
</span><span class="cx">     void addDataBuffer(SharedBuffer&amp;) final;
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedRawResourceClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedRawResourceClient.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedRawResourceClient.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/cache/CachedRawResourceClient.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> class CachedResource;
</span><span class="cx"> class ResourceRequest;
</span><span class="cx"> class ResourceResponse;
</span><ins>+class ResourceTiming;
</ins><span class="cx"> 
</span><span class="cx"> class CachedRawResourceClient : public CachedResourceClient {
</span><span class="cx"> public:
</span><span class="lines">@@ -41,6 +42,7 @@
</span><span class="cx">     virtual bool shouldCacheResponse(CachedResource&amp;, const ResourceResponse&amp;) { return true; }
</span><span class="cx">     virtual void dataReceived(CachedResource&amp;, const char* /* data */, int /* length */) { }
</span><span class="cx">     virtual void redirectReceived(CachedResource&amp;, ResourceRequest&amp;, const ResourceResponse&amp;) { }
</span><ins>+    virtual void finishedTimingForWorkerLoad(CachedResource&amp;, const ResourceTiming&amp;) { }
</ins><span class="cx"> #if USE(SOUP)
</span><span class="cx">     virtual char* getOrCreateReadBuffer(CachedResource&amp;, size_t /* requestedSize */, size_t&amp; /* actualSize */) { return nullptr; }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -121,6 +121,7 @@
</span><span class="cx">     , m_responseTimestamp(std::chrono::system_clock::now())
</span><span class="cx">     , m_fragmentIdentifierForRequest(request.releaseFragmentIdentifier())
</span><span class="cx">     , m_origin(request.releaseOrigin())
</span><ins>+    , m_initiatorName(request.initiatorName())
</ins><span class="cx">     , m_isLinkPreload(request.isLinkPreload())
</span><span class="cx">     , m_type(type)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> class CachedResourceHandleBase;
</span><span class="cx"> class CachedResourceLoader;
</span><span class="cx"> class CachedResourceRequest;
</span><del>-class InspectorResource;
</del><ins>+class LoadTiming;
</ins><span class="cx"> class MemoryCache;
</span><span class="cx"> class SecurityOrigin;
</span><span class="cx"> class SharedBuffer;
</span><span class="lines">@@ -58,7 +58,6 @@
</span><span class="cx"> class CachedResource {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(CachedResource); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx">     friend class MemoryCache;
</span><del>-    friend class InspectorResource;
</del><span class="cx"> 
</span><span class="cx"> public:
</span><span class="cx">     enum Type {
</span><span class="lines">@@ -206,6 +205,7 @@
</span><span class="cx">     void loadFrom(const CachedResource&amp;);
</span><span class="cx"> 
</span><span class="cx">     SecurityOrigin* origin() const { return m_origin.get(); }
</span><ins>+    AtomicString initiatorName() const { return m_initiatorName; }
</ins><span class="cx"> 
</span><span class="cx">     bool canDelete() const { return !hasClients() &amp;&amp; !m_loader &amp;&amp; !m_preloadCount &amp;&amp; !m_handleCount &amp;&amp; !m_resourceToRevalidate &amp;&amp; !m_proxyResource; }
</span><span class="cx">     bool hasOneHandle() const { return m_handleCount == 1; }
</span><span class="lines">@@ -320,6 +320,7 @@
</span><span class="cx"> 
</span><span class="cx">     ResourceError m_error;
</span><span class="cx">     RefPtr&lt;SecurityOrigin&gt; m_origin;
</span><ins>+    AtomicString m_initiatorName;
</ins><span class="cx"> 
</span><span class="cx">     double m_lastDecodedAccessTime { 0 }; // Used as a &quot;thrash guard&quot; in the cache
</span><span class="cx">     double m_loadFinishTime { 0 };
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -28,11 +28,11 @@
</span><span class="cx"> #include &quot;CachedResourceLoader.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CachedCSSStyleSheet.h&quot;
</span><del>-#include &quot;CachedSVGDocument.h&quot;
</del><span class="cx"> #include &quot;CachedFont.h&quot;
</span><span class="cx"> #include &quot;CachedImage.h&quot;
</span><span class="cx"> #include &quot;CachedRawResource.h&quot;
</span><span class="cx"> #include &quot;CachedResourceRequest.h&quot;
</span><ins>+#include &quot;CachedSVGDocument.h&quot;
</ins><span class="cx"> #include &quot;CachedSVGFont.h&quot;
</span><span class="cx"> #include &quot;CachedScript.h&quot;
</span><span class="cx"> #include &quot;CachedXSLStyleSheet.h&quot;
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx"> #include &quot;PlatformStrategies.h&quot;
</span><span class="cx"> #include &quot;RenderElement.h&quot;
</span><span class="cx"> #include &quot;ResourceLoadInfo.h&quot;
</span><ins>+#include &quot;ResourceTiming.h&quot;
</ins><span class="cx"> #include &quot;RuntimeEnabledFeatures.h&quot;
</span><span class="cx"> #include &quot;ScriptController.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="lines">@@ -715,6 +716,7 @@
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><span class="cx">     LoadTiming loadTiming;
</span><span class="cx">     loadTiming.markStartTimeAndFetchStart();
</span><ins>+    InitiatorContext initiatorContext = request.options().initiatorContext;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (request.resourceRequest().url().protocolIsInHTTPFamily())
</span><span class="lines">@@ -769,12 +771,18 @@
</span><span class="cx">             logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheEntryDecisionKey(), DiagnosticLoggingKeys::usedKey());
</span><span class="cx">             memoryCache.resourceAccessed(*resource);
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><del>-            if (document() &amp;&amp; RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled()) {
-                // FIXME (161170): The networkLoadTiming shouldn't be stored on the ResourceResponse.
-                resource-&gt;response().networkLoadTiming().reset();
-                loadTiming.setResponseEnd(MonotonicTime::now());
-                m_resourceTimingInfo.storeResourceTimingInitiatorInformation(resource, request.initiatorName(), frame());
-                m_resourceTimingInfo.addResourceTiming(resource.get(), *document(), loadTiming);
</del><ins>+            loadTiming.setResponseEnd(MonotonicTime::now());
+
+            if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled()) {
+                ResourceTiming resourceTiming = ResourceTiming::fromCache(url, request.initiatorName(), loadTiming);
+                if (initiatorContext == InitiatorContext::Worker) {
+                    ASSERT(is&lt;CachedRawResource&gt;(resource.get()));
+                    downcast&lt;CachedRawResource&gt;(resource.get())-&gt;finishedTimingForWorkerLoad(WTFMove(resourceTiming));
+                } else if (document()) {
+                    ASSERT(initiatorContext == InitiatorContext::Document);
+                    m_resourceTimingInfo.storeResourceTimingInitiatorInformation(resource, request.initiatorName(), frame());
+                    m_resourceTimingInfo.addResourceTiming(*resource.get(), *document(), WTFMove(resourceTiming));
+                }
</ins><span class="cx">             }
</span><span class="cx"> #endif
</span><span class="cx">             if (forPreload == ForPreload::No)
</span><span class="lines">@@ -825,9 +833,6 @@
</span><span class="cx">     ASSERT(resource.sessionID() == sessionID());
</span><span class="cx">     ASSERT(resource.allowsCaching());
</span><span class="cx"> 
</span><del>-#if ENABLE(WEB_TIMING)
-    AtomicString initiatorName = request.initiatorName();
-#endif
</del><span class="cx">     CachedResourceHandle&lt;CachedResource&gt; newResource = createResource(resource.type(), WTFMove(request), resource.sessionID());
</span><span class="cx"> 
</span><span class="cx">     LOG(ResourceLoading, &quot;Resource %p created to revalidate %p&quot;, newResource.get(), &amp;resource);
</span><span class="lines">@@ -837,7 +842,7 @@
</span><span class="cx">     memoryCache.add(*newResource);
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><span class="cx">     if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
</span><del>-        m_resourceTimingInfo.storeResourceTimingInitiatorInformation(newResource, initiatorName, frame());
</del><ins>+        m_resourceTimingInfo.storeResourceTimingInitiatorInformation(newResource, newResource-&gt;initiatorName(), frame());
</ins><span class="cx"> #endif
</span><span class="cx">     return newResource;
</span><span class="cx"> }
</span><span class="lines">@@ -850,9 +855,6 @@
</span><span class="cx"> 
</span><span class="cx">     LOG(ResourceLoading, &quot;Loading CachedResource for '%s'.&quot;, request.resourceRequest().url().stringCenterEllipsizedToLength().latin1().data());
</span><span class="cx"> 
</span><del>-#if ENABLE(WEB_TIMING)
-    AtomicString initiatorName = request.initiatorName();
-#endif
</del><span class="cx">     CachedResourceHandle&lt;CachedResource&gt; resource = createResource(type, WTFMove(request), sessionID());
</span><span class="cx"> 
</span><span class="cx">     if (resource-&gt;allowsCaching() &amp;&amp; !memoryCache.add(*resource))
</span><span class="lines">@@ -859,7 +861,7 @@
</span><span class="cx">         resource-&gt;setOwningCachedResourceLoader(this);
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><span class="cx">     if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
</span><del>-        m_resourceTimingInfo.storeResourceTimingInitiatorInformation(resource, initiatorName, frame());
</del><ins>+        m_resourceTimingInfo.storeResourceTimingInitiatorInformation(resource, resource-&gt;initiatorName(), frame());
</ins><span class="cx"> #endif
</span><span class="cx">     return resource;
</span><span class="cx"> }
</span><span class="lines">@@ -1140,18 +1142,11 @@
</span><span class="cx">     m_documentResources.remove(resource.url());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CachedResourceLoader::loadDone(CachedResource* resource, bool shouldPerformPostLoadActions)
</del><ins>+void CachedResourceLoader::loadDone(bool shouldPerformPostLoadActions)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;DocumentLoader&gt; protectDocumentLoader(m_documentLoader);
</span><span class="cx">     RefPtr&lt;Document&gt; protectDocument(m_document);
</span><span class="cx"> 
</span><del>-#if ENABLE(WEB_TIMING)
-    if (resource &amp;&amp; document() &amp;&amp; RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
-        m_resourceTimingInfo.addResourceTiming(resource, *document(), resource-&gt;loader()-&gt;loadTiming());
-#else
-    UNUSED_PARAM(resource);
-#endif
-
</del><span class="cx">     if (frame())
</span><span class="cx">         frame()-&gt;loader().loadDone();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx"> 
</span><span class="cx">     void removeCachedResource(CachedResource&amp;);
</span><span class="cx"> 
</span><del>-    void loadDone(CachedResource*, bool shouldPerformPostLoadActions = true);
</del><ins>+    void loadDone(bool shouldPerformPostLoadActions = true);
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void garbageCollectDocumentResources();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx">     if (!m_initiatorName.isEmpty())
</span><span class="cx">         return m_initiatorName;
</span><span class="cx"> 
</span><del>-    static NeverDestroyed&lt;AtomicString&gt; defaultName(&quot;resource&quot;, AtomicString::ConstructFromLiteral);
</del><ins>+    static NeverDestroyed&lt;AtomicString&gt; defaultName(&quot;other&quot;, AtomicString::ConstructFromLiteral);
</ins><span class="cx">     return defaultName;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventSource.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventSource.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/page/EventSource.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -78,6 +78,7 @@
</span><span class="cx">     void refEventTarget() final { ref(); }
</span><span class="cx">     void derefEventTarget() final { deref(); }
</span><span class="cx"> 
</span><ins>+    // ThreadableLoaderClient
</ins><span class="cx">     void didReceiveResponse(unsigned long, const ResourceResponse&amp;) final;
</span><span class="cx">     void didReceiveData(const char*, int) final;
</span><span class="cx">     void didFinishLoading(unsigned long, double) final;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformancecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Performance.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Performance.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/page/Performance.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -168,26 +168,21 @@
</span><span class="cx"> void Performance::setResourceTimingBufferSize(unsigned size)
</span><span class="cx"> {
</span><span class="cx">     m_resourceTimingBufferSize = size;
</span><del>-
-    if (isResourceTimingBufferFull())
-        dispatchEvent(Event::create(eventNames().resourcetimingbufferfullEvent, false, false));
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Performance::addResourceTiming(const String&amp; initiatorName, const URL&amp; originalURL, const ResourceResponse&amp; response, const LoadTiming&amp; loadTiming)
</del><ins>+void Performance::addResourceTiming(ResourceTiming&amp;&amp; resourceTiming)
</ins><span class="cx"> {
</span><ins>+    RefPtr&lt;PerformanceResourceTiming&gt; entry = PerformanceResourceTiming::create(m_timeOrigin, WTFMove(resourceTiming));
+
+    queueEntry(*entry);
+
</ins><span class="cx">     if (isResourceTimingBufferFull())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    SecurityOrigin* securityOrigin = scriptExecutionContext()-&gt;securityOrigin();
-    if (!securityOrigin)
-        return;
-
-    RefPtr&lt;PerformanceEntry&gt; entry = PerformanceResourceTiming::create(initiatorName, originalURL, m_timeOrigin, response, *securityOrigin, loadTiming);
-
</del><span class="cx">     m_resourceTimingBuffer.append(entry);
</span><span class="cx"> 
</span><span class="cx">     if (isResourceTimingBufferFull())
</span><del>-        dispatchEvent(Event::create(eventNames().resourcetimingbufferfullEvent, false, false));
</del><ins>+        dispatchEvent(Event::create(eventNames().resourcetimingbufferfullEvent, true, false));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Performance::isResourceTimingBufferFull() const
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Performance.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Performance.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/page/Performance.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> class PerformanceObserver;
</span><span class="cx"> class PerformanceTiming;
</span><span class="cx"> class ResourceResponse;
</span><ins>+class ResourceTiming;
</ins><span class="cx"> class ScriptExecutionContext;
</span><span class="cx"> class URL;
</span><span class="cx"> class UserTiming;
</span><span class="lines">@@ -69,8 +70,6 @@
</span><span class="cx">     void clearResourceTimings();
</span><span class="cx">     void setResourceTimingBufferSize(unsigned);
</span><span class="cx"> 
</span><del>-    void addResourceTiming(const String&amp; initiatorName, const URL&amp; originalURL, const ResourceResponse&amp;, const LoadTiming&amp;);
-
</del><span class="cx">     ExceptionOr&lt;void&gt; mark(const String&amp; markName);
</span><span class="cx">     void clearMarks(const String&amp; markName);
</span><span class="cx"> 
</span><span class="lines">@@ -77,6 +76,8 @@
</span><span class="cx">     ExceptionOr&lt;void&gt; measure(const String&amp; measureName, const String&amp; startMark, const String&amp; endMark);
</span><span class="cx">     void clearMeasures(const String&amp; measureName);
</span><span class="cx"> 
</span><ins>+    void addResourceTiming(ResourceTiming&amp;&amp;);
+
</ins><span class="cx">     void registerPerformanceObserver(PerformanceObserver&amp;);
</span><span class="cx">     void unregisterPerformanceObserver(PerformanceObserver&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceResourceTimingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceResourceTiming.cpp (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceResourceTiming.cpp        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/page/PerformanceResourceTiming.cpp        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -36,12 +36,10 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;DocumentLoader.h&quot;
</span><del>-#include &quot;HTTPHeaderNames.h&quot;
</del><span class="cx"> #include &quot;LoadTiming.h&quot;
</span><ins>+#include &quot;ResourceResponse.h&quot;
+#include &quot;ResourceTiming.h&quot;
</ins><span class="cx"> #include &quot;URL.h&quot;
</span><del>-#include &quot;ResourceResponse.h&quot;
-#include &quot;SecurityOrigin.h&quot;
-#include &lt;wtf/Vector.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -55,37 +53,18 @@
</span><span class="cx">     return Performance::reduceTimeResolution(seconds).milliseconds();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool passesTimingAllowCheck(const ResourceResponse&amp; response, const SecurityOrigin&amp; initiatorSecurityOrigin)
</del><ins>+Ref&lt;PerformanceResourceTiming&gt; PerformanceResourceTiming::create(MonotonicTime timeOrigin, ResourceTiming&amp;&amp; resourceTiming)
</ins><span class="cx"> {
</span><del>-    Ref&lt;SecurityOrigin&gt; resourceOrigin = SecurityOrigin::create(response.url());
-    if (resourceOrigin-&gt;isSameSchemeHostPort(initiatorSecurityOrigin))
-        return true;
-
-    const String&amp; timingAllowOriginString = response.httpHeaderField(HTTPHeaderName::TimingAllowOrigin);
-    if (timingAllowOriginString.isEmpty() || equalLettersIgnoringASCIICase(timingAllowOriginString, &quot;null&quot;))
-        return false;
-
-    if (timingAllowOriginString == &quot;*&quot;)
-        return true;
-
-    const String&amp; securityOrigin = initiatorSecurityOrigin.toString();
-    Vector&lt;String&gt; timingAllowOrigins;
-    timingAllowOriginString.split(' ', timingAllowOrigins);
-    for (auto&amp; origin : timingAllowOrigins) {
-        if (origin == securityOrigin)
-            return true;
-    }
-
-    return false;
</del><ins>+    return adoptRef(*new PerformanceResourceTiming(timeOrigin, WTFMove(resourceTiming)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-PerformanceResourceTiming::PerformanceResourceTiming(const AtomicString&amp; initiatorType, const URL&amp; originalURL, MonotonicTime timeOrigin, const ResourceResponse&amp; response, const SecurityOrigin&amp; initiatorSecurityOrigin, LoadTiming loadTiming)
-    : PerformanceEntry(PerformanceEntry::Type::Resource, originalURL.string(), ASCIILiteral(&quot;resource&quot;), monotonicTimeToDOMHighResTimeStamp(timeOrigin, loadTiming.startTime()), monotonicTimeToDOMHighResTimeStamp(timeOrigin, loadTiming.responseEnd()))
-    , m_initiatorType(initiatorType)
</del><ins>+PerformanceResourceTiming::PerformanceResourceTiming(MonotonicTime timeOrigin, ResourceTiming&amp;&amp; resourceTiming)
+    : PerformanceEntry(PerformanceEntry::Type::Resource, resourceTiming.url().string(), ASCIILiteral(&quot;resource&quot;), monotonicTimeToDOMHighResTimeStamp(timeOrigin, resourceTiming.loadTiming().startTime()), monotonicTimeToDOMHighResTimeStamp(timeOrigin, resourceTiming.loadTiming().responseEnd()))
+    , m_initiatorType(resourceTiming.initiator())
</ins><span class="cx">     , m_timeOrigin(timeOrigin)
</span><del>-    , m_timing(response.networkLoadTiming())
-    , m_loadTiming(loadTiming)
-    , m_shouldReportDetails(passesTimingAllowCheck(response, initiatorSecurityOrigin))
</del><ins>+    , m_loadTiming(resourceTiming.loadTiming())
+    , m_networkLoadTiming(resourceTiming.networkLoadTiming())
+    , m_shouldReportDetails(resourceTiming.allowTimingDetails())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -116,6 +95,9 @@
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::fetchStart() const
</span><span class="cx"> {
</span><ins>+    // fetchStart is a required property.
+    ASSERT(m_loadTiming.fetchStart());
+
</ins><span class="cx">     return monotonicTimeToDOMHighResTimeStamp(m_timeOrigin, m_loadTiming.fetchStart());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -124,10 +106,10 @@
</span><span class="cx">     if (!m_shouldReportDetails)
</span><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><del>-    if (m_timing.domainLookupStart &lt;= 0)
</del><ins>+    if (m_networkLoadTiming.domainLookupStart &lt;= 0)
</ins><span class="cx">         return fetchStart();
</span><span class="cx"> 
</span><del>-    return networkLoadTimeToDOMHighResTimeStamp(m_timing.domainLookupStart);
</del><ins>+    return networkLoadTimeToDOMHighResTimeStamp(m_networkLoadTiming.domainLookupStart);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::domainLookupEnd() const
</span><span class="lines">@@ -135,10 +117,10 @@
</span><span class="cx">     if (!m_shouldReportDetails)
</span><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><del>-    if (m_timing.domainLookupEnd &lt;= 0)
</del><ins>+    if (m_networkLoadTiming.domainLookupEnd &lt;= 0)
</ins><span class="cx">         return domainLookupStart();
</span><span class="cx"> 
</span><del>-    return networkLoadTimeToDOMHighResTimeStamp(m_timing.domainLookupEnd);
</del><ins>+    return networkLoadTimeToDOMHighResTimeStamp(m_networkLoadTiming.domainLookupEnd);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::connectStart() const
</span><span class="lines">@@ -147,13 +129,13 @@
</span><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><span class="cx">     // connectStart will be -1 when a network request is not made.
</span><del>-    if (m_timing.connectStart &lt;= 0)
</del><ins>+    if (m_networkLoadTiming.connectStart &lt;= 0)
</ins><span class="cx">         return domainLookupEnd();
</span><span class="cx"> 
</span><span class="cx">     // connectStart includes any DNS time, so we may need to trim that off.
</span><del>-    double connectStart = m_timing.connectStart;
-    if (m_timing.domainLookupEnd &gt;= 0)
-        connectStart = m_timing.domainLookupEnd;
</del><ins>+    double connectStart = m_networkLoadTiming.connectStart;
+    if (m_networkLoadTiming.domainLookupEnd &gt;= 0)
+        connectStart = m_networkLoadTiming.domainLookupEnd;
</ins><span class="cx"> 
</span><span class="cx">     return networkLoadTimeToDOMHighResTimeStamp(connectStart);
</span><span class="cx"> }
</span><span class="lines">@@ -164,10 +146,10 @@
</span><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><span class="cx">     // connectStart will be -1 when a network request is not made.
</span><del>-    if (m_timing.connectEnd &lt;= 0)
</del><ins>+    if (m_networkLoadTiming.connectEnd &lt;= 0)
</ins><span class="cx">         return connectStart();
</span><span class="cx"> 
</span><del>-    return networkLoadTimeToDOMHighResTimeStamp(m_timing.connectEnd);
</del><ins>+    return networkLoadTimeToDOMHighResTimeStamp(m_networkLoadTiming.connectEnd);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::secureConnectionStart() const
</span><span class="lines">@@ -175,10 +157,10 @@
</span><span class="cx">     if (!m_shouldReportDetails)
</span><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><del>-    if (m_timing.secureConnectionStart &lt; 0) // Secure connection not negotiated.
</del><ins>+    if (m_networkLoadTiming.secureConnectionStart &lt; 0) // Secure connection not negotiated.
</ins><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><del>-    return networkLoadTimeToDOMHighResTimeStamp(m_timing.secureConnectionStart);
</del><ins>+    return networkLoadTimeToDOMHighResTimeStamp(m_networkLoadTiming.secureConnectionStart);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::requestStart() const
</span><span class="lines">@@ -186,7 +168,11 @@
</span><span class="cx">     if (!m_shouldReportDetails)
</span><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><del>-    return networkLoadTimeToDOMHighResTimeStamp(m_timing.requestStart);
</del><ins>+    // requestStart is 0 when a network request is not made.
+    if (m_networkLoadTiming.requestStart &lt;= 0)
+        return connectEnd();
+
+    return networkLoadTimeToDOMHighResTimeStamp(m_networkLoadTiming.requestStart);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::responseStart() const
</span><span class="lines">@@ -194,13 +180,17 @@
</span><span class="cx">     if (!m_shouldReportDetails)
</span><span class="cx">         return 0.0;
</span><span class="cx"> 
</span><del>-    return networkLoadTimeToDOMHighResTimeStamp(m_timing.responseStart);
</del><ins>+    // responseStart is 0 when a network request is not made.
+    if (m_networkLoadTiming.responseStart &lt;= 0)
+        return requestStart();
+
+    return networkLoadTimeToDOMHighResTimeStamp(m_networkLoadTiming.responseStart);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::responseEnd() const
</span><span class="cx"> {
</span><del>-    if (!m_shouldReportDetails)
-        return 0.0;
</del><ins>+    // responseEnd is a required property.
+    ASSERT(m_loadTiming.responseEnd());
</ins><span class="cx"> 
</span><span class="cx">     return monotonicTimeToDOMHighResTimeStamp(m_timeOrigin, m_loadTiming.responseEnd());
</span><span class="cx"> }
</span><span class="lines">@@ -207,9 +197,7 @@
</span><span class="cx"> 
</span><span class="cx"> double PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp(double deltaMilliseconds) const
</span><span class="cx"> {
</span><del>-    if (!deltaMilliseconds)
-        return 0.0;
-
</del><ins>+    ASSERT(deltaMilliseconds);
</ins><span class="cx">     MonotonicTime combined = m_loadTiming.fetchStart() + Seconds::fromMilliseconds(deltaMilliseconds);
</span><span class="cx">     Seconds delta = combined - m_timeOrigin;
</span><span class="cx">     return Performance::reduceTimeResolution(delta).milliseconds();
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceResourceTimingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceResourceTiming.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceResourceTiming.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/page/PerformanceResourceTiming.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -41,16 +41,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class ResourceResponse;
-class SecurityOrigin;
-class URL;
</del><ins>+class ResourceTiming;
</ins><span class="cx"> 
</span><span class="cx"> class PerformanceResourceTiming final : public PerformanceEntry {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;PerformanceResourceTiming&gt; create(const AtomicString&amp; initiatorType, const URL&amp; originalURL, MonotonicTime timeOrigin, const ResourceResponse&amp; response, const SecurityOrigin&amp; initiatorSecurityOrigin, LoadTiming loadTiming)
-    {
-        return adoptRef(*new PerformanceResourceTiming(initiatorType, originalURL, timeOrigin, response, initiatorSecurityOrigin, loadTiming));
-    }
</del><ins>+    static Ref&lt;PerformanceResourceTiming&gt; create(MonotonicTime timeOrigin, ResourceTiming&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     AtomicString initiatorType() const { return m_initiatorType; }
</span><span class="cx"> 
</span><span class="lines">@@ -70,7 +65,7 @@
</span><span class="cx">     bool isResource() const override { return true; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    PerformanceResourceTiming(const AtomicString&amp; initatorType, const URL&amp; originalURL, MonotonicTime timeOrigin, const ResourceResponse&amp;, const SecurityOrigin&amp;, LoadTiming);
</del><ins>+    PerformanceResourceTiming(MonotonicTime timeOrigin, ResourceTiming&amp;&amp;);
</ins><span class="cx">     ~PerformanceResourceTiming();
</span><span class="cx"> 
</span><span class="cx">     double networkLoadTimeToDOMHighResTimeStamp(double deltaMilliseconds) const;
</span><span class="lines">@@ -77,8 +72,8 @@
</span><span class="cx"> 
</span><span class="cx">     AtomicString m_initiatorType;
</span><span class="cx">     MonotonicTime m_timeOrigin;
</span><del>-    NetworkLoadTiming m_timing;
</del><span class="cx">     LoadTiming m_loadTiming;
</span><ins>+    NetworkLoadTiming m_networkLoadTiming;
</ins><span class="cx">     bool m_shouldReportDetails;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceResourceTimingidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceResourceTiming.idl (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceResourceTiming.idl        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/page/PerformanceResourceTiming.idl        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -34,7 +34,8 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=WEB_TIMING,
</span><del>-    EnabledAtRuntime=ResourceTiming
</del><ins>+    EnabledAtRuntime=ResourceTiming,
+    Exposed=(Window,Worker),
</ins><span class="cx"> ] interface PerformanceResourceTiming : PerformanceEntry {
</span><span class="cx">     readonly attribute DOMString initiatorType;
</span><span class="cx"> 
</span><span class="lines">@@ -50,4 +51,6 @@
</span><span class="cx">     readonly attribute DOMHighResTimeStamp requestStart;
</span><span class="cx">     readonly attribute DOMHighResTimeStamp responseStart;
</span><span class="cx">     readonly attribute DOMHighResTimeStamp responseEnd;
</span><ins>+
+    serializer = { inherit, attribute };
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkNetworkLoadTimingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/NetworkLoadTiming.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/NetworkLoadTiming.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/platform/network/NetworkLoadTiming.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -56,17 +56,6 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void reset()
-    {
-        domainLookupStart = -1;
-        domainLookupEnd = -1;
-        connectStart = -1;
-        connectEnd = -1;
-        requestStart = 0;
-        responseStart = 0;
-        secureConnectionStart = -1;
-    }
-
</del><span class="cx">     NetworkLoadTiming&amp; operator=(const NetworkLoadTiming&amp; other)
</span><span class="cx">     {
</span><span class="cx">         domainLookupStart = other.domainLookupStart;
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.h (212448 => 212449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.h        2017-02-16 18:49:40 UTC (rev 212448)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.h        2017-02-16 19:18:32 UTC (rev 212449)
</span><span class="lines">@@ -145,6 +145,7 @@
</span><span class="cx">     bool usesDashboardBackwardCompatibilityMode() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    // ThreadableLoaderClient
</ins><span class="cx">     void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override;
</span><span class="cx">     void didReceiveResponse(unsigned long identifier, const ResourceResponse&amp;) override;
</span><span class="cx">     void didReceiveData(const char* data, int dataLength) override;
</span></span></pre>
</div>
</div>

</body>
</html>