<!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 <pecoraro@apple.com>
+
+ 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 <ryanhaddad@apple.com>
</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 "function () { window.performance.measure(timingAttributes..." 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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS performance.mark("navigationStart") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("unloadEventStart") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("unloadEventEnd") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("redirectStart") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("redirectEnd") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("fetchStart") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("domainLookupStart") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("domainLookupEnd") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("connectStart") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("connectEnd") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("secureConnectionStart") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("requestStart") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("responseStart") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("responseEnd") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("domLoading") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("domInteractive") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("domContentLoadedEventStart") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("domContentLoadedEventEnd") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("domComplete") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("loadEventStart") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("loadEventEnd") threw exception SyntaxError (DOM Exception 12): The string did not match the expected pattern..
+PASS performance.mark("mark_name") did not throw exception.
+
+Starting worker: resources/mark-name.js
+PASS [Worker] performance.mark("navigationStart") did not throw exception.
+PASS [Worker] performance.mark("unloadEventStart") did not throw exception.
+PASS [Worker] performance.mark("unloadEventEnd") did not throw exception.
+PASS [Worker] performance.mark("redirectStart") did not throw exception.
+PASS [Worker] performance.mark("redirectEnd") did not throw exception.
+PASS [Worker] performance.mark("fetchStart") did not throw exception.
+PASS [Worker] performance.mark("domainLookupStart") did not throw exception.
+PASS [Worker] performance.mark("domainLookupEnd") did not throw exception.
+PASS [Worker] performance.mark("connectStart") did not throw exception.
+PASS [Worker] performance.mark("connectEnd") did not throw exception.
+PASS [Worker] performance.mark("secureConnectionStart") did not throw exception.
+PASS [Worker] performance.mark("requestStart") did not throw exception.
+PASS [Worker] performance.mark("responseStart") did not throw exception.
+PASS [Worker] performance.mark("responseEnd") did not throw exception.
+PASS [Worker] performance.mark("domLoading") did not throw exception.
+PASS [Worker] performance.mark("domInteractive") did not throw exception.
+PASS [Worker] performance.mark("domContentLoadedEventStart") did not throw exception.
+PASS [Worker] performance.mark("domContentLoadedEventEnd") did not throw exception.
+PASS [Worker] performance.mark("domComplete") did not throw exception.
+PASS [Worker] performance.mark("loadEventStart") did not throw exception.
+PASS [Worker] performance.mark("loadEventEnd") did not throw exception.
+PASS [Worker] performance.mark("mark_name") 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>+<!DOCTYPE HTML>
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script src="resources/mark-name.js"></script>
+<script>
+debug("");
+let worker = startWorker("resources/mark-name.js");
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
</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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+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() === "number" is true
+PASS performance.now() <= performance.now() is true
+PASS delta >= 95 && delta <= 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() === "number" is true
+PASS [Worker] performance.now() <= performance.now() is true
+PASS [Worker] delta >= 95 && delta <= 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>+<!DOCTYPE HTML>
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script src="resources/now-api.js"></script>
+<script>
+function testWorker() {
+ debug("");
+ let worker = startWorker("resources/now-api.js");
+}
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
</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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+Starting worker: resources/time-origin-in-worker.js
+PASS [Worker] performance.now() < 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>+<!DOCTYPE HTML>
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+description("Ensure time origin in Worker starts from the moment of Worker Creation");
+self.jsTestIsAsync = true;
+
+while (performance.now() < 200)
+ continue;
+
+let worker = startWorker("resources/time-origin-in-worker.js");
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
</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("mark") 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:"mark"}) 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:["not-real"]}) threw exception TypeError: entryTypes contained only unsupported types.
+PASS [Worker] observer.observe({entryTypes:["mark"]}) did not throw exception.
+PASS [Worker] observer.observe({entryTypes:["mark", "not-real"]}) did not throw exception.
+PASS [Worker] observer.observe({entryTypes:["mark", "measure"]}) 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"> <script src="../resources/js-test-pre.js"></script>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span><ins>+<script src="resources/observer-api.js"></script>
</ins><span class="cx"> <script>
</span><del>-description("Basic Interface test for PerformanceObserver APIs.");
-
-debug("PerformanceObserver");
-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("mark")`);
-shouldThrow(`observer.observe({})`);
-shouldThrow(`observer.observe({entryTypes:"mark"})`);
-shouldThrow(`observer.observe({entryTypes:[]})`);
-shouldThrow(`observer.observe({entryTypes:["not-real"]})`);
-shouldNotThrow(`observer.observe({entryTypes:["mark"]})`);
-shouldNotThrow(`observer.observe({entryTypes:["mark", "not-real"]})`);
-shouldNotThrow(`observer.observe({entryTypes:["mark", "measure"]})`);
-shouldNotThrow(`observer.disconnect()`);
-shouldNotThrow(`observer.disconnect()`);
-
</del><span class="cx"> debug("");
</span><del>-debug("PerformanceObserverEntryList");
-shouldBeDefined(`PerformanceObserverEntryList`);
-shouldBeDefined(`PerformanceObserverEntryList.prototype.getEntries`);
-shouldBeDefined(`PerformanceObserverEntryList.prototype.getEntriesByType`);
-shouldBeDefined(`PerformanceObserverEntryList.prototype.getEntriesByName`);
-shouldThrow(`new PerformanceObserverEntryList()`);
</del><ins>+let worker = startWorker("resources/observer-api.js");
</ins><span class="cx"> </script>
</span><span class="cx"> <script src="../resources/js-test-post.js"></script>
</span><span class="cx"> </body>
</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("mark3", "mark").length === 1 is true
</span><span class="cx"> PASS list.getEntriesByName(null, "mark").length === 0 is true
</span><span class="cx"> PASS list.getEntriesByName(undefined, "mark").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 "mark3"
+PASS [Worker] list.getEntries()[1].name is "mark4"
+PASS [Worker] list.getEntries()[0].startTime <= list.getEntries()[1].startTime is true
+PASS [Worker] list.getEntriesByType() threw exception TypeError: Not enough arguments.
+PASS [Worker] list.getEntriesByType("not-real").length === 0 is true
+PASS [Worker] list.getEntriesByType("mark").length === 2 is true
+PASS [Worker] list.getEntriesByType("mark")[0] instanceof PerformanceEntry is true
+PASS [Worker] list.getEntriesByType("mark")[0].name is "mark3"
+PASS [Worker] list.getEntriesByType("mark")[1].name is "mark4"
+PASS [Worker] list.getEntriesByName() threw exception TypeError: Not enough arguments.
+PASS [Worker] list.getEntriesByName("not-real").length === 0 is true
+PASS [Worker] list.getEntriesByName("mark1").length === 0 is true
+PASS [Worker] list.getEntriesByName("mark3").length === 1 is true
+PASS [Worker] list.getEntriesByName("mark3")[0] instanceof PerformanceEntry is true
+PASS [Worker] list.getEntriesByName("mark3")[0].name is "mark3"
+PASS [Worker] list.getEntriesByName("mark4").length === 1 is true
+PASS [Worker] list.getEntriesByName("mark4")[0] instanceof PerformanceEntry is true
+PASS [Worker] list.getEntriesByName("mark4")[0].name is "mark4"
+PASS [Worker] list.getEntriesByName() threw exception TypeError: Not enough arguments.
+PASS [Worker] list.getEntriesByName("not-real").length === 0 is true
+PASS [Worker] list.getEntriesByName("mark1").length === 0 is true
+PASS [Worker] list.getEntriesByName("mark3").length === 1 is true
+PASS [Worker] list.getEntriesByName("mark3")[0] instanceof PerformanceEntry is true
+PASS [Worker] list.getEntriesByName("mark3")[0].name is "mark3"
+PASS [Worker] list.getEntriesByName("mark4").length === 1 is true
+PASS [Worker] list.getEntriesByName("mark4")[0] instanceof PerformanceEntry is true
+PASS [Worker] list.getEntriesByName("mark4")[0].name is "mark4"
+PASS [Worker] list.getEntriesByName("mark3", "not-real").length === 0 is true
+PASS [Worker] list.getEntriesByName("mark3", "mark").length === 1 is true
+PASS [Worker] list.getEntriesByName(null, "mark").length === 0 is true
+PASS [Worker] list.getEntriesByName(undefined, "mark").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"> <script src="../resources/js-test-pre.js"></script>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span><ins>+<script src="resources/observer-basic.js"></script>
</ins><span class="cx"> <script>
</span><del>-description("Basic Behavior test for PerformanceObserver APIs.");
-window.jsTestIsAsync = true;
-
-// PerformanceObservers that are not actively observing should not fire.
-let observerNotObserving = new PerformanceObserver(function() {
- testFailed("PerformanceObserver never registered should not be called");
-});
-
-let observerNotObserving2 = new PerformanceObserver(function() {
- testFailed("PerformanceObserver not actively observing should not be called");
-});
-observerNotObserving2.observe({entryTypes: ["mark"]});
-observerNotObserving2.disconnect();
-
-// PerformanceObservers for different entry types should not fire.
-let observerNotMarks = new PerformanceObserver(function() {
- testFailed("PerformanceObserver observing measures should not be called");
-});
-
-// Observer sees marks while it is registered.
-performance.mark("mark1");
-window.observer = new PerformanceObserver(function(list, obs) {
- window.argumentsLength = arguments.length;
- window.list = list;
- window.obs = obs;
- window.thisObject = this;
-
- debug("Inside PerformanceObserver callback");
- shouldBeTrue(`argumentsLength === 2`);
- shouldBeTrue(`list instanceof PerformanceObserverEntryList`);
- shouldBeTrue(`obs instanceof PerformanceObserver`);
- shouldBeTrue(`obs === observer`);
- // FIXME: <https://webkit.org/b/167549> 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("");
</span><del>- debug("PerformanceObserverEntryList APIs");
-
- shouldBeTrue(`list.getEntries() instanceof Array`);
- shouldBeTrue(`list.getEntries().length === 2`);
- shouldBeTrue(`list.getEntries()[0] instanceof PerformanceEntry`);
- shouldBeEqualToString(`list.getEntries()[0].name`, "mark3");
- shouldBeEqualToString(`list.getEntries()[1].name`, "mark4");
- shouldBeTrue(`list.getEntries()[0].startTime <= list.getEntries()[1].startTime`);
-
- shouldThrow(`list.getEntriesByType()`);
- shouldBeTrue(`list.getEntriesByType("not-real").length === 0`);
- shouldBeTrue(`list.getEntriesByType("mark").length === 2`);
- shouldBeTrue(`list.getEntriesByType("mark")[0] instanceof PerformanceEntry`);
- shouldBeEqualToString(`list.getEntriesByType("mark")[0].name`, "mark3");
- shouldBeEqualToString(`list.getEntriesByType("mark")[1].name`, "mark4");
-
- shouldThrow(`list.getEntriesByName()`);
- shouldBeTrue(`list.getEntriesByName("not-real").length === 0`);
- shouldBeTrue(`list.getEntriesByName("mark1").length === 0`);
- shouldBeTrue(`list.getEntriesByName("mark3").length === 1`);
- shouldBeTrue(`list.getEntriesByName("mark3")[0] instanceof PerformanceEntry`);
- shouldBeEqualToString(`list.getEntriesByName("mark3")[0].name`, "mark3");
- shouldBeTrue(`list.getEntriesByName("mark4").length === 1`);
- shouldBeTrue(`list.getEntriesByName("mark4")[0] instanceof PerformanceEntry`);
- shouldBeEqualToString(`list.getEntriesByName("mark4")[0].name`, "mark4");
-
- shouldThrow(`list.getEntriesByName()`);
- shouldBeTrue(`list.getEntriesByName("not-real").length === 0`);
- shouldBeTrue(`list.getEntriesByName("mark1").length === 0`);
- shouldBeTrue(`list.getEntriesByName("mark3").length === 1`);
- shouldBeTrue(`list.getEntriesByName("mark3")[0] instanceof PerformanceEntry`);
- shouldBeEqualToString(`list.getEntriesByName("mark3")[0].name`, "mark3");
- shouldBeTrue(`list.getEntriesByName("mark4").length === 1`);
- shouldBeTrue(`list.getEntriesByName("mark4")[0] instanceof PerformanceEntry`);
- shouldBeEqualToString(`list.getEntriesByName("mark4")[0].name`, "mark4");
-
- shouldBeTrue(`list.getEntriesByName("mark3", "not-real").length === 0`);
- shouldBeTrue(`list.getEntriesByName("mark3", "mark").length === 1`);
- shouldBeTrue(`list.getEntriesByName(null, "mark").length === 0`);
- shouldBeTrue(`list.getEntriesByName(undefined, "mark").length === 0`);
-
- finishJSTest();
-});
-performance.mark("mark2");
-observer.observe({entryTypes: ["mark"]});
-performance.mark("mark3");
-performance.mark("mark4");
</del><ins>+ let worker = startWorker("resources/observer-basic.js");
+}
</ins><span class="cx"> </script>
</span><span class="cx"> <script src="../resources/js-test-post.js"></script>
</span><span class="cx"> </body>
</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("test")[0].duration === "number" is true
</span><span class="cx"> PASS performance.getEntriesByName("test", "not-real").length === 0 is true
</span><span class="cx"> PASS performance.getEntriesByName("test", "mark").length === 1 is true
</span><ins>+
+Starting worker: resources/timeline-api.js
+[Worker] PerformanceEntry
+PASS [Worker] PerformanceEntry is defined.
+PASS [Worker] "name" in PerformanceEntry.prototype is true
+PASS [Worker] "entryType" in PerformanceEntry.prototype is true
+PASS [Worker] "startTime" in PerformanceEntry.prototype is true
+PASS [Worker] "duration" 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("test"); 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 "test"
+PASS [Worker] performance.getEntries()[0].entryType is "mark"
+PASS [Worker] typeof performance.getEntries()[0].startTime === "number" is true
+PASS [Worker] typeof performance.getEntries()[0].duration === "number" is true
+PASS [Worker] performance.getEntriesByType() threw exception TypeError: Not enough arguments.
+PASS [Worker] performance.getEntriesByType("not-real").length === 0 is true
+PASS [Worker] performance.getEntriesByType("mark").length === 1 is true
+PASS [Worker] performance.getEntriesByType("mark")[0] instanceof PerformanceEntry is true
+PASS [Worker] performance.getEntriesByType("mark")[0].name is "test"
+PASS [Worker] performance.getEntriesByType("mark")[0].entryType is "mark"
+PASS [Worker] typeof performance.getEntriesByType("mark")[0].startTime === "number" is true
+PASS [Worker] typeof performance.getEntriesByType("mark")[0].duration === "number" is true
+PASS [Worker] performance.getEntriesByName() threw exception TypeError: Not enough arguments.
+PASS [Worker] performance.getEntriesByName("not-real").length === 0 is true
+PASS [Worker] performance.getEntriesByName("test").length === 1 is true
+PASS [Worker] performance.getEntriesByName("test")[0] instanceof PerformanceEntry is true
+PASS [Worker] performance.getEntriesByName("test")[0].name is "test"
+PASS [Worker] performance.getEntriesByName("test")[0].entryType is "mark"
+PASS [Worker] typeof performance.getEntriesByName("test")[0].startTime === "number" is true
+PASS [Worker] typeof performance.getEntriesByName("test")[0].duration === "number" is true
+PASS [Worker] performance.getEntriesByName("test", "not-real").length === 0 is true
+PASS [Worker] performance.getEntriesByName("test", "mark").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"> <script src="../resources/js-test-pre.js"></script>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span><ins>+<script src="resources/timeline-api.js"></script>
</ins><span class="cx"> <script>
</span><del>-description("Basic Interface test for performance-timeline APIs.");
-
-debug("PerformanceEntry");
-shouldBeDefined("PerformanceEntry");
-shouldBeTrue(`"name" in PerformanceEntry.prototype`);
-shouldBeTrue(`"entryType" in PerformanceEntry.prototype`);
-shouldBeTrue(`"startTime" in PerformanceEntry.prototype`);
-shouldBeTrue(`"duration" in PerformanceEntry.prototype`);
-shouldThrow(`new PerformanceEntry()`);
-
-// NOTE: The APIs below may be going away. Replaced by PerformanceObserver.
-
</del><span class="cx"> debug("");
</span><del>-debug("Performance extensions");
-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("test");`);
-shouldBeTrue(`performance.getEntries().length === 1`);
-shouldBeTrue(`performance.getEntries()[0] instanceof PerformanceEntry`);
-shouldBeEqualToString(`performance.getEntries()[0].name`, "test");
-shouldBeEqualToString(`performance.getEntries()[0].entryType`, "mark");
-shouldBeTrue(`typeof performance.getEntries()[0].startTime === "number"`);
-shouldBeTrue(`typeof performance.getEntries()[0].duration === "number"`);
-
-shouldThrow(`performance.getEntriesByType()`);
-shouldBeTrue(`performance.getEntriesByType("not-real").length === 0`);
-shouldBeTrue(`performance.getEntriesByType("mark").length === 1`);
-shouldBeTrue(`performance.getEntriesByType("mark")[0] instanceof PerformanceEntry`);
-shouldBeEqualToString(`performance.getEntriesByType("mark")[0].name`, "test");
-shouldBeEqualToString(`performance.getEntriesByType("mark")[0].entryType`, "mark");
-shouldBeTrue(`typeof performance.getEntriesByType("mark")[0].startTime === "number"`);
-shouldBeTrue(`typeof performance.getEntriesByType("mark")[0].duration === "number"`);
-
-shouldThrow(`performance.getEntriesByName()`);
-shouldBeTrue(`performance.getEntriesByName("not-real").length === 0`);
-shouldBeTrue(`performance.getEntriesByName("test").length === 1`);
-shouldBeTrue(`performance.getEntriesByName("test")[0] instanceof PerformanceEntry`);
-shouldBeEqualToString(`performance.getEntriesByName("test")[0].name`, "test");
-shouldBeEqualToString(`performance.getEntriesByName("test")[0].entryType`, "mark");
-shouldBeTrue(`typeof performance.getEntriesByName("test")[0].startTime === "number"`);
-shouldBeTrue(`typeof performance.getEntriesByName("test")[0].duration === "number"`);
-shouldBeTrue(`performance.getEntriesByName("test", "not-real").length === 0`);
-shouldBeTrue(`performance.getEntriesByName("test", "mark").length === 1`);
</del><ins>+let worker = startWorker("resources/timeline-api.js");
</ins><span class="cx"> </script>
</span><span class="cx"> <script src="../resources/js-test-post.js"></script>
</span><span class="cx"> </body>
</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("../../resources/js-test-pre.js");
+
+self.jsTestIsAsync = true;
+
+if (self.window)
+ description("Tests performance.mark name restrictions apply only in Window.");
+
+const reservedLegacyPerformanceTimingAttributeNames = [
+ "navigationStart",
+ "unloadEventStart",
+ "unloadEventEnd",
+ "redirectStart",
+ "redirectEnd",
+ "fetchStart",
+ "domainLookupStart",
+ "domainLookupEnd",
+ "connectStart",
+ "connectEnd",
+ "secureConnectionStart",
+ "requestStart",
+ "responseStart",
+ "responseEnd",
+ "domLoading",
+ "domInteractive",
+ "domContentLoadedEventStart",
+ "domContentLoadedEventEnd",
+ "domComplete",
+ "loadEventStart",
+ "loadEventEnd",
+];
+
+let t = self.window ? shouldThrow : shouldNotThrow;
+for (let name of reservedLegacyPerformanceTimingAttributeNames)
+ t(`performance.mark("${name}")`);
+
+shouldNotThrow(`performance.mark("mark_name")`);
+
+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("../../resources/js-test-pre.js");
+
+self.jsTestIsAsync = true;
+
+if (self.window)
+ description("Basic Interface test for High Resolution Time APIs.");
+
+debug("Performance");
+shouldBeDefined(`Performance`);
+shouldBeDefined(`Performance.prototype.now`);
+shouldThrow(`new Performance()`);
+
+debug("performance");
+shouldBeDefined(`performance`);
+shouldBeTrue(`performance instanceof Performance`);
+shouldBeTrue(`typeof performance.now() === "number"`);
+shouldBeTrue(`performance.now() <= performance.now()`);
+
+self.time1 = performance.now();
+setTimeout(function() {
+ self.delta = performance.now() - time1;
+ // Allow for ~20ms error.
+ shouldBeTrue(`delta >= 95 && delta <= 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("../../resources/js-test-pre.js");
+
+if (self.window)
+ description("Basic Interface test for PerformanceObserver APIs.");
+
+debug("PerformanceObserver");
+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("mark")`);
+shouldThrow(`observer.observe({})`);
+shouldThrow(`observer.observe({entryTypes:"mark"})`);
+shouldThrow(`observer.observe({entryTypes:[]})`);
+shouldThrow(`observer.observe({entryTypes:["not-real"]})`);
+shouldNotThrow(`observer.observe({entryTypes:["mark"]})`);
+shouldNotThrow(`observer.observe({entryTypes:["mark", "not-real"]})`);
+shouldNotThrow(`observer.observe({entryTypes:["mark", "measure"]})`);
+shouldNotThrow(`observer.disconnect()`);
+shouldNotThrow(`observer.disconnect()`);
+
+debug("");
+debug("PerformanceObserverEntryList");
+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("../../resources/js-test-pre.js");
+
+self.jsTestIsAsync = true;
+
+if (self.window)
+ description("Basic Behavior test for PerformanceObserver APIs.");
+
+// PerformanceObservers that are not actively observing should not fire.
+let observerNotObserving = new PerformanceObserver(function() {
+ testFailed("PerformanceObserver never registered should not be called");
+});
+
+let observerNotObserving2 = new PerformanceObserver(function() {
+ testFailed("PerformanceObserver not actively observing should not be called");
+});
+observerNotObserving2.observe({entryTypes: ["mark"]});
+observerNotObserving2.disconnect();
+
+// PerformanceObservers for different entry types should not fire.
+let observerNotMarks = new PerformanceObserver(function() {
+ testFailed("PerformanceObserver observing measures should not be called");
+});
+
+// Observer sees marks while it is registered.
+performance.mark("mark1");
+self.observer = new PerformanceObserver(function(list, obs) {
+ self.argumentsLength = arguments.length;
+ self.list = list;
+ self.obs = obs;
+ self.thisObject = this;
+
+ debug("Inside PerformanceObserver callback");
+ shouldBeTrue(`argumentsLength === 2`);
+ shouldBeTrue(`list instanceof PerformanceObserverEntryList`);
+ shouldBeTrue(`obs instanceof PerformanceObserver`);
+ shouldBeTrue(`obs === observer`);
+ // FIXME: <https://webkit.org/b/167549> Invoking generated callback should allow setting the `this` object
+ shouldBeTrue(`thisObject instanceof PerformanceObserver`);
+ shouldBeTrue(`thisObject === observer`);
+
+ debug("");
+ debug("PerformanceObserverEntryList APIs");
+
+ shouldBeTrue(`list.getEntries() instanceof Array`);
+ shouldBeTrue(`list.getEntries().length === 2`);
+ shouldBeTrue(`list.getEntries()[0] instanceof PerformanceEntry`);
+ shouldBeEqualToString(`list.getEntries()[0].name`, "mark3");
+ shouldBeEqualToString(`list.getEntries()[1].name`, "mark4");
+ shouldBeTrue(`list.getEntries()[0].startTime <= list.getEntries()[1].startTime`);
+
+ shouldThrow(`list.getEntriesByType()`);
+ shouldBeTrue(`list.getEntriesByType("not-real").length === 0`);
+ shouldBeTrue(`list.getEntriesByType("mark").length === 2`);
+ shouldBeTrue(`list.getEntriesByType("mark")[0] instanceof PerformanceEntry`);
+ shouldBeEqualToString(`list.getEntriesByType("mark")[0].name`, "mark3");
+ shouldBeEqualToString(`list.getEntriesByType("mark")[1].name`, "mark4");
+
+ shouldThrow(`list.getEntriesByName()`);
+ shouldBeTrue(`list.getEntriesByName("not-real").length === 0`);
+ shouldBeTrue(`list.getEntriesByName("mark1").length === 0`);
+ shouldBeTrue(`list.getEntriesByName("mark3").length === 1`);
+ shouldBeTrue(`list.getEntriesByName("mark3")[0] instanceof PerformanceEntry`);
+ shouldBeEqualToString(`list.getEntriesByName("mark3")[0].name`, "mark3");
+ shouldBeTrue(`list.getEntriesByName("mark4").length === 1`);
+ shouldBeTrue(`list.getEntriesByName("mark4")[0] instanceof PerformanceEntry`);
+ shouldBeEqualToString(`list.getEntriesByName("mark4")[0].name`, "mark4");
+
+ shouldThrow(`list.getEntriesByName()`);
+ shouldBeTrue(`list.getEntriesByName("not-real").length === 0`);
+ shouldBeTrue(`list.getEntriesByName("mark1").length === 0`);
+ shouldBeTrue(`list.getEntriesByName("mark3").length === 1`);
+ shouldBeTrue(`list.getEntriesByName("mark3")[0] instanceof PerformanceEntry`);
+ shouldBeEqualToString(`list.getEntriesByName("mark3")[0].name`, "mark3");
+ shouldBeTrue(`list.getEntriesByName("mark4").length === 1`);
+ shouldBeTrue(`list.getEntriesByName("mark4")[0] instanceof PerformanceEntry`);
+ shouldBeEqualToString(`list.getEntriesByName("mark4")[0].name`, "mark4");
+
+ shouldBeTrue(`list.getEntriesByName("mark3", "not-real").length === 0`);
+ shouldBeTrue(`list.getEntriesByName("mark3", "mark").length === 1`);
+ shouldBeTrue(`list.getEntriesByName(null, "mark").length === 0`);
+ shouldBeTrue(`list.getEntriesByName(undefined, "mark").length === 0`);
+
+ if (self.importScripts)
+ finishJSTest();
+ else
+ testWorker();
+});
+performance.mark("mark2");
+observer.observe({entryTypes: ["mark"]});
+performance.mark("mark3");
+performance.mark("mark4");
</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("../../resources/js-test-pre.js");
+
+shouldBeTrue(`performance.now() < 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("../../resources/js-test-pre.js");
+
+if (self.window)
+ description("Basic Interface test for performance-timeline APIs.");
+
+debug("PerformanceEntry");
+shouldBeDefined("PerformanceEntry");
+shouldBeTrue(`"name" in PerformanceEntry.prototype`);
+shouldBeTrue(`"entryType" in PerformanceEntry.prototype`);
+shouldBeTrue(`"startTime" in PerformanceEntry.prototype`);
+shouldBeTrue(`"duration" in PerformanceEntry.prototype`);
+shouldThrow(`new PerformanceEntry()`);
+
+// NOTE: The APIs below may be going away. Replaced by PerformanceObserver.
+
+debug("");
+debug("Performance extensions");
+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("test");`);
+shouldBeTrue(`performance.getEntries().length === 1`);
+shouldBeTrue(`performance.getEntries()[0] instanceof PerformanceEntry`);
+shouldBeEqualToString(`performance.getEntries()[0].name`, "test");
+shouldBeEqualToString(`performance.getEntries()[0].entryType`, "mark");
+shouldBeTrue(`typeof performance.getEntries()[0].startTime === "number"`);
+shouldBeTrue(`typeof performance.getEntries()[0].duration === "number"`);
+
+shouldThrow(`performance.getEntriesByType()`);
+shouldBeTrue(`performance.getEntriesByType("not-real").length === 0`);
+shouldBeTrue(`performance.getEntriesByType("mark").length === 1`);
+shouldBeTrue(`performance.getEntriesByType("mark")[0] instanceof PerformanceEntry`);
+shouldBeEqualToString(`performance.getEntriesByType("mark")[0].name`, "test");
+shouldBeEqualToString(`performance.getEntriesByType("mark")[0].entryType`, "mark");
+shouldBeTrue(`typeof performance.getEntriesByType("mark")[0].startTime === "number"`);
+shouldBeTrue(`typeof performance.getEntriesByType("mark")[0].duration === "number"`);
+
+shouldThrow(`performance.getEntriesByName()`);
+shouldBeTrue(`performance.getEntriesByName("not-real").length === 0`);
+shouldBeTrue(`performance.getEntriesByName("test").length === 1`);
+shouldBeTrue(`performance.getEntriesByName("test")[0] instanceof PerformanceEntry`);
+shouldBeEqualToString(`performance.getEntriesByName("test")[0].name`, "test");
+shouldBeEqualToString(`performance.getEntriesByName("test")[0].entryType`, "mark");
+shouldBeTrue(`typeof performance.getEntriesByName("test")[0].startTime === "number"`);
+shouldBeTrue(`typeof performance.getEntriesByName("test")[0].duration === "number"`);
+shouldBeTrue(`performance.getEntriesByName("test", "not-real").length === 0`);
+shouldBeTrue(`performance.getEntriesByName("test", "mark").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("../../resources/js-test-pre.js");
+
+if (self.window)
+ description("Basic Interface test for user-timing APIs.");
+
+debug("PerformanceMark");
+shouldBeDefined("PerformanceMark");
+shouldThrow(`new PerformanceMark()`);
+
+debug("");
+debug("PerformanceMeasure");
+shouldBeDefined("PerformanceMeasure");
+shouldThrow(`new PerformanceMeasure()`);
+
+debug("");
+debug("Performance extensions");
+shouldBeDefined(`Performance.prototype.mark`);
+shouldBeDefined(`Performance.prototype.measure`);
+shouldBeDefined(`Performance.prototype.clearMarks`);
+shouldBeDefined(`Performance.prototype.clearMeasures`);
+shouldThrow(`performance.mark()`);
+shouldNotThrow(`performance.mark("mark_name")`);
+shouldThrow(`performance.measure()`);
+shouldNotThrow(`performance.measure("measure_name")`);
+shouldNotThrow(`performance.clearMarks()`);
+shouldNotThrow(`performance.clearMarks("mark_name")`);
+shouldNotThrow(`performance.clearMeasures()`);
+shouldNotThrow(`performance.clearMeasures("measure_name")`);
+
+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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+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("mark_name") did not throw exception.
+PASS performance.measure() threw exception TypeError: Not enough arguments.
+PASS performance.measure("measure_name") did not throw exception.
+PASS performance.clearMarks() did not throw exception.
+PASS performance.clearMarks("mark_name") did not throw exception.
+PASS performance.clearMeasures() did not throw exception.
+PASS performance.clearMeasures("measure_name") 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("mark_name") did not throw exception.
+PASS [Worker] performance.measure() threw exception TypeError: Not enough arguments.
+PASS [Worker] performance.measure("measure_name") did not throw exception.
+PASS [Worker] performance.clearMarks() did not throw exception.
+PASS [Worker] performance.clearMarks("mark_name") did not throw exception.
+PASS [Worker] performance.clearMeasures() did not throw exception.
+PASS [Worker] performance.clearMeasures("measure_name") 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>+<!DOCTYPE HTML>
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script src="resources/user-timing-api.js"></script>
+<script>
+debug("");
+let worker = startWorker("resources/user-timing-api.js");
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
</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 <pecoraro@apple.com>
+
+ 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 <commit-queue@webkit.org>
</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&CallerWindow, DoNotCheckSecurity, ForwardDeclareInHeader, MayThrowException] void postMessage(any message, USVString targetOrigin, optional sequence<object> 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& context, double timeOrigin)
</span><span class="cx"> : ContextDestructionObserver(&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&, 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<UserTiming> m_userTiming;
</span><span class="cx">
</span><del>- GenericTaskQueue<Timer> m_performanceTimelineTaskQueue;
</del><ins>+ GenericTaskQueue<ScriptExecutionContext> m_performanceTimelineTaskQueue;
</ins><span class="cx"> ListHashSet<RefPtr<PerformanceObserver>> 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->performance();
</span><span class="cx"> } else if (is<WorkerGlobalScope>(scriptExecutionContext)) {
</span><del>- // FIXME: Support Performance Timeline for Workers.
</del><ins>+ auto& workerGlobalScope = downcast<WorkerGlobalScope>(scriptExecutionContext);
+ m_performance = &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 "Document.h"
</ins><span class="cx"> #include "ExceptionCode.h"
</span><span class="cx"> #include "Performance.h"
</span><span class="cx"> #include "PerformanceTiming.h"
</span><span class="cx"> #include <array>
</span><ins>+#include <wtf/MainThread.h>
</ins><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx"> #include <wtf/dtoa/utils.h>
</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& 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<ASCIILiteral, NavigationTimingFunction>;
</span><span class="cx"> static const std::array<MapPair, 21> pairs = { {
</span><span class="cx"> MapPair { ASCIILiteral("navigationStart"), &PerformanceTiming::navigationStart },
</span><span class="lines">@@ -97,8 +100,10 @@
</span><span class="cx">
</span><span class="cx"> ExceptionOr<Ref<PerformanceMark>> UserTiming::mark(const String& markName)
</span><span class="cx"> {
</span><del>- if (restrictedMarkFunction(markName))
- return Exception { SYNTAX_ERR };
</del><ins>+ if (is<Document>(m_performance.scriptExecutionContext())) {
+ if (restrictedMarkFunction(markName))
+ return Exception { SYNTAX_ERR };
+ }
</ins><span class="cx">
</span><span class="cx"> auto& performanceEntryList = m_marksMap.ensure(markName, [] { return Vector<RefPtr<PerformanceEntry>>(); }).iterator->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()->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<double>(((*timing).*(function))());
- if (!value)
- return Exception { INVALID_ACCESS_ERR };
- return value - timing->navigationStart();
- } else {
- // FIXME: Support UserTiming in Workers.
- ASSERT_NOT_REACHED();
- return Exception { SYNTAX_ERR };
- }
</del><ins>+ double value = static_cast<double>(((*timing).*(function))());
+ if (!value)
+ return Exception { INVALID_ACCESS_ERR };
+ return value - timing->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<DedicatedWorkerGlobalScope> DedicatedWorkerGlobalScope::create(const URL& url, const String& identifier, const String& userAgent, DedicatedWorkerThread& thread, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
</del><ins>+Ref<DedicatedWorkerGlobalScope> DedicatedWorkerGlobalScope::create(const URL& url, const String& identifier, const String& userAgent, DedicatedWorkerThread& thread, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& 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->applyContentSecurityPolicyResponseHeaders(contentSecurityPolicyResponseHeaders);
</span><span class="cx"> return context;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const URL& url, const String& identifier, const String& userAgent, DedicatedWorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
- : WorkerGlobalScope(url, identifier, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), connectionProxy, socketProvider)
</del><ins>+DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const URL& url, const String& identifier, const String& userAgent, DedicatedWorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& 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<DedicatedWorkerGlobalScope> create(const URL&, const String& identifier, const String& userAgent, DedicatedWorkerThread&, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
</del><ins>+ static Ref<DedicatedWorkerGlobalScope> create(const URL&, const String& identifier, const String& userAgent, DedicatedWorkerThread&, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
</ins><span class="cx"> virtual ~DedicatedWorkerGlobalScope();
</span><span class="cx">
</span><span class="cx"> ExceptionOr<void> postMessage(JSC::ExecState&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&&);
</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&, const String& identifier, const String& userAgent, DedicatedWorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
</del><ins>+ DedicatedWorkerGlobalScope(const URL&, const String& identifier, const String& userAgent, DedicatedWorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& 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<void> importScripts(const Vector<String>& 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& url, const String& identifier, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& 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& url, const String& identifier, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& 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<WorkerGlobalScope> DedicatedWorkerThread::createWorkerGlobalScope(const URL& url, const String& identifier, const String& userAgent, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin)
</del><ins>+Ref<WorkerGlobalScope> DedicatedWorkerThread::createWorkerGlobalScope(const URL& url, const String& identifier, const String& userAgent, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& 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& workerObjectProxy() const { return m_workerObjectProxy; }
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& identifier, const String& userAgent, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin) override;
</del><ins>+ Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& identifier, const String& userAgent, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& 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&, const String& identifier, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags);
</del><ins>+ DedicatedWorkerThread(const URL&, const String& identifier, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags);
</ins><span class="cx">
</span><span class="cx"> WorkerObjectProxy& 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->setPendingActivity(worker.ptr());
</span><span class="cx">
</span><ins>+ // https://html.spec.whatwg.org/multipage/workers.html#official-moment-of-creation
+ worker->m_momentOfCreation = monotonicallyIncreasingTime();
+
</ins><span class="cx"> worker->m_scriptLoader = WorkerScriptLoader::create();
</span><span class="cx"> auto contentSecurityPolicyEnforcement = shouldBypassMainWorldContentSecurityPolicy ? ContentSecurityPolicyEnforcement::DoNotEnforce : ContentSecurityPolicyEnforcement::EnforceChildSrcDirective;
</span><span class="cx"> worker->m_scriptLoader->loadAsynchronously(&context, scriptURL.releaseReturnValue(), FetchOptions::Mode::SameOrigin, contentSecurityPolicyEnforcement, worker->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& contentSecurityPolicyResponseHeaders = m_contentSecurityPolicyResponseHeaders ? m_contentSecurityPolicyResponseHeaders.value() : scriptExecutionContext()->contentSecurityPolicy()->responseHeaders();
</span><del>- m_contextProxy.startWorkerGlobalScope(m_scriptLoader->url(), scriptExecutionContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_runtimeFlags);
</del><ins>+ m_contextProxy.startWorkerGlobalScope(m_scriptLoader->url(), scriptExecutionContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_momentOfCreation, m_runtimeFlags);
</ins><span class="cx"> InspectorInstrumentation::scriptImported(*scriptExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->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& m_contextProxy; // The proxy outlives the worker to perform thread shutdown.
</span><span class="cx"> std::optional<ContentSecurityPolicyResponseHeaders> 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 "ExceptionCode.h"
</span><span class="cx"> #include "IDBConnectionProxy.h"
</span><span class="cx"> #include "InspectorInstrumentation.h"
</span><ins>+#include "Performance.h"
</ins><span class="cx"> #include "ScheduledAction.h"
</span><span class="cx"> #include "ScriptSourceCode.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</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& url, const String& identifier, const String& userAgent, WorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
</del><ins>+WorkerGlobalScope::WorkerGlobalScope(const URL& url, const String& identifier, const String& userAgent, WorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& 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& 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& crypto();
</span><span class="cx">
</span><ins>+#if ENABLE(WEB_TIMING)
+ Performance& performance() const;
+#endif
+
</ins><span class="cx"> protected:
</span><del>- WorkerGlobalScope(const URL&, const String& identifier, const String& userAgent, WorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
</del><ins>+ WorkerGlobalScope(const URL&, const String& identifier, const String& userAgent, WorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, double timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
</ins><span class="cx">
</span><span class="cx"> void applyContentSecurityPolicyResponseHeaders(const ContentSecurityPolicyResponseHeaders&);
</span><span class="cx">
</span><span class="lines">@@ -171,6 +176,10 @@
</span><span class="cx"> RefPtr<SocketProvider> m_socketProvider;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(WEB_TIMING)
+ Ref<Performance> m_performance;
+#endif
+
</ins><span class="cx"> mutable RefPtr<Crypto> 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& create(Worker&);
</span><span class="cx">
</span><del>- virtual void startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, JSC::RuntimeFlags) = 0;
</del><ins>+ virtual void startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, double timeOrigin, JSC::RuntimeFlags) = 0;
</ins><span class="cx"> virtual void terminateWorkerGlobalScope() = 0;
</span><span class="cx"> virtual void postMessageToWorkerGlobalScope(RefPtr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) = 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<WorkerGlobalScope>(*m_scriptExecutionContext) && currentThread() == downcast<WorkerGlobalScope>(*m_scriptExecutionContext).thread().threadID()));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WorkerMessagingProxy::startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, const String& sourceCode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, JSC::RuntimeFlags runtimeFlags)
</del><ins>+void WorkerMessagingProxy::startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, const String& sourceCode, const ContentSecurityPolicyResponseHeaders& 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->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& scriptURL, const String& userAgent, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, JSC::RuntimeFlags) final;
</del><ins>+ void startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, double timeOrigin, JSC::RuntimeFlags) final;
</ins><span class="cx"> void terminateWorkerGlobalScope() final;
</span><span class="cx"> void postMessageToWorkerGlobalScope(RefPtr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) 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& scriptURL, const String& identifier, const String& userAgent, const String& sourceCode, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin);
</del><ins>+ WorkerThreadStartupData(const URL& scriptURL, const String& identifier, const String& userAgent, const String& sourceCode, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& 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<SecurityOrigin> m_topOrigin;
</span><ins>+ double m_timeOrigin;
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-WorkerThreadStartupData::WorkerThreadStartupData(const URL& scriptURL, const String& identifier, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin)
</del><ins>+WorkerThreadStartupData::WorkerThreadStartupData(const URL& scriptURL, const String& identifier, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& 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& scriptURL, const String& identifier, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, JSC::RuntimeFlags runtimeFlags)
</del><ins>+WorkerThread::WorkerThread(const URL& scriptURL, const String& identifier, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& 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<WorkerThreadStartupData>(scriptURL, identifier, userAgent, sourceCode, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin))
</del><ins>+ , m_startupData(std::make_unique<WorkerThreadStartupData>(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->m_scriptURL, m_startupData->m_identifier, m_startupData->m_userAgent, m_startupData->m_contentSecurityPolicyResponseHeaders, m_startupData->m_shouldBypassMainWorldContentSecurityPolicy, WTFMove(m_startupData->m_topOrigin));
</del><ins>+ m_workerGlobalScope = createWorkerGlobalScope(m_startupData->m_scriptURL, m_startupData->m_identifier, m_startupData->m_userAgent, m_startupData->m_contentSecurityPolicyResponseHeaders, m_startupData->m_shouldBypassMainWorldContentSecurityPolicy, WTFMove(m_startupData->m_topOrigin), m_startupData->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&, const String& identifier, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags);
</del><ins>+ WorkerThread(const URL&, const String& identifier, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& 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<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& identifier, const String& userAgent, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin) = 0;
</del><ins>+ virtual Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& identifier, const String& userAgent, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& 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>