Remove osfile.jsm from devtools/
Categories
(DevTools :: General, task, P3)
Tracking
(firefox110 fixed)
Tracking | Status | |
---|---|---|
firefox110 | --- | fixed |
People
(Reporter: barret, Assigned: barret, NeedInfo)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
text/x-phabricator-request
|
Details |
Bug 1779574 re-added a usage of OSFile.jsm because DevTools was attempting to use IOUtils in the child process, which is not allowed.
Comment 1•2 years ago
|
||
It looks like DevToolsUtils.fetch is an old implementation of something like the standard fetch
method for devtools, which is only used in a couple of places outside tests. It's causing us issues with removing OSFile.jsm usage due to some of the weird handling it has of file URIs.
Is there any chance the devtools team would be able to remove the uses of DevtoolsUtils.fetch
and replace them with normal fetch
calls? It would help with removing the last remaining uses of OSFile.
Outside of tests, a quick scan found the following uses, though there may be others we missed when looking:
- https://searchfox.org/mozilla-central/rev/73ff5f1ac45202c4621a1bcee4b35d20027e71ad/devtools/server/actors/utils/sources-manager.js#8
- https://searchfox.org/mozilla-central/rev/73ff5f1ac45202c4621a1bcee4b35d20027e71ad/devtools/server/actors/utils/stylesheets-manager.js#8
- https://searchfox.org/mozilla-central/rev/73ff5f1ac45202c4621a1bcee4b35d20027e71ad/devtools/server/actors/style-sheet.js#11
Comment 2•2 years ago
|
||
Alex, looks like we use DevToolsUtils.fetch
for loading JS sources and stylesheets text (and perhaps source maps somewhere?). Is anything blocking us from using the standard fetch
API?
Comment 3•2 years ago
|
||
(In reply to Nika Layzell [:nika] (ni? for response) from comment #1)
It looks like DevToolsUtils.fetch is an old implementation of something like the standard
fetch
method for devtools, which is only used in a couple of places outside tests. It's causing us issues with removing OSFile.jsm usage due to some of the weird handling it has of file URIs.Is there any chance the devtools team would be able to remove the uses of
DevtoolsUtils.fetch
and replace them with normalfetch
calls? It would help with removing the last remaining uses of OSFile.
We probably depend on features that aren't exposed by the standard fetch
.
I'm especially thinking about all the privileged flags we set on the channel
over here:
https://searchfox.org/mozilla-central/rev/dd216c1307a2bf1b0d2465b9749fa86dac44303a/devtools/shared/DevToolsUtils.js#528-552
Other than that, we would probably benefit from reusing the standard fetch
when it comes to read the response body, we have lots very old and cryptic code here.
If we are able to use fetch by passing a channel, that would ease to migration, otherwise we may have to expose new ChromeOnly flag. Would that be reasonable option?
Having said that OS.file is used only in one particular workaround:
https://searchfox.org/mozilla-central/rev/dd216c1307a2bf1b0d2465b9749fa86dac44303a/devtools/shared/DevToolsUtils.js#647-665
We could probably look into getting rid of this workaround, and drop the last usage of OS.file.
(I'm off most of next week, but I could probably spend some time on this soon)
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 5•2 years ago
|
||
I'm going to use this bug for removing OSFile.jsm from DevToolsUtils -- removing DevtoolsUtils.fetch() can be spun off into another bug if needed, :ochameau
Assignee | ||
Comment 6•2 years ago
|
||
Comment 8•2 years ago
|
||
Backed out for causing dt failures on browser_dbg-features-source-text-content.js.
[task 2022-12-15T03:20:23.591Z] 03:20:23 INFO - TEST-PASS | devtools/client/debugger/test/mochitest/browser_dbg-features-source-text-content.js | We loaded the garbaged script twice as we lost its content -
[task 2022-12-15T03:20:23.592Z] 03:20:23 INFO - Leaving test bound testGarbageCollectedSourceTextContent
[task 2022-12-15T03:20:23.592Z] 03:20:23 INFO - Entering test bound testFailingHtmlSource
[task 2022-12-15T03:20:23.593Z] 03:20:23 INFO - Test failure in retrieving html page sources
[task 2022-12-15T03:20:23.593Z] 03:20:23 INFO - Adding a new tab with URL: http://localhost:49659/200-then-404-page.html
[task 2022-12-15T03:20:23.593Z] 03:20:23 INFO - Buffered messages logged at 03:20:23
[task 2022-12-15T03:20:23.594Z] 03:20:23 INFO - Tab added and finished loading
[task 2022-12-15T03:20:23.594Z] 03:20:23 INFO - Opening the toolbox
[task 2022-12-15T03:20:23.595Z] 03:20:23 INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome://global/content/customElements.js" line: 500 column: 24 source: "display: none !important"}]
[task 2022-12-15T03:20:23.595Z] 03:20:23 INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome://global/content/customElements.js" line: 500}]
[task 2022-12-15T03:20:23.596Z] 03:20:23 INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome://global/content/elements/panel.js" line: 62}]
[task 2022-12-15T03:20:23.596Z] 03:20:23 INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome://global/content/customElements.js" line: 500 column: 24 source: "display: none !important"}]
[task 2022-12-15T03:20:23.597Z] 03:20:23 INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome://global/content/customElements.js" line: 500}]
[task 2022-12-15T03:20:23.597Z] 03:20:23 INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome://global/content/elements/panel.js" line: 62}]
[task 2022-12-15T03:20:23.598Z] 03:20:23 INFO - Toolbox opened and focused
[task 2022-12-15T03:20:23.598Z] 03:20:23 INFO - Waiting on sources: 200-then-404-page.html
[task 2022-12-15T03:20:23.599Z] 03:20:23 INFO - Finished waiting on sources: 200-then-404-page.html
[task 2022-12-15T03:20:23.599Z] 03:20:23 INFO - Console message: [JavaScript Warning: "Use of nsIFile in content process is deprecated." {file: "resource://gre/modules/NetUtil.jsm" line: 251}]
[task 2022-12-15T03:20:23.599Z] 03:20:23 INFO - Buffered messages finished
[task 2022-12-15T03:20:23.600Z] 03:20:23 INFO - TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-features-source-text-content.js | Display failure error -
[task 2022-12-15T03:20:23.600Z] 03:20:23 INFO - Stack trace:
[task 2022-12-15T03:20:23.600Z] 03:20:23 INFO - chrome://mochikit/content/browser-test.js:test_ok:1449
[task 2022-12-15T03:20:23.600Z] 03:20:23 INFO - chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/browser_dbg-features-source-text-content.js:testFailingHtmlSource:460
[task 2022-12-15T03:20:23.601Z] 03:20:23 INFO - chrome://mochikit/content/browser-test.js:handleTask:1037
[task 2022-12-15T03:20:23.601Z] 03:20:23 INFO - chrome://mochikit/content/browser-test.js:_runTaskBasedTest:1109
[task 2022-12-15T03:20:23.601Z] 03:20:23 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1244
[task 2022-12-15T03:20:23.601Z] 03:20:23 INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1026
[task 2022-12-15T03:20:23.601Z] 03:20:23 INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1036
[task 2022-12-15T03:20:23.601Z] 03:20:23 INFO - Leaving test bound testFailingHtmlSource
[task 2022-12-15T03:20:23.602Z] 03:20:23 INFO - Entering test bound testLoadingHtmlSource
[task 2022-12-15T03:20:23.602Z] 03:20:23 INFO - Test loading progress of html page sources
[task 2022-12-15T03:20:23.602Z] 03:20:23 INFO - Adding a new tab with URL: http://localhost:49659/slow-loading-page.html
[task 2022-12-15T03:20:23.844Z] 03:20:23 INFO - Tab added and finished loading
[task 2022-12-15T03:20:23.844Z] 03:20:23 INFO - Opening the toolbox
[task 2022-12-15T03:20:23.981Z] 03:20:23 INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome://global/content/customElements.js" line: 500 column: 24 source: "display: none !important"}]
[task 2022-12-15T03:20:23.981Z] 03:20:23 INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome://global/content/customElements.js" line: 500}]
[task 2022-12-15T03:20:23.982Z] 03:20:23 INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome://global/content/elements/panel.js" line: 62}]
[task 2022-12-15T03:20:24.153Z] 03:20:24 INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome://global/content/customElements.js" line: 500 column: 24 source: "display: none !important"}]
[task 2022-12-15T03:20:24.154Z] 03:20:24 INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome://global/content/customElements.js" line: 500}]
[task 2022-12-15T03:20:24.154Z] 03:20:24 INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome://global/content/elements/panel.js" line: 62}]
[task 2022-12-15T03:20:24.185Z] 03:20:24 INFO - Toolbox opened and focused
[task 2022-12-15T03:20:24.185Z] 03:20:24 INFO - Waiting on sources: slow-loading-page.html
[task 2022-12-15T03:20:24.186Z] 03:20:24 INFO - Finished waiting on sources: slow-loading-page.html
[task 2022-12-15T03:20:24.230Z] 03:20:24 INFO - Wait for a second HTTP request to be made for the html page
[task 2022-12-15T03:20:24.231Z] 03:20:24 INFO - Console message: [JavaScript Warning: "Use of nsIFile in content process is deprecated." {file: "resource://gre/modules/NetUtil.jsm" line: 251}]
[task 2022-12-15T03:20:24.265Z] 03:20:24 INFO - TEST-PASS | devtools/client/debugger/test/mochitest/browser_dbg-features-source-text-content.js | The source is still loading until we release the network request -
Assignee | ||
Updated•2 years ago
|
Comment 10•2 years ago
|
||
bugherder |
Description
•