Bug 1560651 - Correctly set time clamping/jittering for Workers. r=baku, a=RyanVM
authorTom Ritter <tom@mozilla.com>
Mon, 24 Jun 2019 13:20:49 +0000
changeset 537136 828a590988ad2726fcf884fd3af84d1d20ffc141
parent 537135 f3b929b28ab888967128bcd263bd03ff6645f701
child 537137 a6acf6041262f553d5ca70fdfe764c29afbca4c6
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku, RyanVM
bugs1560651
milestone68.0
Bug 1560651 - Correctly set time clamping/jittering for Workers. r=baku, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D35629
dom/workers/WorkerPrivate.cpp
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -2095,23 +2095,24 @@ WorkerPrivate::WorkerPrivate(WorkerPriva
     if (aParent->mParentFrozen) {
       Freeze(nullptr);
     }
   } else {
     AssertIsOnMainThread();
 
     RuntimeService::GetDefaultJSSettings(mJSSettings);
 
+    mJSSettings.chrome.realmOptions.creationOptions().setClampAndJitterTime(
+        !UsesSystemPrincipal());
+    mJSSettings.content.realmOptions.creationOptions().setClampAndJitterTime(
+        !UsesSystemPrincipal());
+
     if (mIsSecureContext) {
       mJSSettings.chrome.realmOptions.creationOptions().setSecureContext(true);
-      mJSSettings.chrome.realmOptions.creationOptions().setClampAndJitterTime(
-          false);
       mJSSettings.content.realmOptions.creationOptions().setSecureContext(true);
-      mJSSettings.content.realmOptions.creationOptions().setClampAndJitterTime(
-          false);
     }
 
     mIsInAutomation = xpc::IsInAutomation();
 
     // Our parent can get suspended after it initiates the async creation
     // of a new worker thread.  In this case suspend the new worker as well.
     if (mLoadInfo.mWindow && mLoadInfo.mWindow->IsSuspended()) {
       ParentWindowPaused();