Closed Bug 1744425 Opened 3 years ago Closed 3 years ago

Replace nsContentUtils::GenerateUUID() to nsID::GenerateUUID()

Categories

(Core :: DOM: Web Crypto, task, P3)

task

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox-esr91 --- wontfix
firefox94 --- wontfix
firefox95 --- wontfix
firefox96 --- wontfix
firefox97 --- wontfix
firefox98 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(3 files)

Bug 1723674 added a new nsID::GenerateUUID() static factory function to generate UUIDs without the overhead of querying and instantiating an nsIUUIDGenerator object. nsContentUtils::GenerateUUID() is a utility function that amortizes that overhead by holding an nsIUUIDGenerator singleton. That's no longer necessary because code that calls nsContentUtils::GenerateUUID() can now just call nsID::GenerateUUID(). No nsIUUDGenerator is needed.

Bug 1723674 added a new nsID::GenerateUUID() static factory function to generate UUIDs without the overhead of querying and instantiating an nsIUUIDGenerator object. nsContentUtils::GenerateUUID() is a utility function that amortizes that overhead by holding an nsIUUIDGenerator singleton. That's no longer necessary because code that calls nsContentUtils::GenerateUUID() can now just call nsID::GenerateUUID(). No nsIUUDGenerator is needed.

The Bugbug bot thinks this bug is a defect, but please change it back in case of error.

Type: task → defect
Type: defect → task
Keywords: regression
Pushed by cpeterson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1778ca2ab291
Replace nsContentUtils::GenerateUUID() to nsID::GenerateUUID(). r=nika

Backed out for bc failures on browser_xpcom_graph_wait.js.

Push with failures: https://treeherder.mozilla.org/jobs?repo=autoland&selectedTaskRun=UBMSo5PLQSaWnDyg3ELOhw.0&resultStatus=testfailed%2Cbusted%2Cexception%2Cusercancel&revision=1778ca2ab2919200848a31381a68c9a8cd137a82

Failure log: https://treeherder.mozilla.org/logviewer?job_id=360478518&repo=autoland

Backout link: https://hg.mozilla.org/integration/autoland/rev/f7989bcb9c41edef489f906243e57a967e81fba5

[task 2021-12-08T04:42:54.772Z] 04:42:54     INFO - TEST-PASS | toolkit/components/backgroundtasks/tests/browser/browser_xpcom_graph_wait.js | AfterRunBackgroundTaskNamed: should have no unexpected services loaded - [] deepEqual [] - 
[task 2021-12-08T04:42:54.773Z] 04:42:54     INFO - Buffered messages finished
[task 2021-12-08T04:42:54.774Z] 04:42:54     INFO - TEST-UNEXPECTED-FAIL | toolkit/components/backgroundtasks/tests/browser/browser_xpcom_graph_wait.js | AfterRunBackgroundTaskNamed: all services allowlist entries should have been used - 1 deepEqual 0 - JS frame :: chrome://mochitests/content/browser/toolkit/components/backgroundtasks/tests/browser/browser_xpcom_graph_wait.js :: test_xpcom_graph_wait :: line 418
[task 2021-12-08T04:42:54.774Z] 04:42:54     INFO - Stack trace:
[task 2021-12-08T04:42:54.775Z] 04:42:54     INFO - chrome://mochitests/content/browser/toolkit/components/backgroundtasks/tests/browser/browser_xpcom_graph_wait.js:test_xpcom_graph_wait:418
[task 2021-12-08T04:42:54.776Z] 04:42:54     INFO - Not taking screenshot here: see the one that was previously logged
[task 2021-12-08T04:42:54.777Z] 04:42:54     INFO - TEST-UNEXPECTED-FAIL | toolkit/components/backgroundtasks/tests/browser/browser_xpcom_graph_wait.js | AfterRunBackgroundTaskNamed: unused services allowlist entry: {706d36bb-bf79-4293-81f2-8f6828c18f9d} (CID with human-readable contract ID @mozilla.org/uuid-generator;1) - 
[task 2021-12-08T04:42:54.777Z] 04:42:54     INFO - Stack trace:
[task 2021-12-08T04:42:54.778Z] 04:42:54     INFO - chrome://mochikit/content/browser-test.js:test_ok:1336
[task 2021-12-08T04:42:54.778Z] 04:42:54     INFO - chrome://mochitests/content/browser/toolkit/components/backgroundtasks/tests/browser/browser_xpcom_graph_wait.js:test_xpcom_graph_wait:426
Flags: needinfo?(cpeterson)
Depends on: crypto-randomUUID
No longer regressed by: crypto-randomUUID

I'm investigating this test failure. The problem is related to the uuid-generator service no longer being needed for some tests.

Flags: needinfo?(cpeterson)

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:cpeterson, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(nika)
Flags: needinfo?(cpeterson)

(In reply to Release mgmt bot [:sylvestre / :calixte / :marco for bugbug] from comment #6)

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:cpeterson, could you have a look please?

I'm investigating the test failure.

The browser_xpcom_graph_wait.js test launches a background task process and waits 10 seconds to see which JSMs and services are loaded. Looks like a timing issue with the Linux ASan build is causing the nsUUIDGenerator service to get loaded but not used, even if I increase the test duration from 10 seconds to 60 seconds.

test-linux1804-64-asan-qr/opt-mochitest-browser-chrome-swr-e10s-10

TEST-UNEXPECTED-FAIL | toolkit/components/backgroundtasks/tests/browser/browser_xpcom_graph_wait.js | AfterRunBackgroundTaskNamed: all services allowlist entries should have been used - 1 deepEqual 0 - JS frame :: chrome://mochitests/content/browser/toolkit/components/backgroundtasks/tests/browser/browser_xpcom_graph_wait.js :: test_xpcom_graph_wait :: line 418

Flags: needinfo?(nika)
Flags: needinfo?(cpeterson)

This change is needed to avoid toolkit/components/backgroundtasks/tests/browser/browser_xpcom_graph_wait.js test failures where the nsUUIDGenerator service was loaded during ASan test runs but not non-ASan test runs (due to differences in temp profile directory paths).

Using nsID::GenerateUUIDInPlace() also avoids the overhead of instantiating the nsUUIDGenerator service.

Depends on D132866

This change is needed to avoid toolkit/components/backgroundtasks/tests/browser/browser_xpcom_graph_wait.js test failures where the nsUUIDGenerator service was loaded during ASan test runs but not non-ASan test runs (due to differences in temp profile directory paths). With this change, the nsUUIDGenerator service is no longer needed in BackgroundTasks.

Using nsID::GenerateUUIDInPlace() also avoids the overhead of instantiating the nsUUIDGenerator service.

Depends on D136992

Attachment #9260790 - Attachment description: Bug 1744425 - widget/windows: Use nsID::GenerateUUIDInPlace() instead of the nsUUIDGenerator service. r?jmathies → Bug 1744425 - widget/windows: Use nsID::GenerateUUIDInPlace() instead of the nsUUIDGenerator service.
Pushed by cpeterson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d94dfc7a3536
Replace nsContentUtils::GenerateUUID() to nsID::GenerateUUID(). r=nika
https://hg.mozilla.org/integration/autoland/rev/dbe15c60505d
widget/windows: Use nsID::GenerateUUIDInPlace() instead of the nsUUIDGenerator service. r=tkikuchi
https://hg.mozilla.org/integration/autoland/rev/d95b4d9c7ef3
xre: Use nsID::GeneratorUUIDInPlace() instead of the nsUUIDGenerator service. r=mossop
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: