VandanRogheliya

Bug 1380676 - Patch 2 (window.performance.now())

Jun 12th, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.35 KB | None | 0 0
  1. # HG changeset patch
  2. # User VandanRogheliya <[email protected]>
  3. # Date 1591978922 -19800
  4. # Fri Jun 12 21:52:02 2020 +0530
  5. # Node ID ade22cf4b638cc5e47af2730e97ae019ff178696
  6. # Parent 10ad7868f3ca27cb90db9bd1d392ff4d7852a0cd
  7. Bug 1380676 - Date.now() instances replaced with performance.now(). r=sparky
  8.  
  9. diff --git a/testing/talos/talos/pageloader/chrome/pageloader.js b/testing/talos/talos/pageloader/chrome/pageloader.js
  10. --- a/testing/talos/talos/pageloader/chrome/pageloader.js
  11. +++ b/testing/talos/talos/pageloader/chrome/pageloader.js
  12. @@ -404,17 +404,17 @@ function plLoadPage() {
  13. function startAndLoadURI(pageName) {
  14. if (!(plPageFlags() & TEST_DOES_OWN_TIMING)) {
  15. // Resume the profiler because we're really measuring page load time.
  16. // If the test is doing its own timing, it'll also need to do its own
  17. // profiler pausing / resuming.
  18. TalosParentProfiler.resume("Starting to load URI " + pageName);
  19. }
  20.  
  21. - start_time = Date.now();
  22. + start_time = window.performance.now();
  23. if (loadNoCache) {
  24. content.loadURI(pageName, {
  25. triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
  26. flags: Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE,
  27. });
  28. } else {
  29. content.loadURI(pageName, {
  30. triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
  31. @@ -527,19 +527,19 @@ var plNextPage = async function() {
  32. pageIndex++;
  33. recordedName = null;
  34. pageCycle = 1;
  35. doNextPage = true;
  36. }
  37.  
  38. if (doNextPage) {
  39. if (forceCC) {
  40. - var tccstart = new Date();
  41. + var tccstart = window.performance.now();
  42. window.windowUtils.garbageCollect();
  43. - var tccend = new Date();
  44. + var tccend = window.performance.now();
  45. report.recordCCTime(tccend - tccstart);
  46.  
  47. // Now asynchronously trigger GC / CC in the content process
  48. await forceContentGC();
  49. }
  50.  
  51. setTimeout(plLoadPage, delay);
  52. } else {
  53. @@ -728,17 +728,17 @@ function _loadHandlerCapturing() {
  54. dumpLine(
  55. "tp: Capturing onload handler used with page that doesn't do its own timing?"
  56. );
  57. plStop(true);
  58. }
  59.  
  60. if (useMozAfterPaint) {
  61. if (gStartTime != null && gStartTime >= 0) {
  62. - gTime = new Date() - gStartTime;
  63. + gTime = window.performance.now() - gStartTime;
  64. gStartTime = -1;
  65. }
  66. }
  67.  
  68. if (gTime !== -1) {
  69. plRecordTime(gTime);
  70. TalosParentProfiler.pause("capturing load handler fired");
  71. gTime = -1;
  72. @@ -783,17 +783,17 @@ function _loadHandler(paint_time = 0) {
  73. failTimeout.clear();
  74. var end_time = 0;
  75.  
  76. if (paint_time !== 0) {
  77. // window.performance.timing.timeToNonBlankPaint is a timestamp
  78. // this may have a value for hero element (also a timestamp)
  79. end_time = paint_time;
  80. } else {
  81. - end_time = Date.now();
  82. + end_time = window.performance.now();
  83. }
  84.  
  85. var duration;
  86. if (usePDFPaint) {
  87. // PDF paint uses performance.now(), so the time does not need to be
  88. // adjusted from the start time.
  89. duration = end_time;
  90. } else {
  91. @@ -833,22 +833,23 @@ function plLoadHandlerMessage(message) {
  92. failTimeout.clear();
  93.  
  94. if (plPageFlags() & EXECUTE_SCROLL_TEST) {
  95. // Let the page settle down after its load event, then execute the scroll test.
  96. setTimeout(sendScroll, 500);
  97. } else if (plPageFlags() & TEST_DOES_OWN_TIMING) {
  98. var time;
  99.  
  100. - if (typeof gStartTime != "number") {
  101. - gStartTime = Date.parse(gStartTime);
  102. - }
  103. + //window.performance.now() returns a typeof number so no need to check
  104. + // if (typeof gStartTime != "number") {
  105. + // gStartTime = Date.parse(gStartTime);
  106. + // }
  107. if (gTime !== -1) {
  108. if (useMozAfterPaint && gStartTime >= 0) {
  109. - time = Date.now() - gStartTime;
  110. + time = window.performance.now() - gStartTime;
  111. gStartTime = -1;
  112. } else if (!useMozAfterPaint) {
  113. time = gTime;
  114. }
  115. gTime = -1;
  116. }
  117.  
  118. if (time !== undefined) {
  119. diff --git a/testing/talos/talos/pageloader/chrome/report.js b/testing/talos/talos/pageloader/chrome/report.js
  120. --- a/testing/talos/talos/pageloader/chrome/report.js
  121. +++ b/testing/talos/talos/pageloader/chrome/report.js
  122. @@ -85,17 +85,17 @@ Report.prototype.getReport = function()
  123. }
  124. report += "__end_tp_report\n";
  125.  
  126. if (this.showTotalCCTime) {
  127. report += "__start_cc_report\n";
  128. report += "_x_x_mozilla_cycle_collect," + this.totalCCTime + "\n";
  129. report += "__end_cc_report\n";
  130. }
  131. - var now = new Date().getTime(); // eslint-disable-line mozilla/avoid-Date-timing
  132. + var now = window.performance.now(); // eslint-disable-line mozilla/avoid-Date-timing
  133. report += "__startTimestamp" + now + "__endTimestamp\n"; // timestamp for determning shutdown time, used by talos
  134.  
  135. return report;
  136. };
  137.  
  138. Report.prototype.getReportSummary = function() {
  139. function average(arr) {
  140. var sum = 0;
  141. diff --git a/testing/talos/talos/pageloader/chrome/tscroll.js b/testing/talos/talos/pageloader/chrome/tscroll.js
  142. --- a/testing/talos/talos/pageloader/chrome/tscroll.js
  143. +++ b/testing/talos/talos/pageloader/chrome/tscroll.js
  144. @@ -87,17 +87,18 @@ function testScroll(target, stepSize, op
  145. if (!report && document.head) {
  146. var imported = document.createElement("script");
  147. imported.addEventListener("load", function() {
  148. report = tpRecordTime;
  149. resolve();
  150. });
  151.  
  152. // eslint-disable-next-line mozilla/avoid-Date-timing
  153. - imported.src = "../../scripts/talos-debug.js?dummy=" + Date.now(); // For some browsers to re-read
  154. + imported.src =
  155. + "../../scripts/talos-debug.js?dummy=" + window.performance.now(); // For some browsers to re-read
  156. document.head.appendChild(imported);
  157. return;
  158. }
  159.  
  160. resolve();
  161. });
  162. }
  163.  
  164. @@ -123,17 +124,17 @@ function testScroll(target, stepSize, op
  165. return new Promise(function(resolve) {
  166. win.addEventListener("MozAfterPaint", () => resolve(), { once: true });
  167. });
  168. }
  169.  
  170. function myNow() {
  171. return win.performance && win.performance.now
  172. ? win.performance.now()
  173. - : Date.now(); // eslint-disable-line mozilla/avoid-Date-timing
  174. + : window.performance.now(); // eslint-disable-line mozilla/avoid-Date-timing
  175. }
  176.  
  177. var isWindow = target.self === target;
  178.  
  179. var getPos = isWindow
  180. ? function() {
  181. return target.pageYOffset;
  182. }
  183. diff --git a/testing/talos/talos/startup_test/sessionrestore/addon/api.js b/testing/talos/talos/startup_test/sessionrestore/addon/api.js
  184. --- a/testing/talos/talos/startup_test/sessionrestore/addon/api.js
  185. +++ b/testing/talos/talos/startup_test/sessionrestore/addon/api.js
  186. @@ -123,17 +123,19 @@ this.sessionrestore = class extends Exte
  187. : startup_info.sessionRestored;
  188. let duration = restoreTime - startup_info.process;
  189.  
  190. // Report data to Talos, if possible.
  191. dump("__start_report" + duration + "__end_report\n\n");
  192.  
  193. // Next one is required by the test harness but not used.
  194. // eslint-disable-next-line mozilla/avoid-Date-timing
  195. - dump("__startTimestamp" + Date.now() + "__endTimestamp\n\n");
  196. + dump(
  197. + "__startTimestamp" + window.performance.now() + "__endTimestamp\n\n"
  198. + );
  199. } catch (ex) {
  200. dump(`SessionRestoreTalosTest: error ${ex}\n`);
  201. dump(ex.stack);
  202. dump("\n");
  203. }
  204.  
  205. Services.startup.quit(Services.startup.eForceQuit);
  206. }
  207. diff --git a/testing/talos/talos/startup_test/startup_about_home_paint/addon/api.js b/testing/talos/talos/startup_test/startup_about_home_paint/addon/api.js
  208. --- a/testing/talos/talos/startup_test/startup_about_home_paint/addon/api.js
  209. +++ b/testing/talos/talos/startup_test/startup_about_home_paint/addon/api.js
  210. @@ -52,17 +52,17 @@ this.startup_about_home_paint = class ex
  211. await this.wait(1000);
  212. ChromeUtils.idleDispatch(() => {
  213. this.checkForTelemetry();
  214. });
  215. } else {
  216. // Got our measurement.
  217. dump("__start_report" + measurement + "__end_report\n\n");
  218. // eslint-disable-next-line mozilla/avoid-Date-timing
  219. - dump("__startTimestamp" + Date.now() + "__endTimestamp\n");
  220. + dump("__startTimestamp" + window.performance.now() + "__endTimestamp\n");
  221.  
  222. let env = Cc["@mozilla.org/process/environment;1"].getService(
  223. Ci.nsIEnvironment
  224. );
  225.  
  226. if (env.exists("TPPROFILINGINFO")) {
  227. let profilingInfo = env.get("TPPROFILINGINFO");
  228. if (profilingInfo !== null) {
  229. diff --git a/testing/talos/talos/startup_test/tspaint_test.html b/testing/talos/talos/startup_test/tspaint_test.html
  230. --- a/testing/talos/talos/startup_test/tspaint_test.html
  231. +++ b/testing/talos/talos/startup_test/tspaint_test.html
  232. @@ -44,17 +44,17 @@ function failed() {
  233.  
  234. function dumpConsoleAndQuit() {
  235. TalosPowersContent.dumpConsole();
  236.  
  237. // Close window asynchronously, there might still be startup operations that still need to run
  238. window.setTimeout(function() {
  239. if (window.dump) {
  240. // eslint-disable-next-line mozilla/avoid-Date-timing
  241. - dump("__startTimestamp" + Date.now() + "__endTimestamp\n");
  242. + dump("__startTimestamp" + window.performance.now() + "__endTimestamp\n");
  243. }
  244. TalosPowersContent.goQuitApplication();
  245. }, 0);
  246. }
  247.  
  248. window.addEventListener("MozAfterPaint", painted, true);
  249. setTimeout(failed, 5000);
  250.  
  251. diff --git a/testing/talos/talos/talos-powers/chrome/talos-powers-content.js b/testing/talos/talos/talos-powers/chrome/talos-powers-content.js
  252. --- a/testing/talos/talos/talos-powers/chrome/talos-powers-content.js
  253. +++ b/testing/talos/talos/talos-powers/chrome/talos-powers-content.js
  254. @@ -162,17 +162,17 @@ addEventListener(
  255. throw new Error(
  256. "TalosPowers:ParentExec may only be used with local content"
  257. );
  258. }
  259. let uniqueMessageId =
  260. "TalosPowers:ParentExec:" +
  261. content.document.documentURI +
  262. // eslint-disable-next-line mozilla/avoid-Date-timing
  263. - Date.now() +
  264. + window.performance.now() +
  265. Math.random();
  266.  
  267. // Listener for the reply from the parent process
  268. addMessageListener("TalosPowers:ParentExec:ReplyMsg", function done(reply) {
  269. if (reply.data.id != uniqueMessageId) {
  270. return;
  271. }
  272.  
  273. diff --git a/testing/talos/talos/tests/a11y/dhtml.html b/testing/talos/talos/tests/a11y/dhtml.html
  274. --- a/testing/talos/talos/tests/a11y/dhtml.html
  275. +++ b/testing/talos/talos/tests/a11y/dhtml.html
  276. @@ -13,17 +13,17 @@
  277. if (!initAccessibility()) {
  278. dump("__FAILinit:AccessibilityUnvailable__FAIL");
  279. return;
  280. }
  281.  
  282. TalosContentProfiler.resume("dhtml test start", true).then(() => {
  283. var container = document.getElementById("container");
  284. var lastchild = document.getElementById("lastchild");
  285. - var start = new Date(); // eslint-disable-line mozilla/avoid-Date-timing
  286. + var start = window.performance.now(); // eslint-disable-line mozilla/avoid-Date-timing
  287. var i, div;
  288. for (i = 0; i < 2000; i++) {
  289. div = document.createElement("div");
  290. div.innerHTML = "<input type='text' value='a bc def g hijkl mn op qrs'/>";
  291. container.insertBefore(div, lastchild);
  292. }
  293. for (i = 0; i < 2000; i++) {
  294. div = document.createElement("div");
  295. @@ -40,17 +40,17 @@
  296. }
  297. document.documentElement.offsetLeft; // flush layout
  298. setTimeout(postProcessingRecord, 0, start);
  299. });
  300. }
  301.  
  302. function postProcessingRecord(s) {
  303. // alert(new Date() - s);
  304. - let delta = new Date() - s; // eslint-disable-line mozilla/avoid-Date-timing
  305. + let delta = window.performance.now() - s; // eslint-disable-line mozilla/avoid-Date-timing
  306. TalosContentProfiler.pause("dhtml test finish", true).then(() => {
  307. tpRecordTime(delta, s);
  308. });
  309. }
  310. </script>
  311. </head>
  312. <body onload="doInsertion();">
  313. <div id="container" role="application"><div id="lastchild"></div></div>
  314. diff --git a/testing/talos/talos/tests/a11y/tablemutation.html b/testing/talos/talos/tests/a11y/tablemutation.html
  315. --- a/testing/talos/talos/tests/a11y/tablemutation.html
  316. +++ b/testing/talos/talos/tests/a11y/tablemutation.html
  317. @@ -113,28 +113,28 @@ function mutateTable() {
  318. if (!initAccessibility()) {
  319. dump("__FAILinit:AccessibilityUnvailable__FAIL");
  320. return;
  321. }
  322.  
  323. ensureAccessibleTreeForId("start");
  324.  
  325. TalosContentProfiler.resume("tablemutation start", true).then(() => {
  326. - var start = new Date(); // eslint-disable-line mozilla/avoid-Date-timing
  327. + var start = window.performance.now(); // eslint-disable-line mozilla/avoid-Date-timing
  328.  
  329. // Cause all kinds of crazy events
  330. Range.deleteContents();
  331. Range.insertNode(Fragment);
  332.  
  333. document.documentElement.offsetLeft; // flush layout
  334.  
  335. setTimeout(postProcessingRecord, 0, start);
  336. });
  337. }
  338.  
  339. function postProcessingRecord(s) {
  340. // alert(new Date() - s);
  341. - let delta = new Date() - s; // eslint-disable-line mozilla/avoid-Date-timing
  342. + let delta = window.performance.now() - s; // eslint-disable-line mozilla/avoid-Date-timing
  343. TalosContentProfiler.pause("tablemutation finish", true).then(() => {
  344. tpRecordTime(delta, s);
  345. });
  346. }
  347. </script>
  348. diff --git a/testing/talos/talos/tests/scroll/scroll.manifest.develop b/testing/talos/talos/tests/scroll/scroll.manifest.develop
  349. new file mode 100644
  350. --- /dev/null
  351. +++ b/testing/talos/talos/tests/scroll/scroll.manifest.develop
  352. @@ -0,0 +1,6 @@
  353. +% http://127.0.0.1:52555/tests/scroll/tiled.html
  354. +% http://127.0.0.1:52555/tests/scroll/tiled-fixed.html
  355. +% http://127.0.0.1:52555/tests/scroll/tiled-downscale.html
  356. +% http://127.0.0.1:52555/tests/scroll/tiled-fixed-downscale.html
  357. +% http://127.0.0.1:52555/tests/scroll/iframe.svg
  358. +% http://127.0.0.1:52555/tests/scroll/reader.htm
  359. diff --git a/testing/talos/talos/tests/svg_opacity/svg_opacity.manifest.develop b/testing/talos/talos/tests/svg_opacity/svg_opacity.manifest.develop
  360. new file mode 100644
  361. --- /dev/null
  362. +++ b/testing/talos/talos/tests/svg_opacity/svg_opacity.manifest.develop
  363. @@ -0,0 +1,4 @@
  364. +# opacity tests
  365. +
  366. +http://127.0.0.1:52555/tests/svg_opacity/big-optimizable-group-opacity-2500.svg
  367. +http://127.0.0.1:52555/tests/svg_opacity/small-group-opacity-2500.svg
  368. diff --git a/testing/talos/talos/tests/svg_static/svg_static.manifest.develop b/testing/talos/talos/tests/svg_static/svg_static.manifest.develop
  369. new file mode 100644
  370. --- /dev/null
  371. +++ b/testing/talos/talos/tests/svg_static/svg_static.manifest.develop
  372. @@ -0,0 +1,8 @@
  373. +# gearflowers image
  374. +http://127.0.0.1:52555/tests/svg_static/gearflowers.svg
  375. +
  376. +# some generic image compositing tests
  377. +http://127.0.0.1:52555/tests/svg_static/composite-scale.svg
  378. +http://127.0.0.1:52555/tests/svg_static/composite-scale-opacity.svg
  379. +http://127.0.0.1:52555/tests/svg_static/composite-scale-rotate.svg
  380. +http://127.0.0.1:52555/tests/svg_static/composite-scale-rotate-opacity.svg
  381. diff --git a/testing/talos/talos/tests/svgx/svgx.manifest.develop b/testing/talos/talos/tests/svgx/svgx.manifest.develop
  382. new file mode 100644
  383. --- /dev/null
  384. +++ b/testing/talos/talos/tests/svgx/svgx.manifest.develop
  385. @@ -0,0 +1,14 @@
  386. +# Painting multiple complex paths
  387. +% http://127.0.0.1:52555/tests/svgx/hixie-001.xml
  388. +# Painting multiple complex paths with transparency
  389. +% http://127.0.0.1:52555/tests/svgx/hixie-002.xml
  390. +# Painting text
  391. +% http://127.0.0.1:52555/tests/svgx/hixie-003.xml
  392. +# Painting images
  393. +% http://127.0.0.1:52555/tests/svgx/hixie-004.xml
  394. +# Painting linear gradients
  395. +% http://127.0.0.1:52555/tests/svgx/hixie-005.xml
  396. +# Painting radial gradients
  397. +% http://127.0.0.1:52555/tests/svgx/hixie-006.xml
  398. +# World Map
  399. +% http://127.0.0.1:52555/tests/svgx/hixie-007.xml
  400. \ No newline at end of file
  401. diff --git a/testing/talos/talos/tests/tabpaint/api.js b/testing/talos/talos/tests/tabpaint/api.js
  402. --- a/testing/talos/talos/tests/tabpaint/api.js
  403. +++ b/testing/talos/talos/tests/tabpaint/api.js
  404. @@ -126,19 +126,22 @@ this.tabpaint = class extends ExtensionA
  405. * @return Promise
  406. * Resolves once the tab has been fully removed. Resolves
  407. * with the time (in ms) it took to open the tab from the parent.
  408. */
  409. async openTabFromParent(gBrowser, target) {
  410. TalosParentProfiler.resume("tabpaint parent start");
  411.  
  412. // eslint-disable-next-line mozilla/avoid-Date-timing
  413. - gBrowser.selectedTab = gBrowser.addTab(`${target}?${Date.now()}`, {
  414. - triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
  415. - });
  416. + gBrowser.selectedTab = gBrowser.addTab(
  417. + `${target}?${window.performance.now()}`,
  418. + {
  419. + triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
  420. + }
  421. + );
  422.  
  423. let { tab, delta } = await this.whenTabShown();
  424. TalosParentProfiler.pause("tabpaint parent end");
  425. await this.removeTab(tab);
  426. return delta;
  427. }
  428.  
  429. /**
  430. diff --git a/testing/talos/talos/tests/tabpaint/tabpaint.html b/testing/talos/talos/tests/tabpaint/tabpaint.html
  431. --- a/testing/talos/talos/tests/tabpaint/tabpaint.html
  432. +++ b/testing/talos/talos/tests/tabpaint/tabpaint.html
  433. @@ -10,17 +10,17 @@ function init() {
  434. window.addEventListener("TabPaint:FinalResults", (event) => {
  435. let { fromParent, fromContent } = event.detail;
  436.  
  437. tpRecordTime([fromParent, fromContent].join(","), 0, "tabpaint-from-parent, tabpaint-from-content");
  438. }, {once: true});
  439.  
  440. window.addEventListener("TabPaint:OpenFromContent", (event) => {
  441. let target = document.getElementById("target");
  442. - let now = Date.now(); // eslint-disable-line mozilla/avoid-Date-timing
  443. + let now = window.performance.now(); // eslint-disable-line mozilla/avoid-Date-timing
  444.  
  445. target.href = `${targetURL.href}?${now}`;
  446. target.click();
  447. });
  448.  
  449. async function tryPing() {
  450. let pingPromise = new Promise(resolve => {
  451. window.addEventListener("TabPaint:Pong", resolve, {once: true});
  452. diff --git a/testing/talos/talos/tests/tabpaint/tabpaint.manifest.develop b/testing/talos/talos/tests/tabpaint/tabpaint.manifest.develop
  453. new file mode 100644
  454. --- /dev/null
  455. +++ b/testing/talos/talos/tests/tabpaint/tabpaint.manifest.develop
  456. @@ -0,0 +1,2 @@
  457. +% http://127.0.0.1:52892/tests/tabpaint/tabpaint.html
  458. +
  459. diff --git a/testing/talos/talos/tests/tart/addon/content/framescript.js b/testing/talos/talos/tests/tart/addon/content/framescript.js
  460. --- a/testing/talos/talos/tests/tart/addon/content/framescript.js
  461. +++ b/testing/talos/talos/tests/tart/addon/content/framescript.js
  462. @@ -26,17 +26,20 @@
  463.  
  464. if (e.detail.command.name == "ping") {
  465. dispatchReply();
  466. return;
  467. }
  468.  
  469. var uniqueMessageId =
  470. // eslint-disable-next-line mozilla/avoid-Date-timing
  471. - TART_PREFIX + content.document.documentURI + Date.now() + Math.random();
  472. + TART_PREFIX +
  473. + content.document.documentURI +
  474. + window.performance.now() +
  475. + Math.random();
  476.  
  477. addMessageListener(TART_PREFIX + "chrome-exec-reply", function done(
  478. reply
  479. ) {
  480. if (reply.data.id == uniqueMessageId) {
  481. removeMessageListener(TART_PREFIX + "chrome-exec-reply", done);
  482. dispatchReply(reply.data.result);
  483. }
  484. diff --git a/testing/talos/talos/tests/tart/tart.manifest.develop b/testing/talos/talos/tests/tart/tart.manifest.develop
  485. new file mode 100644
  486. --- /dev/null
  487. +++ b/testing/talos/talos/tests/tart/tart.manifest.develop
  488. @@ -0,0 +1,1 @@
  489. +% http://127.0.0.1:52555/tests/tart/tart.html#auto
  490. diff --git a/testing/talos/talos/tests/tresize/addon/content/framescript.js b/testing/talos/talos/tests/tresize/addon/content/framescript.js
  491. --- a/testing/talos/talos/tests/tresize/addon/content/framescript.js
  492. +++ b/testing/talos/talos/tests/tresize/addon/content/framescript.js
  493. @@ -3,17 +3,17 @@
  494.  
  495. addEventListener(
  496. TRESIZE_PREFIX + "chrome-run-event",
  497. function(e) {
  498. var uniqueMessageId =
  499. TRESIZE_PREFIX +
  500. content.document.documentURI +
  501. // eslint-disable-next-line mozilla/avoid-Date-timing
  502. - Date.now() +
  503. + window.performance.now() +
  504. Math.random();
  505.  
  506. addMessageListener(TRESIZE_PREFIX + "chrome-run-reply", function done(
  507. reply
  508. ) {
  509. if (reply.data.id == uniqueMessageId) {
  510. removeMessageListener(TRESIZE_PREFIX + "chrome-run-reply", done);
  511. content.wrappedJSObject.tpRecordTime(reply.data.result.average);
Add Comment
Please, Sign In to add comment