<!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>[211594] 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/211594">211594</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2017-02-02 14:07:28 -0800 (Thu, 02 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Support Performance API (performance.now(), UserTiming) in Workers
https://bugs.webkit.org/show_bug.cgi?id=167717

Reviewed by Ryosuke Niwa.

Source/WebCore:

Tests: performance-api/performance-mark-name.html
       performance-api/performance-now-api.html
       performance-api/performance-now-time-origin-in-worker.html
       performance-api/user-timing-apis.html

* CMakeLists.txt:
* DerivedSources.make:
New files.

* page/DOMWindow.idl:
* page/GlobalPerformance.idl:
* workers/WorkerGlobalScope.idl:
Add partial interface for performance attribute.

* page/Performance.idl:
* page/PerformanceEntry.idl:
* page/PerformanceMark.idl:
* page/PerformanceMeasure.idl:
* page/PerformanceObserver.idl:
* page/PerformanceObserverEntryList.idl:
Expose these to Workers.

* page/Performance.cpp:
(WebCore::Performance::Performance):
(WebCore::Performance::contextDestroyed):
* page/Performance.h:
Use the EventQueue variant that works with any ScriptExectionContext.

* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::PerformanceObserver):
Get the Performance base in a Worker context.

* page/PerformanceUserTiming.cpp:
(WebCore::UserTiming::mark):
Only reject legacy special mark names in a Window, not a Worker.

(WebCore::UserTiming::findExistingMarkStartTime):
Simple implementation returns 0 as the start time in Workers. The spec
is currently imprecise here, but it does not have the unusual
PerformanceTiming behavior in a Window which is part of User Timing 1.

* workers/Worker.cpp:
(WebCore::Worker::create):
(WebCore::Worker::notifyFinished):
* workers/Worker.h:
Record the moment of Worker creation.

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
(WebCore::WorkerGlobalScope::performance):
* workers/WorkerGlobalScope.h:
Construct the Performance object with the moment of creation (timeOrigin).

* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:
Pass the moment of creation (timeOrigin) through to WorkerGlobalScope creation.

LayoutTests:

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
Updated now that Performance classes are in Workers.

* performance-api/performance-now-api-expected.txt: Added.
* performance-api/performance-now-api.html: Added.
* performance-api/performance-now-time-origin-in-worker-expected.txt: Added.
* performance-api/performance-now-time-origin-in-worker.html: Added.
New tests to cover performance.now.

* performance-api/performance-mark-name-expected.txt: Added.
* performance-api/performance-mark-name.html: Added.
* performance-api/resources/mark-name.js: Added.
* performance-api/resources/user-timing-api.js: Added.
* performance-api/user-timing-apis-expected.txt: Added.
* performance-api/user-timing-apis.html: Added.
New tests to cover user-timing and performance.mark behavior.

* performance-api/performance-observer-api-expected.txt:
* performance-api/performance-observer-api.html:
* performance-api/performance-observer-basic-expected.txt:
* performance-api/performance-observer-basic.html:
* performance-api/performance-timeline-api-expected.txt:
* performance-api/performance-timeline-api.html:
* performance-api/resources/now-api.js: Added.
* performance-api/resources/observer-api.js: Copied from LayoutTests/performance-api/performance-observer-api.html.
* performance-api/resources/observer-basic.js: Copied from LayoutTests/performance-api/performance-observer-basic.html.
* performance-api/resources/time-origin-in-worker.js: Added.
* performance-api/resources/timeline-api.js: Copied from LayoutTests/performance-api/performance-timeline-api.html.
Update some of the existing tests to check in a Document and Worker.

* imported/w3c/web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes-expected.txt:
Minor progression.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsusertimingtest_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomglobalconstructorsattributesdedicatedworkerexpectedtxt">trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsperformanceapiperformanceobserverapiexpectedtxt">trunk/LayoutTests/performance-api/performance-observer-api-expected.txt</a></li>
<li><a href="#trunkLayoutTestsperformanceapiperformanceobserverapihtml">trunk/LayoutTests/performance-api/performance-observer-api.html</a></li>
<li><a href="#trunkLayoutTestsperformanceapiperformanceobserverbasicexpectedtxt">trunk/LayoutTests/performance-api/performance-observer-basic-expected.txt</a></li>
<li><a href="#trunkLayoutTestsperformanceapiperformanceobserverbasichtml">trunk/LayoutTests/performance-api/performance-observer-basic.html</a></li>
<li><a href="#trunkLayoutTestsperformanceapiperformancetimelineapiexpectedtxt">trunk/LayoutTests/performance-api/performance-timeline-api-expected.txt</a></li>
<li><a href="#trunkLayoutTestsperformanceapiperformancetimelineapihtml">trunk/LayoutTests/performance-api/performance-timeline-api.html</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="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowidl">trunk/Source/WebCore/page/DOMWindow.idl</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="#trunkSourceWebCorepagePerformanceidl">trunk/Source/WebCore/page/Performance.idl</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceEntryidl">trunk/Source/WebCore/page/PerformanceEntry.idl</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceMarkidl">trunk/Source/WebCore/page/PerformanceMark.idl</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceMeasureidl">trunk/Source/WebCore/page/PerformanceMeasure.idl</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceObservercpp">trunk/Source/WebCore/page/PerformanceObserver.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceObserveridl">trunk/Source/WebCore/page/PerformanceObserver.idl</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceObserverEntryListidl">trunk/Source/WebCore/page/PerformanceObserverEntryList.idl</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceUserTimingcpp">trunk/Source/WebCore/page/PerformanceUserTiming.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersDedicatedWorkerGlobalScopecpp">trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersDedicatedWorkerGlobalScopeh">trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h</a></li>
<li><a href="#trunkSourceWebCoreworkersDedicatedWorkerThreadcpp">trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersDedicatedWorkerThreadh">trunk/Source/WebCore/workers/DedicatedWorkerThread.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkercpp">trunk/Source/WebCore/workers/Worker.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerh">trunk/Source/WebCore/workers/Worker.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopecpp">trunk/Source/WebCore/workers/WorkerGlobalScope.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopeh">trunk/Source/WebCore/workers/WorkerGlobalScope.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopeidl">trunk/Source/WebCore/workers/WorkerGlobalScope.idl</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopeProxyh">trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerMessagingProxycpp">trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerMessagingProxyh">trunk/Source/WebCore/workers/WorkerMessagingProxy.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerThreadcpp">trunk/Source/WebCore/workers/WorkerThread.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerThreadh">trunk/Source/WebCore/workers/WorkerThread.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsperformanceapiperformancemarknameexpectedtxt">trunk/LayoutTests/performance-api/performance-mark-name-expected.txt</a></li>
<li><a href="#trunkLayoutTestsperformanceapiperformancemarknamehtml">trunk/LayoutTests/performance-api/performance-mark-name.html</a></li>
<li><a href="#trunkLayoutTestsperformanceapiperformancenowapiexpectedtxt">trunk/LayoutTests/performance-api/performance-now-api-expected.txt</a></li>
<li><a href="#trunkLayoutTestsperformanceapiperformancenowapihtml">trunk/LayoutTests/performance-api/performance-now-api.html</a></li>
<li><a href="#trunkLayoutTestsperformanceapiperformancenowtimeorigininworkerexpectedtxt">trunk/LayoutTests/performance-api/performance-now-time-origin-in-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsperformanceapiperformancenowtimeorigininworkerhtml">trunk/LayoutTests/performance-api/performance-now-time-origin-in-worker.html</a></li>
<li>trunk/LayoutTests/performance-api/resources/</li>
<li><a href="#trunkLayoutTestsperformanceapiresourcesmarknamejs">trunk/LayoutTests/performance-api/resources/mark-name.js</a></li>
<li><a href="#trunkLayoutTestsperformanceapiresourcesnowapijs">trunk/LayoutTests/performance-api/resources/now-api.js</a></li>
<li><a href="#trunkLayoutTestsperformanceapiresourcesobserverapijs">trunk/LayoutTests/performance-api/resources/observer-api.js</a></li>
<li><a href="#trunkLayoutTestsperformanceapiresourcesobserverbasicjs">trunk/LayoutTests/performance-api/resources/observer-basic.js</a></li>
<li><a href="#trunkLayoutTestsperformanceapiresourcestimeorigininworkerjs">trunk/LayoutTests/performance-api/resources/time-origin-in-worker.js</a></li>
<li><a href="#trunkLayoutTestsperformanceapiresourcestimelineapijs">trunk/LayoutTests/performance-api/resources/timeline-api.js</a></li>
<li><a href="#trunkLayoutTestsperformanceapiresourcesusertimingapijs">trunk/LayoutTests/performance-api/resources/user-timing-api.js</a></li>
<li><a href="#trunkLayoutTestsperformanceapiusertimingapisexpectedtxt">trunk/LayoutTests/performance-api/user-timing-apis-expected.txt</a></li>
<li><a href="#trunkLayoutTestsperformanceapiusertimingapishtml">trunk/LayoutTests/performance-api/user-timing-apis.html</a></li>
<li><a href="#trunkSourceWebCorepageGlobalPerformanceidl">trunk/Source/WebCore/page/GlobalPerformance.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/LayoutTests/ChangeLog        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2017-02-02  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Support Performance API (performance.now(), UserTiming) in Workers
+        https://bugs.webkit.org/show_bug.cgi?id=167717
+
+        Reviewed by Ryosuke Niwa.
+
+        * js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
+        Updated now that Performance classes are in Workers.
+
+        * performance-api/performance-now-api-expected.txt: Added.
+        * performance-api/performance-now-api.html: Added.
+        * performance-api/performance-now-time-origin-in-worker-expected.txt: Added.
+        * performance-api/performance-now-time-origin-in-worker.html: Added.
+        New tests to cover performance.now.
+
+        * performance-api/performance-mark-name-expected.txt: Added.
+        * performance-api/performance-mark-name.html: Added.
+        * performance-api/resources/mark-name.js: Added.
+        * performance-api/resources/user-timing-api.js: Added.
+        * performance-api/user-timing-apis-expected.txt: Added.
+        * performance-api/user-timing-apis.html: Added.
+        New tests to cover user-timing and performance.mark behavior.
+
+        * performance-api/performance-observer-api-expected.txt:
+        * performance-api/performance-observer-api.html:
+        * performance-api/performance-observer-basic-expected.txt:
+        * performance-api/performance-observer-basic.html:
+        * performance-api/performance-timeline-api-expected.txt:
+        * performance-api/performance-timeline-api.html:
+        * performance-api/resources/now-api.js: Added.
+        * performance-api/resources/observer-api.js: Copied from LayoutTests/performance-api/performance-observer-api.html.
+        * performance-api/resources/observer-basic.js: Copied from LayoutTests/performance-api/performance-observer-basic.html.
+        * performance-api/resources/time-origin-in-worker.js: Added.
+        * performance-api/resources/timeline-api.js: Copied from LayoutTests/performance-api/performance-timeline-api.html.
+        Update some of the existing tests to check in a Document and Worker.
+
+        * imported/w3c/web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes-expected.txt:
+        Minor progression.
+
</ins><span class="cx"> 2017-02-02  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Mark imported/w3c/web-platform-tests/shadow-dom/slotchange.html as flaky on macOS.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsusertimingtest_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes-expected.txt (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes-expected.txt        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes-expected.txt        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -5,5 +5,5 @@
</span><span class="cx"> 
</span><span class="cx"> PASS window.performance is defined 
</span><span class="cx"> FAIL performance.mark and performance.measure should throw if used with timing attribute values assert_throws: function &quot;function () { window.performance.measure(timingAttributes...&quot; did not throw
</span><del>-FAIL performance.mark and performance.measure should not throw if used with timing attribute values in workers Can't find variable: performance
</del><ins>+PASS performance.mark and performance.measure should not throw if used with timing attribute values in workers 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomglobalconstructorsattributesdedicatedworkerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -194,6 +194,36 @@
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Object').hasOwnProperty('set') is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Object').enumerable is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Object').configurable is true
</span><ins>+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Performance').value is Performance
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Performance').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Performance').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Performance').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Performance').configurable is true
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceEntry').value is PerformanceEntry
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceEntry').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceEntry').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceEntry').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceEntry').configurable is true
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceMark').value is PerformanceMark
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceMark').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceMark').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceMark').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceMark').configurable is true
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceMeasure').value is PerformanceMeasure
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceMeasure').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceMeasure').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceMeasure').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceMeasure').configurable is true
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserver').value is PerformanceObserver
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserver').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserver').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserver').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserver').configurable is true
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserverEntryList').value is PerformanceObserverEntryList
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserverEntryList').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserverEntryList').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserverEntryList').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'PerformanceObserverEntryList').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="trunkLayoutTestsperformanceapiperformancemarknameexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/performance-mark-name-expected.txt (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/performance-mark-name-expected.txt                                (rev 0)
+++ trunk/LayoutTests/performance-api/performance-mark-name-expected.txt        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+Tests performance.mark name restrictions apply only in Window.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS performance.mark(&quot;navigationStart&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;unloadEventStart&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;unloadEventEnd&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;redirectStart&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;redirectEnd&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;fetchStart&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;domainLookupStart&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;domainLookupEnd&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;connectStart&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;connectEnd&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;secureConnectionStart&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;requestStart&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;responseStart&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;responseEnd&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;domLoading&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;domInteractive&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;domContentLoadedEventStart&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;domContentLoadedEventEnd&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;domComplete&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;loadEventStart&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;loadEventEnd&quot;) threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark(&quot;mark_name&quot;) did not throw exception.
+
+Starting worker: resources/mark-name.js
+PASS [Worker] performance.mark(&quot;navigationStart&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;unloadEventStart&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;unloadEventEnd&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;redirectStart&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;redirectEnd&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;fetchStart&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;domainLookupStart&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;domainLookupEnd&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;connectStart&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;connectEnd&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;secureConnectionStart&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;requestStart&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;responseStart&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;responseEnd&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;domLoading&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;domInteractive&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;domContentLoadedEventStart&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;domContentLoadedEventEnd&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;domComplete&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;loadEventStart&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;loadEventEnd&quot;) did not throw exception.
+PASS [Worker] performance.mark(&quot;mark_name&quot;) did not throw exception.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiperformancemarknamehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/performance-mark-name.html (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/performance-mark-name.html                                (rev 0)
+++ trunk/LayoutTests/performance-api/performance-mark-name.html        2017-02-02 22:07:28 UTC (rev 211594)
</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/mark-name.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+debug(&quot;&quot;);
+let worker = startWorker(&quot;resources/mark-name.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="trunkLayoutTestsperformanceapiperformancenowapiexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/performance-now-api-expected.txt (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/performance-now-api-expected.txt                                (rev 0)
+++ trunk/LayoutTests/performance-api/performance-now-api-expected.txt        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+Basic Interface test for High Resolution Time APIs.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Performance
+PASS Performance is defined.
+PASS Performance.prototype.now is defined.
+PASS new Performance() threw exception TypeError: function is not a constructor (evaluating 'new Performance()').
+performance
+PASS performance is defined.
+PASS performance instanceof Performance is true
+PASS typeof performance.now() === &quot;number&quot; is true
+PASS performance.now() &lt;= performance.now() is true
+PASS delta &gt;= 95 &amp;&amp; delta &lt;= 120 is true
+
+Starting worker: resources/now-api.js
+[Worker] Performance
+PASS [Worker] Performance is defined.
+PASS [Worker] Performance.prototype.now is defined.
+PASS [Worker] new Performance() threw exception TypeError: function is not a constructor (evaluating 'new Performance()').
+[Worker] performance
+PASS [Worker] performance is defined.
+PASS [Worker] performance instanceof Performance is true
+PASS [Worker] typeof performance.now() === &quot;number&quot; is true
+PASS [Worker] performance.now() &lt;= performance.now() is true
+PASS [Worker] delta &gt;= 95 &amp;&amp; delta &lt;= 120 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiperformancenowapihtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/performance-now-api.html (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/performance-now-api.html                                (rev 0)
+++ trunk/LayoutTests/performance-api/performance-now-api.html        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,16 @@
</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/now-api.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function testWorker() {
+    debug(&quot;&quot;);
+    let worker = startWorker(&quot;resources/now-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="trunkLayoutTestsperformanceapiperformancenowtimeorigininworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/performance-now-time-origin-in-worker-expected.txt (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/performance-now-time-origin-in-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/performance-api/performance-now-time-origin-in-worker-expected.txt        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Ensure time origin in Worker starts from the moment of Worker Creation
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Starting worker: resources/time-origin-in-worker.js
+PASS [Worker] performance.now() &lt; 200 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiperformancenowtimeorigininworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/performance-now-time-origin-in-worker.html (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/performance-now-time-origin-in-worker.html                                (rev 0)
+++ trunk/LayoutTests/performance-api/performance-now-time-origin-in-worker.html        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,18 @@
</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&gt;
+description(&quot;Ensure time origin in Worker starts from the moment of Worker Creation&quot;);
+self.jsTestIsAsync = true;
+
+while (performance.now() &lt; 200)
+    continue;
+
+let worker = startWorker(&quot;resources/time-origin-in-worker.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="trunkLayoutTestsperformanceapiperformanceobserverapiexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/performance-api/performance-observer-api-expected.txt (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/performance-observer-api-expected.txt        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/LayoutTests/performance-api/performance-observer-api-expected.txt        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -29,6 +29,34 @@
</span><span class="cx"> PASS PerformanceObserverEntryList.prototype.getEntriesByType is defined.
</span><span class="cx"> PASS PerformanceObserverEntryList.prototype.getEntriesByName is defined.
</span><span class="cx"> PASS new PerformanceObserverEntryList() threw exception TypeError: function is not a constructor (evaluating 'new PerformanceObserverEntryList()').
</span><ins>+
+Starting worker: resources/observer-api.js
+[Worker] PerformanceObserver
+PASS [Worker] PerformanceObserver is defined.
+PASS [Worker] PerformanceObserver.prototype.observe is defined.
+PASS [Worker] PerformanceObserver.prototype.disconnect is defined.
+PASS [Worker] PerformanceObserver() threw exception TypeError: Constructor requires 'new' operator.
+PASS [Worker] new PerformanceObserver() threw exception TypeError: Not enough arguments.
+PASS [Worker] new PerformanceObserver(1) threw exception TypeError: Argument 1 ('callback') to the PerformanceObserver constructor must be a function.
+PASS [Worker] observer = new PerformanceObserver(function() {}) did not throw exception.
+PASS [Worker] observer.observe() threw exception TypeError: Not enough arguments.
+PASS [Worker] observer.observe(&quot;mark&quot;) threw exception TypeError: Type error.
+PASS [Worker] observer.observe({}) threw exception TypeError: Member PerformanceObserverInit.entryTypes is required and must be an instance of sequence.
+PASS [Worker] observer.observe({entryTypes:&quot;mark&quot;}) threw exception TypeError: Value is not a sequence.
+PASS [Worker] observer.observe({entryTypes:[]}) threw exception TypeError: entryTypes cannot be an empty list.
+PASS [Worker] observer.observe({entryTypes:[&quot;not-real&quot;]}) threw exception TypeError: entryTypes contained only unsupported types.
+PASS [Worker] observer.observe({entryTypes:[&quot;mark&quot;]}) did not throw exception.
+PASS [Worker] observer.observe({entryTypes:[&quot;mark&quot;, &quot;not-real&quot;]}) did not throw exception.
+PASS [Worker] observer.observe({entryTypes:[&quot;mark&quot;, &quot;measure&quot;]}) did not throw exception.
+PASS [Worker] observer.disconnect() did not throw exception.
+PASS [Worker] observer.disconnect() did not throw exception.
+[Worker] 
+[Worker] PerformanceObserverEntryList
+PASS [Worker] PerformanceObserverEntryList is defined.
+PASS [Worker] PerformanceObserverEntryList.prototype.getEntries is defined.
+PASS [Worker] PerformanceObserverEntryList.prototype.getEntriesByType is defined.
+PASS [Worker] PerformanceObserverEntryList.prototype.getEntriesByName is defined.
+PASS [Worker] new PerformanceObserverEntryList() threw exception TypeError: function is not a constructor (evaluating 'new PerformanceObserverEntryList()').
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsperformanceapiperformanceobserverapihtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/performance-api/performance-observer-api.html (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/performance-observer-api.html        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/LayoutTests/performance-api/performance-observer-api.html        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -4,36 +4,10 @@
</span><span class="cx"> &lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><ins>+&lt;script src=&quot;resources/observer-api.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><del>-description(&quot;Basic Interface test for PerformanceObserver APIs.&quot;);
-
-debug(&quot;PerformanceObserver&quot;);
-shouldBeDefined(`PerformanceObserver`);
-shouldBeDefined(`PerformanceObserver.prototype.observe`);
-shouldBeDefined(`PerformanceObserver.prototype.disconnect`);
-shouldThrow(`PerformanceObserver()`);
-shouldThrow(`new PerformanceObserver()`);
-shouldThrow(`new PerformanceObserver(1)`);
-shouldNotThrow(`observer = new PerformanceObserver(function() {})`);
-shouldThrow(`observer.observe()`);
-shouldThrow(`observer.observe(&quot;mark&quot;)`);
-shouldThrow(`observer.observe({})`);
-shouldThrow(`observer.observe({entryTypes:&quot;mark&quot;})`);
-shouldThrow(`observer.observe({entryTypes:[]})`);
-shouldThrow(`observer.observe({entryTypes:[&quot;not-real&quot;]})`);
-shouldNotThrow(`observer.observe({entryTypes:[&quot;mark&quot;]})`);
-shouldNotThrow(`observer.observe({entryTypes:[&quot;mark&quot;, &quot;not-real&quot;]})`);
-shouldNotThrow(`observer.observe({entryTypes:[&quot;mark&quot;, &quot;measure&quot;]})`);
-shouldNotThrow(`observer.disconnect()`);
-shouldNotThrow(`observer.disconnect()`);
-
</del><span class="cx"> debug(&quot;&quot;);
</span><del>-debug(&quot;PerformanceObserverEntryList&quot;);
-shouldBeDefined(`PerformanceObserverEntryList`);
-shouldBeDefined(`PerformanceObserverEntryList.prototype.getEntries`);
-shouldBeDefined(`PerformanceObserverEntryList.prototype.getEntriesByType`);
-shouldBeDefined(`PerformanceObserverEntryList.prototype.getEntriesByName`);
-shouldThrow(`new PerformanceObserverEntryList()`);
</del><ins>+let worker = startWorker(&quot;resources/observer-api.js&quot;);
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsperformanceapiperformanceobserverbasicexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/performance-api/performance-observer-basic-expected.txt (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/performance-observer-basic-expected.txt        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/LayoutTests/performance-api/performance-observer-basic-expected.txt        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -46,6 +46,51 @@
</span><span class="cx"> PASS list.getEntriesByName(&quot;mark3&quot;, &quot;mark&quot;).length === 1 is true
</span><span class="cx"> PASS list.getEntriesByName(null, &quot;mark&quot;).length === 0 is true
</span><span class="cx"> PASS list.getEntriesByName(undefined, &quot;mark&quot;).length === 0 is true
</span><ins>+
+Starting worker: resources/observer-basic.js
+[Worker] Inside PerformanceObserver callback
+PASS [Worker] argumentsLength === 2 is true
+PASS [Worker] list instanceof PerformanceObserverEntryList is true
+PASS [Worker] obs instanceof PerformanceObserver is true
+PASS [Worker] obs === observer is true
+FAIL [Worker] thisObject instanceof PerformanceObserver should be true. Was false.
+FAIL [Worker] thisObject === observer should be true. Was false.
+[Worker] 
+[Worker] PerformanceObserverEntryList APIs
+PASS [Worker] list.getEntries() instanceof Array is true
+PASS [Worker] list.getEntries().length === 2 is true
+PASS [Worker] list.getEntries()[0] instanceof PerformanceEntry is true
+PASS [Worker] list.getEntries()[0].name is &quot;mark3&quot;
+PASS [Worker] list.getEntries()[1].name is &quot;mark4&quot;
+PASS [Worker] list.getEntries()[0].startTime &lt;= list.getEntries()[1].startTime is true
+PASS [Worker] list.getEntriesByType() threw exception TypeError: Not enough arguments.
+PASS [Worker] list.getEntriesByType(&quot;not-real&quot;).length === 0 is true
+PASS [Worker] list.getEntriesByType(&quot;mark&quot;).length === 2 is true
+PASS [Worker] list.getEntriesByType(&quot;mark&quot;)[0] instanceof PerformanceEntry is true
+PASS [Worker] list.getEntriesByType(&quot;mark&quot;)[0].name is &quot;mark3&quot;
+PASS [Worker] list.getEntriesByType(&quot;mark&quot;)[1].name is &quot;mark4&quot;
+PASS [Worker] list.getEntriesByName() threw exception TypeError: Not enough arguments.
+PASS [Worker] list.getEntriesByName(&quot;not-real&quot;).length === 0 is true
+PASS [Worker] list.getEntriesByName(&quot;mark1&quot;).length === 0 is true
+PASS [Worker] list.getEntriesByName(&quot;mark3&quot;).length === 1 is true
+PASS [Worker] list.getEntriesByName(&quot;mark3&quot;)[0] instanceof PerformanceEntry is true
+PASS [Worker] list.getEntriesByName(&quot;mark3&quot;)[0].name is &quot;mark3&quot;
+PASS [Worker] list.getEntriesByName(&quot;mark4&quot;).length === 1 is true
+PASS [Worker] list.getEntriesByName(&quot;mark4&quot;)[0] instanceof PerformanceEntry is true
+PASS [Worker] list.getEntriesByName(&quot;mark4&quot;)[0].name is &quot;mark4&quot;
+PASS [Worker] list.getEntriesByName() threw exception TypeError: Not enough arguments.
+PASS [Worker] list.getEntriesByName(&quot;not-real&quot;).length === 0 is true
+PASS [Worker] list.getEntriesByName(&quot;mark1&quot;).length === 0 is true
+PASS [Worker] list.getEntriesByName(&quot;mark3&quot;).length === 1 is true
+PASS [Worker] list.getEntriesByName(&quot;mark3&quot;)[0] instanceof PerformanceEntry is true
+PASS [Worker] list.getEntriesByName(&quot;mark3&quot;)[0].name is &quot;mark3&quot;
+PASS [Worker] list.getEntriesByName(&quot;mark4&quot;).length === 1 is true
+PASS [Worker] list.getEntriesByName(&quot;mark4&quot;)[0] instanceof PerformanceEntry is true
+PASS [Worker] list.getEntriesByName(&quot;mark4&quot;)[0].name is &quot;mark4&quot;
+PASS [Worker] list.getEntriesByName(&quot;mark3&quot;, &quot;not-real&quot;).length === 0 is true
+PASS [Worker] list.getEntriesByName(&quot;mark3&quot;, &quot;mark&quot;).length === 1 is true
+PASS [Worker] list.getEntriesByName(null, &quot;mark&quot;).length === 0 is true
+PASS [Worker] list.getEntriesByName(undefined, &quot;mark&quot;).length === 0 is true
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsperformanceapiperformanceobserverbasichtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/performance-api/performance-observer-basic.html (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/performance-observer-basic.html        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/LayoutTests/performance-api/performance-observer-basic.html        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -4,91 +4,12 @@
</span><span class="cx"> &lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><ins>+&lt;script src=&quot;resources/observer-basic.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><del>-description(&quot;Basic Behavior test for PerformanceObserver APIs.&quot;);
-window.jsTestIsAsync = true;
-
-// PerformanceObservers that are not actively observing should not fire.
-let observerNotObserving = new PerformanceObserver(function() {
-    testFailed(&quot;PerformanceObserver never registered should not be called&quot;);
-});
-
-let observerNotObserving2 = new PerformanceObserver(function() {
-    testFailed(&quot;PerformanceObserver not actively observing should not be called&quot;);
-});
-observerNotObserving2.observe({entryTypes: [&quot;mark&quot;]});
-observerNotObserving2.disconnect();
-
-// PerformanceObservers for different entry types should not fire.
-let observerNotMarks = new PerformanceObserver(function() {
-    testFailed(&quot;PerformanceObserver observing measures should not be called&quot;);
-});
-
-// Observer sees marks while it is registered.
-performance.mark(&quot;mark1&quot;);
-window.observer = new PerformanceObserver(function(list, obs) {
-    window.argumentsLength = arguments.length;
-    window.list = list;
-    window.obs = obs;
-    window.thisObject = this;
-
-    debug(&quot;Inside PerformanceObserver callback&quot;);
-    shouldBeTrue(`argumentsLength === 2`);
-    shouldBeTrue(`list instanceof PerformanceObserverEntryList`);
-    shouldBeTrue(`obs instanceof PerformanceObserver`);
-    shouldBeTrue(`obs === observer`);
-    // FIXME: &lt;https://webkit.org/b/167549&gt; Invoking generated callback should allow setting the `this` object
-    shouldBeTrue(`thisObject instanceof PerformanceObserver`);
-    shouldBeTrue(`thisObject === observer`);
-
</del><ins>+function testWorker() {
</ins><span class="cx">     debug(&quot;&quot;);
</span><del>-    debug(&quot;PerformanceObserverEntryList APIs&quot;);
-
-    shouldBeTrue(`list.getEntries() instanceof Array`);
-    shouldBeTrue(`list.getEntries().length === 2`);
-    shouldBeTrue(`list.getEntries()[0] instanceof PerformanceEntry`);
-    shouldBeEqualToString(`list.getEntries()[0].name`, &quot;mark3&quot;);
-    shouldBeEqualToString(`list.getEntries()[1].name`, &quot;mark4&quot;);
-    shouldBeTrue(`list.getEntries()[0].startTime &lt;= list.getEntries()[1].startTime`);
-
-    shouldThrow(`list.getEntriesByType()`);
-    shouldBeTrue(`list.getEntriesByType(&quot;not-real&quot;).length === 0`);
-    shouldBeTrue(`list.getEntriesByType(&quot;mark&quot;).length === 2`);
-    shouldBeTrue(`list.getEntriesByType(&quot;mark&quot;)[0] instanceof PerformanceEntry`);
-    shouldBeEqualToString(`list.getEntriesByType(&quot;mark&quot;)[0].name`, &quot;mark3&quot;);
-    shouldBeEqualToString(`list.getEntriesByType(&quot;mark&quot;)[1].name`, &quot;mark4&quot;);
-
-    shouldThrow(`list.getEntriesByName()`);
-    shouldBeTrue(`list.getEntriesByName(&quot;not-real&quot;).length === 0`);
-    shouldBeTrue(`list.getEntriesByName(&quot;mark1&quot;).length === 0`);
-    shouldBeTrue(`list.getEntriesByName(&quot;mark3&quot;).length === 1`);
-    shouldBeTrue(`list.getEntriesByName(&quot;mark3&quot;)[0] instanceof PerformanceEntry`);
-    shouldBeEqualToString(`list.getEntriesByName(&quot;mark3&quot;)[0].name`, &quot;mark3&quot;);
-    shouldBeTrue(`list.getEntriesByName(&quot;mark4&quot;).length === 1`);
-    shouldBeTrue(`list.getEntriesByName(&quot;mark4&quot;)[0] instanceof PerformanceEntry`);
-    shouldBeEqualToString(`list.getEntriesByName(&quot;mark4&quot;)[0].name`, &quot;mark4&quot;);
-
-    shouldThrow(`list.getEntriesByName()`);
-    shouldBeTrue(`list.getEntriesByName(&quot;not-real&quot;).length === 0`);
-    shouldBeTrue(`list.getEntriesByName(&quot;mark1&quot;).length === 0`);
-    shouldBeTrue(`list.getEntriesByName(&quot;mark3&quot;).length === 1`);
-    shouldBeTrue(`list.getEntriesByName(&quot;mark3&quot;)[0] instanceof PerformanceEntry`);
-    shouldBeEqualToString(`list.getEntriesByName(&quot;mark3&quot;)[0].name`, &quot;mark3&quot;);
-    shouldBeTrue(`list.getEntriesByName(&quot;mark4&quot;).length === 1`);
-    shouldBeTrue(`list.getEntriesByName(&quot;mark4&quot;)[0] instanceof PerformanceEntry`);
-    shouldBeEqualToString(`list.getEntriesByName(&quot;mark4&quot;)[0].name`, &quot;mark4&quot;);
-
-    shouldBeTrue(`list.getEntriesByName(&quot;mark3&quot;, &quot;not-real&quot;).length === 0`);
-    shouldBeTrue(`list.getEntriesByName(&quot;mark3&quot;, &quot;mark&quot;).length === 1`);
-    shouldBeTrue(`list.getEntriesByName(null, &quot;mark&quot;).length === 0`);
-    shouldBeTrue(`list.getEntriesByName(undefined, &quot;mark&quot;).length === 0`);
-
-    finishJSTest();
-});
-performance.mark(&quot;mark2&quot;);
-observer.observe({entryTypes: [&quot;mark&quot;]});
-performance.mark(&quot;mark3&quot;);
-performance.mark(&quot;mark4&quot;);
</del><ins>+    let worker = startWorker(&quot;resources/observer-basic.js&quot;);
+}
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsperformanceapiperformancetimelineapiexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/performance-api/performance-timeline-api-expected.txt (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/performance-timeline-api-expected.txt        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/LayoutTests/performance-api/performance-timeline-api-expected.txt        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -42,6 +42,47 @@
</span><span class="cx"> PASS typeof performance.getEntriesByName(&quot;test&quot;)[0].duration === &quot;number&quot; is true
</span><span class="cx"> PASS performance.getEntriesByName(&quot;test&quot;, &quot;not-real&quot;).length === 0 is true
</span><span class="cx"> PASS performance.getEntriesByName(&quot;test&quot;, &quot;mark&quot;).length === 1 is true
</span><ins>+
+Starting worker: resources/timeline-api.js
+[Worker] PerformanceEntry
+PASS [Worker] PerformanceEntry is defined.
+PASS [Worker] &quot;name&quot; in PerformanceEntry.prototype is true
+PASS [Worker] &quot;entryType&quot; in PerformanceEntry.prototype is true
+PASS [Worker] &quot;startTime&quot; in PerformanceEntry.prototype is true
+PASS [Worker] &quot;duration&quot; in PerformanceEntry.prototype is true
+PASS [Worker] new PerformanceEntry() threw exception TypeError: function is not a constructor (evaluating 'new PerformanceEntry()').
+[Worker] 
+[Worker] Performance extensions
+PASS [Worker] Performance.prototype.getEntries is defined.
+PASS [Worker] Performance.prototype.getEntriesByType is defined.
+PASS [Worker] Performance.prototype.getEntriesByName is defined.
+PASS [Worker] performance.getEntries() instanceof Array is true
+PASS [Worker] performance.getEntries().length === 0 is true
+PASS [Worker] performance.mark(&quot;test&quot;); did not throw exception.
+PASS [Worker] performance.getEntries().length === 1 is true
+PASS [Worker] performance.getEntries()[0] instanceof PerformanceEntry is true
+PASS [Worker] performance.getEntries()[0].name is &quot;test&quot;
+PASS [Worker] performance.getEntries()[0].entryType is &quot;mark&quot;
+PASS [Worker] typeof performance.getEntries()[0].startTime === &quot;number&quot; is true
+PASS [Worker] typeof performance.getEntries()[0].duration === &quot;number&quot; is true
+PASS [Worker] performance.getEntriesByType() threw exception TypeError: Not enough arguments.
+PASS [Worker] performance.getEntriesByType(&quot;not-real&quot;).length === 0 is true
+PASS [Worker] performance.getEntriesByType(&quot;mark&quot;).length === 1 is true
+PASS [Worker] performance.getEntriesByType(&quot;mark&quot;)[0] instanceof PerformanceEntry is true
+PASS [Worker] performance.getEntriesByType(&quot;mark&quot;)[0].name is &quot;test&quot;
+PASS [Worker] performance.getEntriesByType(&quot;mark&quot;)[0].entryType is &quot;mark&quot;
+PASS [Worker] typeof performance.getEntriesByType(&quot;mark&quot;)[0].startTime === &quot;number&quot; is true
+PASS [Worker] typeof performance.getEntriesByType(&quot;mark&quot;)[0].duration === &quot;number&quot; is true
+PASS [Worker] performance.getEntriesByName() threw exception TypeError: Not enough arguments.
+PASS [Worker] performance.getEntriesByName(&quot;not-real&quot;).length === 0 is true
+PASS [Worker] performance.getEntriesByName(&quot;test&quot;).length === 1 is true
+PASS [Worker] performance.getEntriesByName(&quot;test&quot;)[0] instanceof PerformanceEntry is true
+PASS [Worker] performance.getEntriesByName(&quot;test&quot;)[0].name is &quot;test&quot;
+PASS [Worker] performance.getEntriesByName(&quot;test&quot;)[0].entryType is &quot;mark&quot;
+PASS [Worker] typeof performance.getEntriesByName(&quot;test&quot;)[0].startTime === &quot;number&quot; is true
+PASS [Worker] typeof performance.getEntriesByName(&quot;test&quot;)[0].duration === &quot;number&quot; is true
+PASS [Worker] performance.getEntriesByName(&quot;test&quot;, &quot;not-real&quot;).length === 0 is true
+PASS [Worker] performance.getEntriesByName(&quot;test&quot;, &quot;mark&quot;).length === 1 is true
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsperformanceapiperformancetimelineapihtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/performance-api/performance-timeline-api.html (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/performance-timeline-api.html        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/LayoutTests/performance-api/performance-timeline-api.html        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -4,54 +4,10 @@
</span><span class="cx"> &lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><ins>+&lt;script src=&quot;resources/timeline-api.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><del>-description(&quot;Basic Interface test for performance-timeline APIs.&quot;);
-
-debug(&quot;PerformanceEntry&quot;);
-shouldBeDefined(&quot;PerformanceEntry&quot;);
-shouldBeTrue(`&quot;name&quot; in PerformanceEntry.prototype`);
-shouldBeTrue(`&quot;entryType&quot; in PerformanceEntry.prototype`);
-shouldBeTrue(`&quot;startTime&quot; in PerformanceEntry.prototype`);
-shouldBeTrue(`&quot;duration&quot; in PerformanceEntry.prototype`);
-shouldThrow(`new PerformanceEntry()`);
-
-// NOTE: The APIs below may be going away. Replaced by PerformanceObserver.
-
</del><span class="cx"> debug(&quot;&quot;);
</span><del>-debug(&quot;Performance extensions&quot;);
-shouldBeDefined(`Performance.prototype.getEntries`);
-shouldBeDefined(`Performance.prototype.getEntriesByType`);
-shouldBeDefined(`Performance.prototype.getEntriesByName`);
-
-shouldBeTrue(`performance.getEntries() instanceof Array`);
-shouldBeTrue(`performance.getEntries().length === 0`);
-shouldNotThrow(`performance.mark(&quot;test&quot;);`);
-shouldBeTrue(`performance.getEntries().length === 1`);
-shouldBeTrue(`performance.getEntries()[0] instanceof PerformanceEntry`);
-shouldBeEqualToString(`performance.getEntries()[0].name`, &quot;test&quot;);
-shouldBeEqualToString(`performance.getEntries()[0].entryType`, &quot;mark&quot;);
-shouldBeTrue(`typeof performance.getEntries()[0].startTime === &quot;number&quot;`);
-shouldBeTrue(`typeof performance.getEntries()[0].duration === &quot;number&quot;`);
-
-shouldThrow(`performance.getEntriesByType()`);
-shouldBeTrue(`performance.getEntriesByType(&quot;not-real&quot;).length === 0`);
-shouldBeTrue(`performance.getEntriesByType(&quot;mark&quot;).length === 1`);
-shouldBeTrue(`performance.getEntriesByType(&quot;mark&quot;)[0] instanceof PerformanceEntry`);
-shouldBeEqualToString(`performance.getEntriesByType(&quot;mark&quot;)[0].name`, &quot;test&quot;);
-shouldBeEqualToString(`performance.getEntriesByType(&quot;mark&quot;)[0].entryType`, &quot;mark&quot;);
-shouldBeTrue(`typeof performance.getEntriesByType(&quot;mark&quot;)[0].startTime === &quot;number&quot;`);
-shouldBeTrue(`typeof performance.getEntriesByType(&quot;mark&quot;)[0].duration === &quot;number&quot;`);
-
-shouldThrow(`performance.getEntriesByName()`);
-shouldBeTrue(`performance.getEntriesByName(&quot;not-real&quot;).length === 0`);
-shouldBeTrue(`performance.getEntriesByName(&quot;test&quot;).length === 1`);
-shouldBeTrue(`performance.getEntriesByName(&quot;test&quot;)[0] instanceof PerformanceEntry`);
-shouldBeEqualToString(`performance.getEntriesByName(&quot;test&quot;)[0].name`, &quot;test&quot;);
-shouldBeEqualToString(`performance.getEntriesByName(&quot;test&quot;)[0].entryType`, &quot;mark&quot;);
-shouldBeTrue(`typeof performance.getEntriesByName(&quot;test&quot;)[0].startTime === &quot;number&quot;`);
-shouldBeTrue(`typeof performance.getEntriesByName(&quot;test&quot;)[0].duration === &quot;number&quot;`);
-shouldBeTrue(`performance.getEntriesByName(&quot;test&quot;, &quot;not-real&quot;).length === 0`);
-shouldBeTrue(`performance.getEntriesByName(&quot;test&quot;, &quot;mark&quot;).length === 1`);
</del><ins>+let worker = startWorker(&quot;resources/timeline-api.js&quot;);
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsperformanceapiresourcesmarknamejs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/resources/mark-name.js (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/resources/mark-name.js                                (rev 0)
+++ trunk/LayoutTests/performance-api/resources/mark-name.js        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+if (self.importScripts)
+    importScripts(&quot;../../resources/js-test-pre.js&quot;);
+
+self.jsTestIsAsync = true;
+
+if (self.window)
+    description(&quot;Tests performance.mark name restrictions apply only in Window.&quot;);
+
+const reservedLegacyPerformanceTimingAttributeNames = [
+    &quot;navigationStart&quot;,
+    &quot;unloadEventStart&quot;,
+    &quot;unloadEventEnd&quot;,
+    &quot;redirectStart&quot;,
+    &quot;redirectEnd&quot;,
+    &quot;fetchStart&quot;,
+    &quot;domainLookupStart&quot;,
+    &quot;domainLookupEnd&quot;,
+    &quot;connectStart&quot;,
+    &quot;connectEnd&quot;,
+    &quot;secureConnectionStart&quot;,
+    &quot;requestStart&quot;,
+    &quot;responseStart&quot;,
+    &quot;responseEnd&quot;,
+    &quot;domLoading&quot;,
+    &quot;domInteractive&quot;,
+    &quot;domContentLoadedEventStart&quot;,
+    &quot;domContentLoadedEventEnd&quot;,
+    &quot;domComplete&quot;,
+    &quot;loadEventStart&quot;,
+    &quot;loadEventEnd&quot;,
+];
+
+let t = self.window ? shouldThrow : shouldNotThrow;
+for (let name of reservedLegacyPerformanceTimingAttributeNames)
+    t(`performance.mark(&quot;${name}&quot;)`);
+
+shouldNotThrow(`performance.mark(&quot;mark_name&quot;)`);
+
+if (self.importScripts)
+    finishJSTest();
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiresourcesnowapijs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/resources/now-api.js (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/resources/now-api.js                                (rev 0)
+++ trunk/LayoutTests/performance-api/resources/now-api.js        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+if (self.importScripts)
+    importScripts(&quot;../../resources/js-test-pre.js&quot;);
+
+self.jsTestIsAsync = true;
+
+if (self.window)
+    description(&quot;Basic Interface test for High Resolution Time APIs.&quot;);
+
+debug(&quot;Performance&quot;);
+shouldBeDefined(`Performance`);
+shouldBeDefined(`Performance.prototype.now`);
+shouldThrow(`new Performance()`);
+
+debug(&quot;performance&quot;);
+shouldBeDefined(`performance`);
+shouldBeTrue(`performance instanceof Performance`);
+shouldBeTrue(`typeof performance.now() === &quot;number&quot;`);
+shouldBeTrue(`performance.now() &lt;= performance.now()`);
+
+self.time1 = performance.now();
+setTimeout(function() {
+    self.delta = performance.now() - time1;
+    // Allow for ~20ms error.
+    shouldBeTrue(`delta &gt;= 95 &amp;&amp; delta &lt;= 120`);
+
+    if (self.importScripts)
+        finishJSTest();
+    else
+        testWorker();
+}, 100);
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiresourcesobserverapijsfromrev211593trunkLayoutTestsperformanceapiperformanceobserverapihtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/performance-api/resources/observer-api.js (from rev 211593, trunk/LayoutTests/performance-api/performance-observer-api.html) (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/resources/observer-api.js                                (rev 0)
+++ trunk/LayoutTests/performance-api/resources/observer-api.js        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+if (self.importScripts)
+    importScripts(&quot;../../resources/js-test-pre.js&quot;);
+
+if (self.window)
+    description(&quot;Basic Interface test for PerformanceObserver APIs.&quot;);
+
+debug(&quot;PerformanceObserver&quot;);
+shouldBeDefined(`PerformanceObserver`);
+shouldBeDefined(`PerformanceObserver.prototype.observe`);
+shouldBeDefined(`PerformanceObserver.prototype.disconnect`);
+shouldThrow(`PerformanceObserver()`);
+shouldThrow(`new PerformanceObserver()`);
+shouldThrow(`new PerformanceObserver(1)`);
+shouldNotThrow(`observer = new PerformanceObserver(function() {})`);
+shouldThrow(`observer.observe()`);
+shouldThrow(`observer.observe(&quot;mark&quot;)`);
+shouldThrow(`observer.observe({})`);
+shouldThrow(`observer.observe({entryTypes:&quot;mark&quot;})`);
+shouldThrow(`observer.observe({entryTypes:[]})`);
+shouldThrow(`observer.observe({entryTypes:[&quot;not-real&quot;]})`);
+shouldNotThrow(`observer.observe({entryTypes:[&quot;mark&quot;]})`);
+shouldNotThrow(`observer.observe({entryTypes:[&quot;mark&quot;, &quot;not-real&quot;]})`);
+shouldNotThrow(`observer.observe({entryTypes:[&quot;mark&quot;, &quot;measure&quot;]})`);
+shouldNotThrow(`observer.disconnect()`);
+shouldNotThrow(`observer.disconnect()`);
+
+debug(&quot;&quot;);
+debug(&quot;PerformanceObserverEntryList&quot;);
+shouldBeDefined(`PerformanceObserverEntryList`);
+shouldBeDefined(`PerformanceObserverEntryList.prototype.getEntries`);
+shouldBeDefined(`PerformanceObserverEntryList.prototype.getEntriesByType`);
+shouldBeDefined(`PerformanceObserverEntryList.prototype.getEntriesByName`);
+shouldThrow(`new PerformanceObserverEntryList()`);
+
+if (self.importScripts)
+    finishJSTest();
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiresourcesobserverbasicjsfromrev211593trunkLayoutTestsperformanceapiperformanceobserverbasichtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/performance-api/resources/observer-basic.js (from rev 211593, trunk/LayoutTests/performance-api/performance-observer-basic.html) (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/resources/observer-basic.js                                (rev 0)
+++ trunk/LayoutTests/performance-api/resources/observer-basic.js        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+if (self.importScripts)
+    importScripts(&quot;../../resources/js-test-pre.js&quot;);
+
+self.jsTestIsAsync = true;
+
+if (self.window)
+    description(&quot;Basic Behavior test for PerformanceObserver APIs.&quot;);
+
+// PerformanceObservers that are not actively observing should not fire.
+let observerNotObserving = new PerformanceObserver(function() {
+    testFailed(&quot;PerformanceObserver never registered should not be called&quot;);
+});
+
+let observerNotObserving2 = new PerformanceObserver(function() {
+    testFailed(&quot;PerformanceObserver not actively observing should not be called&quot;);
+});
+observerNotObserving2.observe({entryTypes: [&quot;mark&quot;]});
+observerNotObserving2.disconnect();
+
+// PerformanceObservers for different entry types should not fire.
+let observerNotMarks = new PerformanceObserver(function() {
+    testFailed(&quot;PerformanceObserver observing measures should not be called&quot;);
+});
+
+// Observer sees marks while it is registered.
+performance.mark(&quot;mark1&quot;);
+self.observer = new PerformanceObserver(function(list, obs) {
+    self.argumentsLength = arguments.length;
+    self.list = list;
+    self.obs = obs;
+    self.thisObject = this;
+    
+    debug(&quot;Inside PerformanceObserver callback&quot;);
+    shouldBeTrue(`argumentsLength === 2`);
+    shouldBeTrue(`list instanceof PerformanceObserverEntryList`);
+    shouldBeTrue(`obs instanceof PerformanceObserver`);
+    shouldBeTrue(`obs === observer`);
+    // FIXME: &lt;https://webkit.org/b/167549&gt; Invoking generated callback should allow setting the `this` object
+    shouldBeTrue(`thisObject instanceof PerformanceObserver`);
+    shouldBeTrue(`thisObject === observer`);
+
+    debug(&quot;&quot;);
+    debug(&quot;PerformanceObserverEntryList APIs&quot;);
+
+    shouldBeTrue(`list.getEntries() instanceof Array`);
+    shouldBeTrue(`list.getEntries().length === 2`);
+    shouldBeTrue(`list.getEntries()[0] instanceof PerformanceEntry`);
+    shouldBeEqualToString(`list.getEntries()[0].name`, &quot;mark3&quot;);
+    shouldBeEqualToString(`list.getEntries()[1].name`, &quot;mark4&quot;);
+    shouldBeTrue(`list.getEntries()[0].startTime &lt;= list.getEntries()[1].startTime`);
+
+    shouldThrow(`list.getEntriesByType()`);
+    shouldBeTrue(`list.getEntriesByType(&quot;not-real&quot;).length === 0`);
+    shouldBeTrue(`list.getEntriesByType(&quot;mark&quot;).length === 2`);
+    shouldBeTrue(`list.getEntriesByType(&quot;mark&quot;)[0] instanceof PerformanceEntry`);
+    shouldBeEqualToString(`list.getEntriesByType(&quot;mark&quot;)[0].name`, &quot;mark3&quot;);
+    shouldBeEqualToString(`list.getEntriesByType(&quot;mark&quot;)[1].name`, &quot;mark4&quot;);
+
+    shouldThrow(`list.getEntriesByName()`);
+    shouldBeTrue(`list.getEntriesByName(&quot;not-real&quot;).length === 0`);
+    shouldBeTrue(`list.getEntriesByName(&quot;mark1&quot;).length === 0`);
+    shouldBeTrue(`list.getEntriesByName(&quot;mark3&quot;).length === 1`);
+    shouldBeTrue(`list.getEntriesByName(&quot;mark3&quot;)[0] instanceof PerformanceEntry`);
+    shouldBeEqualToString(`list.getEntriesByName(&quot;mark3&quot;)[0].name`, &quot;mark3&quot;);
+    shouldBeTrue(`list.getEntriesByName(&quot;mark4&quot;).length === 1`);
+    shouldBeTrue(`list.getEntriesByName(&quot;mark4&quot;)[0] instanceof PerformanceEntry`);
+    shouldBeEqualToString(`list.getEntriesByName(&quot;mark4&quot;)[0].name`, &quot;mark4&quot;);
+    
+    shouldThrow(`list.getEntriesByName()`);
+    shouldBeTrue(`list.getEntriesByName(&quot;not-real&quot;).length === 0`);
+    shouldBeTrue(`list.getEntriesByName(&quot;mark1&quot;).length === 0`);
+    shouldBeTrue(`list.getEntriesByName(&quot;mark3&quot;).length === 1`);
+    shouldBeTrue(`list.getEntriesByName(&quot;mark3&quot;)[0] instanceof PerformanceEntry`);
+    shouldBeEqualToString(`list.getEntriesByName(&quot;mark3&quot;)[0].name`, &quot;mark3&quot;);
+    shouldBeTrue(`list.getEntriesByName(&quot;mark4&quot;).length === 1`);
+    shouldBeTrue(`list.getEntriesByName(&quot;mark4&quot;)[0] instanceof PerformanceEntry`);
+    shouldBeEqualToString(`list.getEntriesByName(&quot;mark4&quot;)[0].name`, &quot;mark4&quot;);
+
+    shouldBeTrue(`list.getEntriesByName(&quot;mark3&quot;, &quot;not-real&quot;).length === 0`);
+    shouldBeTrue(`list.getEntriesByName(&quot;mark3&quot;, &quot;mark&quot;).length === 1`);
+    shouldBeTrue(`list.getEntriesByName(null, &quot;mark&quot;).length === 0`);
+    shouldBeTrue(`list.getEntriesByName(undefined, &quot;mark&quot;).length === 0`);
+
+    if (self.importScripts)
+        finishJSTest();
+    else
+        testWorker();
+});
+performance.mark(&quot;mark2&quot;);
+observer.observe({entryTypes: [&quot;mark&quot;]});
+performance.mark(&quot;mark3&quot;);
+performance.mark(&quot;mark4&quot;);
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiresourcestimeorigininworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/resources/time-origin-in-worker.js (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/resources/time-origin-in-worker.js                                (rev 0)
+++ trunk/LayoutTests/performance-api/resources/time-origin-in-worker.js        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+importScripts(&quot;../../resources/js-test-pre.js&quot;);
+
+shouldBeTrue(`performance.now() &lt; 200`);
+
+finishJSTest();
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiresourcestimelineapijsfromrev211593trunkLayoutTestsperformanceapiperformancetimelineapihtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/performance-api/resources/timeline-api.js (from rev 211593, trunk/LayoutTests/performance-api/performance-timeline-api.html) (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/resources/timeline-api.js                                (rev 0)
+++ trunk/LayoutTests/performance-api/resources/timeline-api.js        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+if (self.importScripts)
+    importScripts(&quot;../../resources/js-test-pre.js&quot;);
+
+if (self.window)
+    description(&quot;Basic Interface test for performance-timeline APIs.&quot;);
+
+debug(&quot;PerformanceEntry&quot;);
+shouldBeDefined(&quot;PerformanceEntry&quot;);
+shouldBeTrue(`&quot;name&quot; in PerformanceEntry.prototype`);
+shouldBeTrue(`&quot;entryType&quot; in PerformanceEntry.prototype`);
+shouldBeTrue(`&quot;startTime&quot; in PerformanceEntry.prototype`);
+shouldBeTrue(`&quot;duration&quot; in PerformanceEntry.prototype`);
+shouldThrow(`new PerformanceEntry()`);
+
+// NOTE: The APIs below may be going away. Replaced by PerformanceObserver.
+
+debug(&quot;&quot;);
+debug(&quot;Performance extensions&quot;);
+shouldBeDefined(`Performance.prototype.getEntries`);
+shouldBeDefined(`Performance.prototype.getEntriesByType`);
+shouldBeDefined(`Performance.prototype.getEntriesByName`);
+
+shouldBeTrue(`performance.getEntries() instanceof Array`);
+shouldBeTrue(`performance.getEntries().length === 0`);
+shouldNotThrow(`performance.mark(&quot;test&quot;);`);
+shouldBeTrue(`performance.getEntries().length === 1`);
+shouldBeTrue(`performance.getEntries()[0] instanceof PerformanceEntry`);
+shouldBeEqualToString(`performance.getEntries()[0].name`, &quot;test&quot;);
+shouldBeEqualToString(`performance.getEntries()[0].entryType`, &quot;mark&quot;);
+shouldBeTrue(`typeof performance.getEntries()[0].startTime === &quot;number&quot;`);
+shouldBeTrue(`typeof performance.getEntries()[0].duration === &quot;number&quot;`);
+
+shouldThrow(`performance.getEntriesByType()`);
+shouldBeTrue(`performance.getEntriesByType(&quot;not-real&quot;).length === 0`);
+shouldBeTrue(`performance.getEntriesByType(&quot;mark&quot;).length === 1`);
+shouldBeTrue(`performance.getEntriesByType(&quot;mark&quot;)[0] instanceof PerformanceEntry`);
+shouldBeEqualToString(`performance.getEntriesByType(&quot;mark&quot;)[0].name`, &quot;test&quot;);
+shouldBeEqualToString(`performance.getEntriesByType(&quot;mark&quot;)[0].entryType`, &quot;mark&quot;);
+shouldBeTrue(`typeof performance.getEntriesByType(&quot;mark&quot;)[0].startTime === &quot;number&quot;`);
+shouldBeTrue(`typeof performance.getEntriesByType(&quot;mark&quot;)[0].duration === &quot;number&quot;`);
+
+shouldThrow(`performance.getEntriesByName()`);
+shouldBeTrue(`performance.getEntriesByName(&quot;not-real&quot;).length === 0`);
+shouldBeTrue(`performance.getEntriesByName(&quot;test&quot;).length === 1`);
+shouldBeTrue(`performance.getEntriesByName(&quot;test&quot;)[0] instanceof PerformanceEntry`);
+shouldBeEqualToString(`performance.getEntriesByName(&quot;test&quot;)[0].name`, &quot;test&quot;);
+shouldBeEqualToString(`performance.getEntriesByName(&quot;test&quot;)[0].entryType`, &quot;mark&quot;);
+shouldBeTrue(`typeof performance.getEntriesByName(&quot;test&quot;)[0].startTime === &quot;number&quot;`);
+shouldBeTrue(`typeof performance.getEntriesByName(&quot;test&quot;)[0].duration === &quot;number&quot;`);
+shouldBeTrue(`performance.getEntriesByName(&quot;test&quot;, &quot;not-real&quot;).length === 0`);
+shouldBeTrue(`performance.getEntriesByName(&quot;test&quot;, &quot;mark&quot;).length === 1`);
+
+if (self.importScripts)
+    finishJSTest();
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiresourcesusertimingapijs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/resources/user-timing-api.js (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/resources/user-timing-api.js                                (rev 0)
+++ trunk/LayoutTests/performance-api/resources/user-timing-api.js        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+if (self.importScripts)
+    importScripts(&quot;../../resources/js-test-pre.js&quot;);
+
+if (self.window)
+    description(&quot;Basic Interface test for user-timing APIs.&quot;);
+
+debug(&quot;PerformanceMark&quot;);
+shouldBeDefined(&quot;PerformanceMark&quot;);
+shouldThrow(`new PerformanceMark()`);
+
+debug(&quot;&quot;);
+debug(&quot;PerformanceMeasure&quot;);
+shouldBeDefined(&quot;PerformanceMeasure&quot;);
+shouldThrow(`new PerformanceMeasure()`);
+
+debug(&quot;&quot;);
+debug(&quot;Performance extensions&quot;);
+shouldBeDefined(`Performance.prototype.mark`);
+shouldBeDefined(`Performance.prototype.measure`);
+shouldBeDefined(`Performance.prototype.clearMarks`);
+shouldBeDefined(`Performance.prototype.clearMeasures`);
+shouldThrow(`performance.mark()`);
+shouldNotThrow(`performance.mark(&quot;mark_name&quot;)`);
+shouldThrow(`performance.measure()`);
+shouldNotThrow(`performance.measure(&quot;measure_name&quot;)`);
+shouldNotThrow(`performance.clearMarks()`);
+shouldNotThrow(`performance.clearMarks(&quot;mark_name&quot;)`);
+shouldNotThrow(`performance.clearMeasures()`);
+shouldNotThrow(`performance.clearMeasures(&quot;measure_name&quot;)`);
+
+if (self.importScripts)
+    finishJSTest();
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiusertimingapisexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/user-timing-apis-expected.txt (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/user-timing-apis-expected.txt                                (rev 0)
+++ trunk/LayoutTests/performance-api/user-timing-apis-expected.txt        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+Basic Interface test for user-timing APIs.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PerformanceMark
+PASS PerformanceMark is defined.
+PASS new PerformanceMark() threw exception TypeError: function is not a constructor (evaluating 'new PerformanceMark()').
+
+PerformanceMeasure
+PASS PerformanceMeasure is defined.
+PASS new PerformanceMeasure() threw exception TypeError: function is not a constructor (evaluating 'new PerformanceMeasure()').
+
+Performance extensions
+PASS Performance.prototype.mark is defined.
+PASS Performance.prototype.measure is defined.
+PASS Performance.prototype.clearMarks is defined.
+PASS Performance.prototype.clearMeasures is defined.
+PASS performance.mark() threw exception TypeError: Not enough arguments.
+PASS performance.mark(&quot;mark_name&quot;) did not throw exception.
+PASS performance.measure() threw exception TypeError: Not enough arguments.
+PASS performance.measure(&quot;measure_name&quot;) did not throw exception.
+PASS performance.clearMarks() did not throw exception.
+PASS performance.clearMarks(&quot;mark_name&quot;) did not throw exception.
+PASS performance.clearMeasures() did not throw exception.
+PASS performance.clearMeasures(&quot;measure_name&quot;) did not throw exception.
+
+Starting worker: resources/user-timing-api.js
+[Worker] PerformanceMark
+PASS [Worker] PerformanceMark is defined.
+PASS [Worker] new PerformanceMark() threw exception TypeError: function is not a constructor (evaluating 'new PerformanceMark()').
+[Worker] 
+[Worker] PerformanceMeasure
+PASS [Worker] PerformanceMeasure is defined.
+PASS [Worker] new PerformanceMeasure() threw exception TypeError: function is not a constructor (evaluating 'new PerformanceMeasure()').
+[Worker] 
+[Worker] Performance extensions
+PASS [Worker] Performance.prototype.mark is defined.
+PASS [Worker] Performance.prototype.measure is defined.
+PASS [Worker] Performance.prototype.clearMarks is defined.
+PASS [Worker] Performance.prototype.clearMeasures is defined.
+PASS [Worker] performance.mark() threw exception TypeError: Not enough arguments.
+PASS [Worker] performance.mark(&quot;mark_name&quot;) did not throw exception.
+PASS [Worker] performance.measure() threw exception TypeError: Not enough arguments.
+PASS [Worker] performance.measure(&quot;measure_name&quot;) did not throw exception.
+PASS [Worker] performance.clearMarks() did not throw exception.
+PASS [Worker] performance.clearMarks(&quot;mark_name&quot;) did not throw exception.
+PASS [Worker] performance.clearMeasures() did not throw exception.
+PASS [Worker] performance.clearMeasures(&quot;measure_name&quot;) did not throw exception.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsperformanceapiusertimingapishtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/performance-api/user-timing-apis.html (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/performance-api/user-timing-apis.html                                (rev 0)
+++ trunk/LayoutTests/performance-api/user-timing-apis.html        2017-02-02 22:07:28 UTC (rev 211594)
</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/user-timing-api.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+debug(&quot;&quot;);
+let worker = startWorker(&quot;resources/user-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="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/CMakeLists.txt        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -587,6 +587,7 @@
</span><span class="cx">     page/DOMWindow.idl
</span><span class="cx">     page/EventSource.idl
</span><span class="cx">     page/GlobalCrypto.idl
</span><ins>+    page/GlobalPerformance.idl
</ins><span class="cx">     page/History.idl
</span><span class="cx">     page/IntersectionObserver.idl
</span><span class="cx">     page/IntersectionObserverCallback.idl
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/ChangeLog        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -1,3 +1,82 @@
</span><ins>+2017-02-02  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Support Performance API (performance.now(), UserTiming) in Workers
+        https://bugs.webkit.org/show_bug.cgi?id=167717
+
+        Reviewed by Ryosuke Niwa.
+
+        Tests: performance-api/performance-mark-name.html
+               performance-api/performance-now-api.html
+               performance-api/performance-now-time-origin-in-worker.html
+               performance-api/user-timing-apis.html
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        New files.
+
+        * page/DOMWindow.idl:
+        * page/GlobalPerformance.idl:
+        * workers/WorkerGlobalScope.idl:
+        Add partial interface for performance attribute.
+
+        * page/Performance.idl:
+        * page/PerformanceEntry.idl:
+        * page/PerformanceMark.idl:
+        * page/PerformanceMeasure.idl:
+        * page/PerformanceObserver.idl:
+        * page/PerformanceObserverEntryList.idl:
+        Expose these to Workers.
+
+        * page/Performance.cpp:
+        (WebCore::Performance::Performance):
+        (WebCore::Performance::contextDestroyed):
+        * page/Performance.h:
+        Use the EventQueue variant that works with any ScriptExectionContext.
+
+        * page/PerformanceObserver.cpp:
+        (WebCore::PerformanceObserver::PerformanceObserver):
+        Get the Performance base in a Worker context.
+
+        * page/PerformanceUserTiming.cpp:
+        (WebCore::UserTiming::mark):
+        Only reject legacy special mark names in a Window, not a Worker.
+
+        (WebCore::UserTiming::findExistingMarkStartTime):
+        Simple implementation returns 0 as the start time in Workers. The spec
+        is currently imprecise here, but it does not have the unusual
+        PerformanceTiming behavior in a Window which is part of User Timing 1.
+
+        * workers/Worker.cpp:
+        (WebCore::Worker::create):
+        (WebCore::Worker::notifyFinished):
+        * workers/Worker.h:
+        Record the moment of Worker creation.
+
+        * workers/WorkerGlobalScope.cpp:
+        (WebCore::WorkerGlobalScope::WorkerGlobalScope):
+        (WebCore::WorkerGlobalScope::performance):
+        * workers/WorkerGlobalScope.h:
+        Construct the Performance object with the moment of creation (timeOrigin).
+
+        * workers/DedicatedWorkerGlobalScope.cpp:
+        (WebCore::DedicatedWorkerGlobalScope::create):
+        (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
+        * workers/DedicatedWorkerGlobalScope.h:
+        * workers/DedicatedWorkerThread.cpp:
+        (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
+        (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
+        * workers/DedicatedWorkerThread.h:
+        * workers/WorkerGlobalScopeProxy.h:
+        * workers/WorkerMessagingProxy.cpp:
+        (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
+        * workers/WorkerMessagingProxy.h:
+        * workers/WorkerThread.cpp:
+        (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
+        (WebCore::WorkerThread::WorkerThread):
+        (WebCore::WorkerThread::workerThread):
+        * workers/WorkerThread.h:
+        Pass the moment of creation (timeOrigin) through to WorkerGlobalScope creation.
+
</ins><span class="cx"> 2017-02-02  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r211579.
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/DerivedSources.make        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -569,6 +569,7 @@
</span><span class="cx">     $(WebCore)/page/DOMWindow.idl \
</span><span class="cx">     $(WebCore)/page/EventSource.idl \
</span><span class="cx">     $(WebCore)/page/GlobalCrypto.idl \
</span><ins>+    $(WebCore)/page/GlobalPerformance.idl \
</ins><span class="cx">     $(WebCore)/page/History.idl \
</span><span class="cx">     $(WebCore)/page/IntersectionObserver.idl \
</span><span class="cx">     $(WebCore)/page/IntersectionObserverCallback.idl \
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.idl (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.idl        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/page/DOMWindow.idl        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -157,8 +157,6 @@
</span><span class="cx"> 
</span><span class="cx">     [CallWith=ScriptState&amp;CallerWindow, DoNotCheckSecurity, ForwardDeclareInHeader, MayThrowException] void postMessage(any message, USVString targetOrigin, optional sequence&lt;object&gt; transfer = []);
</span><span class="cx"> 
</span><del>-    [Conditional=WEB_TIMING, Replaceable] readonly attribute Performance performance;
-
</del><span class="cx">     long requestAnimationFrame(RequestAnimationFrameCallback callback);
</span><span class="cx">     void cancelAnimationFrame(long id);
</span><span class="cx">     long webkitRequestAnimationFrame(RequestAnimationFrameCallback callback);
</span><span class="lines">@@ -202,5 +200,6 @@
</span><span class="cx"> 
</span><span class="cx"> DOMWindow implements GlobalCrypto;
</span><span class="cx"> DOMWindow implements GlobalEventHandlers;
</span><ins>+DOMWindow implements GlobalPerformance;
</ins><span class="cx"> DOMWindow implements WindowEventHandlers;
</span><span class="cx"> DOMWindow implements WindowOrWorkerGlobalScope;
</span></span></pre></div>
<a id="trunkSourceWebCorepageGlobalPerformanceidlfromrev211593trunkSourceWebCorepagePerformanceMarkidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/page/GlobalPerformance.idl (from rev 211593, trunk/Source/WebCore/page/PerformanceMark.idl) (0 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/GlobalPerformance.idl                                (rev 0)
+++ trunk/Source/WebCore/page/GlobalPerformance.idl        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -0,0 +1,33 @@
</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. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// https://w3c.github.io/hr-time/
+
+[
+    NoInterfaceObject,
+    Exposed=(Window,Worker)
+] interface GlobalPerformance {
+    [Conditional=WEB_TIMING, Replaceable] readonly attribute Performance performance;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorepagePerformancecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Performance.cpp (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Performance.cpp        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/page/Performance.cpp        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> Performance::Performance(ScriptExecutionContext&amp; context, double timeOrigin)
</span><span class="cx">     : ContextDestructionObserver(&amp;context)
</span><span class="cx">     , m_timeOrigin(timeOrigin)
</span><ins>+    , m_performanceTimelineTaskQueue(context)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_timeOrigin);
</span><span class="cx"> }
</span><span class="lines">@@ -62,6 +63,13 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Performance::contextDestroyed()
+{
+    m_performanceTimelineTaskQueue.close();
+
+    ContextDestructionObserver::contextDestroyed();
+}
+
</ins><span class="cx"> double Performance::now() const
</span><span class="cx"> {
</span><span class="cx">     double nowSeconds = monotonicallyIncreasingTime() - m_timeOrigin;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Performance.h (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Performance.h        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/page/Performance.h        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -90,6 +90,8 @@
</span><span class="cx"> private:
</span><span class="cx">     Performance(ScriptExecutionContext&amp;, double timeOrigin);
</span><span class="cx"> 
</span><ins>+    void contextDestroyed() override;
+
</ins><span class="cx">     EventTargetInterface eventTargetInterface() const final { return PerformanceEventTargetInterfaceType; }
</span><span class="cx"> 
</span><span class="cx">     void refEventTarget() final { ref(); }
</span><span class="lines">@@ -110,7 +112,7 @@
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;UserTiming&gt; m_userTiming;
</span><span class="cx"> 
</span><del>-    GenericTaskQueue&lt;Timer&gt; m_performanceTimelineTaskQueue;
</del><ins>+    GenericTaskQueue&lt;ScriptExecutionContext&gt; m_performanceTimelineTaskQueue;
</ins><span class="cx">     ListHashSet&lt;RefPtr&lt;PerformanceObserver&gt;&gt; m_observers;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Performance.idl (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Performance.idl        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/page/Performance.idl        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=WEB_TIMING,
</span><ins>+    Exposed=(Window,Worker),
</ins><span class="cx">     GenerateIsReachable=ImplScriptExecutionContext,
</span><span class="cx"> ] interface Performance : EventTarget {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceEntryidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceEntry.idl (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceEntry.idl        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/page/PerformanceEntry.idl        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -34,8 +34,9 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=WEB_TIMING,
</span><ins>+    CustomToJSObject,
</ins><span class="cx">     EnabledAtRuntime=PerformanceTimeline,
</span><del>-    CustomToJSObject,
</del><ins>+    Exposed=(Window,Worker),
</ins><span class="cx"> ] interface PerformanceEntry {
</span><span class="cx">     readonly attribute DOMString name;
</span><span class="cx">     readonly attribute DOMString entryType;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceMarkidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceMark.idl (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceMark.idl        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/page/PerformanceMark.idl        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -28,5 +28,6 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=WEB_TIMING,
</span><span class="cx">     EnabledAtRuntime=UserTiming,
</span><ins>+    Exposed=(Window,Worker),
</ins><span class="cx"> ] interface PerformanceMark : PerformanceEntry {
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceMeasureidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceMeasure.idl (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceMeasure.idl        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/page/PerformanceMeasure.idl        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -28,5 +28,6 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=WEB_TIMING,
</span><span class="cx">     EnabledAtRuntime=UserTiming,
</span><ins>+    Exposed=(Window,Worker),
</ins><span class="cx"> ] interface PerformanceMeasure : PerformanceEntry {
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceObservercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceObserver.cpp (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceObserver.cpp        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/page/PerformanceObserver.cpp        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -45,7 +45,8 @@
</span><span class="cx">         if (DOMWindow* window = document.domWindow())
</span><span class="cx">             m_performance = window-&gt;performance();
</span><span class="cx">     } else if (is&lt;WorkerGlobalScope&gt;(scriptExecutionContext)) {
</span><del>-        // FIXME: Support Performance Timeline for Workers.
</del><ins>+        auto&amp; workerGlobalScope = downcast&lt;WorkerGlobalScope&gt;(scriptExecutionContext);
+        m_performance = &amp;workerGlobalScope.performance();
</ins><span class="cx">     } else
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceObserveridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceObserver.idl (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceObserver.idl        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/page/PerformanceObserver.idl        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx">     Constructor(PerformanceObserverCallback callback),
</span><span class="cx">     ConstructorCallWith=ScriptExecutionContext,
</span><span class="cx">     EnabledAtRuntime=PerformanceTimeline,
</span><ins>+    Exposed=(Window,Worker),
</ins><span class="cx">     ImplementationLacksVTable,
</span><span class="cx"> ] interface PerformanceObserver {
</span><span class="cx">     [MayThrowException] void observe(PerformanceObserverInit options);
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceObserverEntryListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceObserverEntryList.idl (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceObserverEntryList.idl        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/page/PerformanceObserverEntryList.idl        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=WEB_TIMING,
</span><span class="cx">     EnabledAtRuntime=PerformanceTimeline,
</span><ins>+    Exposed=(Window,Worker),
</ins><span class="cx">     ImplementationLacksVTable,
</span><span class="cx"> ] interface PerformanceObserverEntryList {
</span><span class="cx">     PerformanceEntryList getEntries();
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceUserTimingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceUserTiming.cpp (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceUserTiming.cpp        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/page/PerformanceUserTiming.cpp        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -28,10 +28,12 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><span class="cx"> 
</span><ins>+#include &quot;Document.h&quot;
</ins><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;Performance.h&quot;
</span><span class="cx"> #include &quot;PerformanceTiming.h&quot;
</span><span class="cx"> #include &lt;array&gt;
</span><ins>+#include &lt;wtf/MainThread.h&gt;
</ins><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/dtoa/utils.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -43,7 +45,8 @@
</span><span class="cx"> 
</span><span class="cx"> static NavigationTimingFunction restrictedMarkFunction(const String&amp; markName)
</span><span class="cx"> {
</span><del>-    // FIXME: Update this list when moving to Navigation Timing Level 2.
</del><ins>+    ASSERT(isMainThread());
+
</ins><span class="cx">     using MapPair = std::pair&lt;ASCIILiteral, NavigationTimingFunction&gt;;
</span><span class="cx">     static const std::array&lt;MapPair, 21&gt; pairs = { {
</span><span class="cx">         MapPair { ASCIILiteral(&quot;navigationStart&quot;), &amp;PerformanceTiming::navigationStart },
</span><span class="lines">@@ -97,8 +100,10 @@
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;Ref&lt;PerformanceMark&gt;&gt; UserTiming::mark(const String&amp; markName)
</span><span class="cx"> {
</span><del>-    if (restrictedMarkFunction(markName))
-        return Exception { SYNTAX_ERR };
</del><ins>+    if (is&lt;Document&gt;(m_performance.scriptExecutionContext())) {
+        if (restrictedMarkFunction(markName))
+            return Exception { SYNTAX_ERR };
+    }
</ins><span class="cx"> 
</span><span class="cx">     auto&amp; performanceEntryList = m_marksMap.ensure(markName, [] { return Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt;(); }).iterator-&gt;value;
</span><span class="cx">     auto entry = PerformanceMark::create(markName, m_performance.now());
</span><span class="lines">@@ -116,17 +121,15 @@
</span><span class="cx">     if (m_marksMap.contains(markName))
</span><span class="cx">         return m_marksMap.get(markName).last()-&gt;startTime();
</span><span class="cx"> 
</span><ins>+    PerformanceTiming* timing = m_performance.timing();
+    if (!timing)
+        return 0.0;
+
</ins><span class="cx">     if (auto function = restrictedMarkFunction(markName)) {
</span><del>-        if (PerformanceTiming* timing = m_performance.timing()) {
-            double value = static_cast&lt;double&gt;(((*timing).*(function))());
-            if (!value)
-                return Exception { INVALID_ACCESS_ERR };
-            return value - timing-&gt;navigationStart();
-        } else {
-            // FIXME: Support UserTiming in Workers.
-            ASSERT_NOT_REACHED();
-            return Exception { SYNTAX_ERR };
-        }
</del><ins>+        double value = static_cast&lt;double&gt;(((*timing).*(function))());
+        if (!value)
+            return Exception { INVALID_ACCESS_ERR };
+        return value - timing-&gt;navigationStart();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return Exception { SYNTAX_ERR };
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersDedicatedWorkerGlobalScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -41,16 +41,16 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-Ref&lt;DedicatedWorkerGlobalScope&gt; DedicatedWorkerGlobalScope::create(const URL&amp; url, const String&amp; identifier, const String&amp; userAgent, DedicatedWorkerThread&amp; thread, const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
</del><ins>+Ref&lt;DedicatedWorkerGlobalScope&gt; DedicatedWorkerGlobalScope::create(const URL&amp; url, const String&amp; identifier, const String&amp; userAgent, DedicatedWorkerThread&amp; thread, const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
</ins><span class="cx"> {
</span><del>-    auto context = adoptRef(*new DedicatedWorkerGlobalScope(url, identifier, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), connectionProxy, socketProvider));
</del><ins>+    auto context = adoptRef(*new DedicatedWorkerGlobalScope(url, identifier, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, connectionProxy, socketProvider));
</ins><span class="cx">     if (!shouldBypassMainWorldContentSecurityPolicy)
</span><span class="cx">         context-&gt;applyContentSecurityPolicyResponseHeaders(contentSecurityPolicyResponseHeaders);
</span><span class="cx">     return context;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const URL&amp; url, const String&amp; identifier, const String&amp; userAgent, DedicatedWorkerThread&amp; thread, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
-    : WorkerGlobalScope(url, identifier, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), connectionProxy, socketProvider)
</del><ins>+DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const URL&amp; url, const String&amp; identifier, const String&amp; userAgent, DedicatedWorkerThread&amp; thread, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
+    : WorkerGlobalScope(url, identifier, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, connectionProxy, socketProvider)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersDedicatedWorkerGlobalScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> 
</span><span class="cx"> class DedicatedWorkerGlobalScope final : public WorkerGlobalScope {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;DedicatedWorkerGlobalScope&gt; create(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, DedicatedWorkerThread&amp;, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
</del><ins>+    static Ref&lt;DedicatedWorkerGlobalScope&gt; create(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, DedicatedWorkerThread&amp;, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
</ins><span class="cx">     virtual ~DedicatedWorkerGlobalScope();
</span><span class="cx"> 
</span><span class="cx">     ExceptionOr&lt;void&gt; postMessage(JSC::ExecState&amp;, JSC::JSValue message, Vector&lt;JSC::Strong&lt;JSC::JSObject&gt;&gt;&amp;&amp;);
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> private:
</span><span class="cx">     using Base = WorkerGlobalScope;
</span><span class="cx"> 
</span><del>-    DedicatedWorkerGlobalScope(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, DedicatedWorkerThread&amp;, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
</del><ins>+    DedicatedWorkerGlobalScope(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, DedicatedWorkerThread&amp;, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
</ins><span class="cx"> 
</span><span class="cx">     bool isDedicatedWorkerGlobalScope() const final { return true; }
</span><span class="cx">     ExceptionOr&lt;void&gt; importScripts(const Vector&lt;String&gt;&amp; urls) final;
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersDedicatedWorkerThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -38,8 +38,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-DedicatedWorkerThread::DedicatedWorkerThread(const URL&amp; url, const String&amp; identifier, const String&amp; userAgent, const String&amp; sourceCode, WorkerLoaderProxy&amp; workerLoaderProxy, WorkerObjectProxy&amp; workerObjectProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin&amp; topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, JSC::RuntimeFlags runtimeFlags)
-    : WorkerThread(url, identifier, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy, socketProvider, runtimeFlags)
</del><ins>+DedicatedWorkerThread::DedicatedWorkerThread(const URL&amp; url, const String&amp; identifier, const String&amp; userAgent, const String&amp; sourceCode, WorkerLoaderProxy&amp; workerLoaderProxy, WorkerObjectProxy&amp; workerObjectProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin&amp; topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, JSC::RuntimeFlags runtimeFlags)
+    : WorkerThread(url, identifier, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, timeOrigin, connectionProxy, socketProvider, runtimeFlags)
</ins><span class="cx">     , m_workerObjectProxy(workerObjectProxy)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -48,9 +48,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;WorkerGlobalScope&gt; DedicatedWorkerThread::createWorkerGlobalScope(const URL&amp; url, const String&amp; identifier, const String&amp; userAgent, const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin)
</del><ins>+Ref&lt;WorkerGlobalScope&gt; DedicatedWorkerThread::createWorkerGlobalScope(const URL&amp; url, const String&amp; identifier, const String&amp; userAgent, const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, double timeOrigin)
</ins><span class="cx"> {
</span><del>-    return DedicatedWorkerGlobalScope::create(url, identifier, userAgent, *this, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), idbConnectionProxy(), socketProvider());
</del><ins>+    return DedicatedWorkerGlobalScope::create(url, identifier, userAgent, *this, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, idbConnectionProxy(), socketProvider());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DedicatedWorkerThread::runEventLoop()
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersDedicatedWorkerThreadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/DedicatedWorkerThread.h (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/DedicatedWorkerThread.h        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/DedicatedWorkerThread.h        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -49,11 +49,11 @@
</span><span class="cx">     WorkerObjectProxy&amp; workerObjectProxy() const { return m_workerObjectProxy; }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    Ref&lt;WorkerGlobalScope&gt; createWorkerGlobalScope(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin) override;
</del><ins>+    Ref&lt;WorkerGlobalScope&gt; createWorkerGlobalScope(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, double timeOrigin) override;
</ins><span class="cx">     void runEventLoop() override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    DedicatedWorkerThread(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, const String&amp; sourceCode, WorkerLoaderProxy&amp;, WorkerObjectProxy&amp;, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin&amp; topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags);
</del><ins>+    DedicatedWorkerThread(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, const String&amp; sourceCode, WorkerLoaderProxy&amp;, WorkerObjectProxy&amp;, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin&amp; topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags);
</ins><span class="cx"> 
</span><span class="cx">     WorkerObjectProxy&amp; m_workerObjectProxy;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/Worker.cpp (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/Worker.cpp        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/Worker.cpp        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -87,6 +87,9 @@
</span><span class="cx">     // The worker context does not exist while loading, so we must ensure that the worker object is not collected, nor are its event listeners.
</span><span class="cx">     worker-&gt;setPendingActivity(worker.ptr());
</span><span class="cx"> 
</span><ins>+    // https://html.spec.whatwg.org/multipage/workers.html#official-moment-of-creation
+    worker-&gt;m_momentOfCreation = monotonicallyIncreasingTime();
+
</ins><span class="cx">     worker-&gt;m_scriptLoader = WorkerScriptLoader::create();
</span><span class="cx">     auto contentSecurityPolicyEnforcement = shouldBypassMainWorldContentSecurityPolicy ? ContentSecurityPolicyEnforcement::DoNotEnforce : ContentSecurityPolicyEnforcement::EnforceChildSrcDirective;
</span><span class="cx">     worker-&gt;m_scriptLoader-&gt;loadAsynchronously(&amp;context, scriptURL.releaseReturnValue(), FetchOptions::Mode::SameOrigin, contentSecurityPolicyEnforcement, worker-&gt;m_identifier, worker.ptr());
</span><span class="lines">@@ -161,7 +164,7 @@
</span><span class="cx">         dispatchEvent(Event::create(eventNames().errorEvent, false, true));
</span><span class="cx">     else {
</span><span class="cx">         const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders = m_contentSecurityPolicyResponseHeaders ? m_contentSecurityPolicyResponseHeaders.value() : scriptExecutionContext()-&gt;contentSecurityPolicy()-&gt;responseHeaders();
</span><del>-        m_contextProxy.startWorkerGlobalScope(m_scriptLoader-&gt;url(), scriptExecutionContext()-&gt;userAgent(m_scriptLoader-&gt;url()), m_scriptLoader-&gt;script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_runtimeFlags);
</del><ins>+        m_contextProxy.startWorkerGlobalScope(m_scriptLoader-&gt;url(), scriptExecutionContext()-&gt;userAgent(m_scriptLoader-&gt;url()), m_scriptLoader-&gt;script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_momentOfCreation, m_runtimeFlags);
</ins><span class="cx">         InspectorInstrumentation::scriptImported(*scriptExecutionContext(), m_scriptLoader-&gt;identifier(), m_scriptLoader-&gt;script());
</span><span class="cx">     }
</span><span class="cx">     m_scriptLoader = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/Worker.h (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/Worker.h        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/Worker.h        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -82,6 +82,7 @@
</span><span class="cx">     String m_identifier;
</span><span class="cx">     WorkerGlobalScopeProxy&amp; m_contextProxy; // The proxy outlives the worker to perform thread shutdown.
</span><span class="cx">     std::optional&lt;ContentSecurityPolicyResponseHeaders&gt; m_contentSecurityPolicyResponseHeaders;
</span><ins>+    double m_momentOfCreation { 0 };
</ins><span class="cx">     bool m_shouldBypassMainWorldContentSecurityPolicy { false };
</span><span class="cx">     JSC::RuntimeFlags m_runtimeFlags;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;IDBConnectionProxy.h&quot;
</span><span class="cx"> #include &quot;InspectorInstrumentation.h&quot;
</span><ins>+#include &quot;Performance.h&quot;
</ins><span class="cx"> #include &quot;ScheduledAction.h&quot;
</span><span class="cx"> #include &quot;ScriptSourceCode.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="lines">@@ -52,7 +53,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-WorkerGlobalScope::WorkerGlobalScope(const URL&amp; url, const String&amp; identifier, const String&amp; userAgent, WorkerThread&amp; thread, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
</del><ins>+WorkerGlobalScope::WorkerGlobalScope(const URL&amp; url, const String&amp; identifier, const String&amp; userAgent, WorkerThread&amp; thread, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
</ins><span class="cx">     : m_url(url)
</span><span class="cx">     , m_identifier(identifier)
</span><span class="cx">     , m_userAgent(userAgent)
</span><span class="lines">@@ -68,6 +69,9 @@
</span><span class="cx"> #if ENABLE(WEB_SOCKETS)
</span><span class="cx">     , m_socketProvider(socketProvider)
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(WEB_TIMING)
+    , m_performance(Performance::create(*this, timeOrigin))
+#endif
</ins><span class="cx"> {
</span><span class="cx"> #if !ENABLE(INDEXED_DATABASE)
</span><span class="cx">     UNUSED_PARAM(connectionProxy);
</span><span class="lines">@@ -347,4 +351,13 @@
</span><span class="cx">     return *m_crypto;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEB_TIMING)
+
+Performance&amp; WorkerGlobalScope::performance() const
+{
+    return m_performance;
+}
+
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.h (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.h        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.h        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> 
</span><span class="cx"> class ContentSecurityPolicyResponseHeaders;
</span><span class="cx"> class Crypto;
</span><ins>+class Performance;
</ins><span class="cx"> class ScheduledAction;
</span><span class="cx"> class WorkerInspectorController;
</span><span class="cx"> class WorkerLocation;
</span><span class="lines">@@ -99,8 +100,12 @@
</span><span class="cx"> 
</span><span class="cx">     Crypto&amp; crypto();
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEB_TIMING)
+    Performance&amp; performance() const;
+#endif
+
</ins><span class="cx"> protected:
</span><del>-    WorkerGlobalScope(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, WorkerThread&amp;, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
</del><ins>+    WorkerGlobalScope(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, WorkerThread&amp;, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
</ins><span class="cx"> 
</span><span class="cx">     void applyContentSecurityPolicyResponseHeaders(const ContentSecurityPolicyResponseHeaders&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -171,6 +176,10 @@
</span><span class="cx">     RefPtr&lt;SocketProvider&gt; m_socketProvider;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEB_TIMING)
+    Ref&lt;Performance&gt; m_performance;
+#endif
+
</ins><span class="cx">     mutable RefPtr&lt;Crypto&gt; m_crypto;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.idl (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.idl        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.idl        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -62,4 +62,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WorkerGlobalScope implements GlobalCrypto;
</span><ins>+WorkerGlobalScope implements GlobalPerformance;
</ins><span class="cx"> WorkerGlobalScope implements WindowOrWorkerGlobalScope;
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopeProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> public:
</span><span class="cx">     static WorkerGlobalScopeProxy&amp; create(Worker&amp;);
</span><span class="cx"> 
</span><del>-    virtual void startWorkerGlobalScope(const URL&amp; scriptURL, const String&amp; userAgent, const String&amp; sourceCode, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, JSC::RuntimeFlags) = 0;
</del><ins>+    virtual void startWorkerGlobalScope(const URL&amp; scriptURL, const String&amp; userAgent, const String&amp; sourceCode, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, double timeOrigin, JSC::RuntimeFlags) = 0;
</ins><span class="cx">     virtual void terminateWorkerGlobalScope() = 0;
</span><span class="cx">     virtual void postMessageToWorkerGlobalScope(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp;, std::unique_ptr&lt;MessagePortChannelArray&gt;) = 0;
</span><span class="cx">     virtual bool hasPendingActivity() const = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerMessagingProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">         || (is&lt;WorkerGlobalScope&gt;(*m_scriptExecutionContext) &amp;&amp; currentThread() == downcast&lt;WorkerGlobalScope&gt;(*m_scriptExecutionContext).thread().threadID()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WorkerMessagingProxy::startWorkerGlobalScope(const URL&amp; scriptURL, const String&amp; userAgent, const String&amp; sourceCode, const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, JSC::RuntimeFlags runtimeFlags)
</del><ins>+void WorkerMessagingProxy::startWorkerGlobalScope(const URL&amp; scriptURL, const String&amp; userAgent, const String&amp; sourceCode, const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, double timeOrigin, JSC::RuntimeFlags runtimeFlags)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: This need to be revisited when we support nested worker one day
</span><span class="cx">     ASSERT(m_scriptExecutionContext);
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">     SocketProvider* socketProvider = nullptr;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    auto thread = DedicatedWorkerThread::create(scriptURL, identifier, userAgent, sourceCode, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), proxy, socketProvider, runtimeFlags);
</del><ins>+    auto thread = DedicatedWorkerThread::create(scriptURL, identifier, userAgent, sourceCode, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), timeOrigin, proxy, socketProvider, runtimeFlags);
</ins><span class="cx"> 
</span><span class="cx">     workerThreadCreated(thread.get());
</span><span class="cx">     thread-&gt;start();
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerMessagingProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerMessagingProxy.h (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerMessagingProxy.h        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.h        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Implementations of WorkerGlobalScopeProxy.
</span><span class="cx">     // (Only use these functions in the worker object thread.)
</span><del>-    void startWorkerGlobalScope(const URL&amp; scriptURL, const String&amp; userAgent, const String&amp; sourceCode, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, JSC::RuntimeFlags) final;
</del><ins>+    void startWorkerGlobalScope(const URL&amp; scriptURL, const String&amp; userAgent, const String&amp; sourceCode, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, double timeOrigin, JSC::RuntimeFlags) final;
</ins><span class="cx">     void terminateWorkerGlobalScope() final;
</span><span class="cx">     void postMessageToWorkerGlobalScope(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp;, std::unique_ptr&lt;MessagePortChannelArray&gt;) final;
</span><span class="cx">     bool hasPendingActivity() const final;
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerThread.cpp (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerThread.cpp        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/WorkerThread.cpp        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> struct WorkerThreadStartupData {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    WorkerThreadStartupData(const URL&amp; scriptURL, const String&amp; identifier, const String&amp; userAgent, const String&amp; sourceCode, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin&amp; topOrigin);
</del><ins>+    WorkerThreadStartupData(const URL&amp; scriptURL, const String&amp; identifier, const String&amp; userAgent, const String&amp; sourceCode, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin&amp; topOrigin, double timeOrigin);
</ins><span class="cx"> 
</span><span class="cx">     URL m_scriptURL;
</span><span class="cx">     String m_identifier;
</span><span class="lines">@@ -82,9 +82,10 @@
</span><span class="cx">     ContentSecurityPolicyResponseHeaders m_contentSecurityPolicyResponseHeaders;
</span><span class="cx">     bool m_shouldBypassMainWorldContentSecurityPolicy;
</span><span class="cx">     Ref&lt;SecurityOrigin&gt; m_topOrigin;
</span><ins>+    double m_timeOrigin;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-WorkerThreadStartupData::WorkerThreadStartupData(const URL&amp; scriptURL, const String&amp; identifier, const String&amp; userAgent, const String&amp; sourceCode, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin&amp; topOrigin)
</del><ins>+WorkerThreadStartupData::WorkerThreadStartupData(const URL&amp; scriptURL, const String&amp; identifier, const String&amp; userAgent, const String&amp; sourceCode, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin&amp; topOrigin, double timeOrigin)
</ins><span class="cx">     : m_scriptURL(scriptURL.isolatedCopy())
</span><span class="cx">     , m_identifier(identifier.isolatedCopy())
</span><span class="cx">     , m_userAgent(userAgent.isolatedCopy())
</span><span class="lines">@@ -93,15 +94,16 @@
</span><span class="cx">     , m_contentSecurityPolicyResponseHeaders(contentSecurityPolicyResponseHeaders.isolatedCopy())
</span><span class="cx">     , m_shouldBypassMainWorldContentSecurityPolicy(shouldBypassMainWorldContentSecurityPolicy)
</span><span class="cx">     , m_topOrigin(topOrigin.isolatedCopy())
</span><ins>+    , m_timeOrigin(timeOrigin)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WorkerThread::WorkerThread(const URL&amp; scriptURL, const String&amp; identifier, const String&amp; userAgent, const String&amp; sourceCode, WorkerLoaderProxy&amp; workerLoaderProxy, WorkerReportingProxy&amp; workerReportingProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin&amp; topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, JSC::RuntimeFlags runtimeFlags)
</del><ins>+WorkerThread::WorkerThread(const URL&amp; scriptURL, const String&amp; identifier, const String&amp; userAgent, const String&amp; sourceCode, WorkerLoaderProxy&amp; workerLoaderProxy, WorkerReportingProxy&amp; workerReportingProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders&amp; contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin&amp; topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, JSC::RuntimeFlags runtimeFlags)
</ins><span class="cx">     : m_threadID(0)
</span><span class="cx">     , m_workerLoaderProxy(workerLoaderProxy)
</span><span class="cx">     , m_workerReportingProxy(workerReportingProxy)
</span><span class="cx">     , m_runtimeFlags(runtimeFlags)
</span><del>-    , m_startupData(std::make_unique&lt;WorkerThreadStartupData&gt;(scriptURL, identifier, userAgent, sourceCode, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin))
</del><ins>+    , m_startupData(std::make_unique&lt;WorkerThreadStartupData&gt;(scriptURL, identifier, userAgent, sourceCode, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, timeOrigin))
</ins><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">     , m_idbConnectionProxy(connectionProxy)
</span><span class="cx"> #endif
</span><span class="lines">@@ -161,7 +163,7 @@
</span><span class="cx"> 
</span><span class="cx">     {
</span><span class="cx">         LockHolder lock(m_threadCreationMutex);
</span><del>-        m_workerGlobalScope = createWorkerGlobalScope(m_startupData-&gt;m_scriptURL, m_startupData-&gt;m_identifier, m_startupData-&gt;m_userAgent, m_startupData-&gt;m_contentSecurityPolicyResponseHeaders, m_startupData-&gt;m_shouldBypassMainWorldContentSecurityPolicy, WTFMove(m_startupData-&gt;m_topOrigin));
</del><ins>+        m_workerGlobalScope = createWorkerGlobalScope(m_startupData-&gt;m_scriptURL, m_startupData-&gt;m_identifier, m_startupData-&gt;m_userAgent, m_startupData-&gt;m_contentSecurityPolicyResponseHeaders, m_startupData-&gt;m_shouldBypassMainWorldContentSecurityPolicy, WTFMove(m_startupData-&gt;m_topOrigin), m_startupData-&gt;m_timeOrigin);
</ins><span class="cx"> 
</span><span class="cx">         if (m_runLoop.terminated()) {
</span><span class="cx">             // The worker was terminated before the thread had a chance to run. Since the context didn't exist yet,
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerThreadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerThread.h (211593 => 211594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerThread.h        2017-02-02 21:36:44 UTC (rev 211593)
+++ trunk/Source/WebCore/workers/WorkerThread.h        2017-02-02 22:07:28 UTC (rev 211594)
</span><span class="lines">@@ -80,10 +80,10 @@
</span><span class="cx">     JSC::RuntimeFlags runtimeFlags() const { return m_runtimeFlags; }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    WorkerThread(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, const String&amp; sourceCode, WorkerLoaderProxy&amp;, WorkerReportingProxy&amp;, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin&amp; topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags);
</del><ins>+    WorkerThread(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, const String&amp; sourceCode, WorkerLoaderProxy&amp;, WorkerReportingProxy&amp;, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin&amp; topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags);
</ins><span class="cx"> 
</span><span class="cx">     // Factory method for creating a new worker context for the thread.
</span><del>-    virtual Ref&lt;WorkerGlobalScope&gt; createWorkerGlobalScope(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin) = 0;
</del><ins>+    virtual Ref&lt;WorkerGlobalScope&gt; createWorkerGlobalScope(const URL&amp;, const String&amp; identifier, const String&amp; userAgent, const ContentSecurityPolicyResponseHeaders&amp;, bool shouldBypassMainWorldContentSecurityPolicy, Ref&lt;SecurityOrigin&gt;&amp;&amp; topOrigin, double timeOrigin) = 0;
</ins><span class="cx"> 
</span><span class="cx">     // Executes the event loop for the worker thread. Derived classes can override to perform actions before/after entering the event loop.
</span><span class="cx">     virtual void runEventLoop();
</span></span></pre>
</div>
</div>

</body>
</html>