Use JS Context to do stencil parsing in the Utility Process
Categories
(Core :: DOM: Networking, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox112 | --- | fixed |
People
(Reporter: sefeng, Assigned: sefeng)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged][orb:m1], [wptsync upstream])
Attachments
(14 files, 1 obsolete file)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
It looks like we can get the JS context working in the utility process, so we can start to do proper Javascript parsing in the Utility Process.
Assignee | ||
Comment 1•1 year ago
|
||
This patch allows JS Validator to parse the incoming data into
stencil to verify if its a Javascript file.
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
Assignee | ||
Comment 3•1 year ago
|
||
Currently we create JSOracleParent as a singleton which won't work
if we want to have bind it one and want to bind it to a different
utility process (say the previous utility process is crashed),
Hence we create separate JSOracleParent actor for each JSValidatorParent,
so that when the utility process crashes, if the next request
successfully creates a new one, the binding can still work.
Updated•1 year ago
|
Comment 4•1 year ago
|
||
Comment on attachment 9312485 [details]
Bug 1809518 - Add JSON parsing to JS Validator r=farre,smaug,tcampbell!
Revision D166946 was moved to bug 1814478. Setting attachment 9312485 [details] to obsolete.
Comment 5•1 year ago
|
||
Follow-up topics: The JSContext has a tempLifoAlloc
cached on the JSContext that should help with malloc performance concerns. When we eventually remove the JSContext when the new Stencil APIs are landed, we'll also want to take care about this memory usage.
Assignee | ||
Comment 6•1 year ago
|
||
These tests involve a bunch of no-cors fetch requests which use
file_CrossSiteXHR_server.sjs
for sending the response back.
Depends on the request's URL, the response can possibly be
response.setHeader("Content-Type", "application/xml", false);
response.write("<res>hello pass</res>\n");
which will make JS validator to run and blocks.
The fix here is to toggle the pref of ORB when running the tests,
so we test both with ORB and without ORB behaviors, with different
expectations.
Assignee | ||
Comment 7•1 year ago
|
||
These tests involve a bunch of no-cors fetch requests which use
file_CrossSiteXHR_server.sjs
for sending the response back.
Depends on the request's URL, the response can possibly be
response.setHeader("Content-Type", "application/xml", false);
response.write("<res>hello pass</res>\n");
which will make JS validator to run and blocks.
The fix here is to toggle the pref of ORB when running the tests,
so we test both with ORB and without ORB behaviors, with different
expectations.
Depends on D169276
Assignee | ||
Comment 8•1 year ago
|
||
We've done some updates to this test previously when we enable
ORB (without JS validation) already. Now, we have JS validation
added and more requests are blocked, so we need to change
the expectation for more sub-tests.
Depends on D169277
Assignee | ||
Comment 9•1 year ago
|
||
This test send some cross origin no-cors requests and expect
the color of the element will be changed via CSS by reading
the response of these requests.
With ORB's JS validator is enabled, some of the requests are
going to be blocked.
This patch allows the test to test the result for both ORB
enabled and ORB disabled.
Depends on D169278
Assignee | ||
Comment 10•1 year ago
|
||
Devtools use its own mainThreadFetch to fetch resources when it's
needed. For example, fetching the content of a source file. Importantly,
these request use TYPE_OTHER
which could be blocked by ORB. Having
ORB block requests coming from devtools break some of it
functionalities.
Assignee | ||
Comment 11•1 year ago
|
||
This particular request is used to identify the potential timeout issue
for HTTPS only requests. ORB doesn't need to block this request.
Depends on D170250
Comment 12•1 year ago
|
||
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5cc0653b2072 Recreate JSOracleParent instance when Utility Process crashes r=farre https://hg.mozilla.org/integration/autoland/rev/bf67b8c14aa0 Use stencil parsing to do the Javascript check for ORB in Utility Process r=farre,smaug,tcampbell https://hg.mozilla.org/integration/autoland/rev/25a5bf657f5c Update test_fetch_event* related tests based on the status of the ORB r=farre https://hg.mozilla.org/integration/autoland/rev/d86c04497104 Update more fetch tests that use `fetch_test_framework.js` based on the status of ORB r=farre https://hg.mozilla.org/integration/autoland/rev/16bd31105745 Update test_fetch_cors.js based on the status of ORB r=farre https://hg.mozilla.org/integration/autoland/rev/3f43f1cd3e8b Update test_css_cross_domain.html based on the status of ORB r=farre https://hg.mozilla.org/integration/autoland/rev/1ddffd079624 Allow requests that are maded by devtools bypass ORB r=farre,necko-reviewers https://hg.mozilla.org/integration/autoland/rev/1057c5d5a0a5 Special case the HTTPS Only timeout request to make it bypass ORB r=farre,necko-reviewers
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/38649 for changes under testing/web-platform/tests
Comment 14•1 year ago
|
||
Backed out for causing build bustages on JSOracleChild.h
- Backout link
- Push with failures
- Failure Log
- Failure line: /builds/worker/workspace/obj-build/dist/include/mozilla/dom/JSOracleChild.h:77:31: error: declaration of 'static JSContext* mozilla::dom::JSOracleChild::JSContext()' [-fpermissive]
Upstream PR was closed without merging
Updated•1 year ago
|
Comment 16•1 year ago
|
||
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/678468cb98cd Recreate JSOracleParent instance when Utility Process crashes r=farre https://hg.mozilla.org/integration/autoland/rev/3061e4fbf237 Use stencil parsing to do the Javascript check for ORB in Utility Process r=farre,smaug,tcampbell https://hg.mozilla.org/integration/autoland/rev/3eb92dc5aac9 Update test_fetch_event* related tests based on the status of the ORB r=farre https://hg.mozilla.org/integration/autoland/rev/2299a5bdc7a9 Update more fetch tests that use `fetch_test_framework.js` based on the status of ORB r=farre https://hg.mozilla.org/integration/autoland/rev/d2e6d1734eec Update test_fetch_cors.js based on the status of ORB r=farre https://hg.mozilla.org/integration/autoland/rev/f5add471e7f9 Update test_css_cross_domain.html based on the status of ORB r=farre https://hg.mozilla.org/integration/autoland/rev/ce3a811a4522 Allow requests that are maded by devtools bypass ORB r=farre,necko-reviewers https://hg.mozilla.org/integration/autoland/rev/b448bddfa364 Special case the HTTPS Only timeout request to make it bypass ORB r=farre,necko-reviewers
Comment 17•1 year ago
•
|
||
Backed out for causing fetch related failures.
- backout: https://hg.mozilla.org/integration/autoland/rev/5b7e98a1550656a83f5ae55b83f9bcf67fccd194
- push: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&revision=b448bddfa3642506c1ac7cb88d416c0f7317f175
- push with failures: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&searchStr=wpt&revision=de7f205b0aed7ce85493ee0da780ddaa247b3c57
- failure logs:
- TEST-UNEXPECTED-FAIL | /resource-timing/fetch-cross-origin-redirect.https.html | Test fetching through a cross-origin redirect URL - promise_test: Unhandled rejection with value: object "TypeError: NetworkError when attempting to fetch resource."
- TEST-UNEXPECTED-FAIL | /html/cross-origin-embedder-policy/coep-on-response-from-service-worker.https.html | making a cross-origin request for CORP: cross-origin - promise_test: Unhandled rejection with value: object "TypeError: NetworkError when attempting to fetch resource."
- TEST-UNEXPECTED-FAIL | /fetch/origin/assorted.window.html | Origin header and 308 redirect - promise_test: Unhandled rejection with value: object "TypeError: NetworkError when attempting to fetch resource."
- TEST-UNEXPECTED-PASS | /fetch/corb/script-html-correctly-labeled.tentative.sub.html | CORB-blocked script has no syntax errors - expected FAIL
- TEST-UNEXPECTED-FAIL | /service-workers/service-worker/local-url-inherit-controller.https.html | Data URL iframe should not intercept fetch(). - assert_equals: data URL iframe should not intercept fetch expected "" but got "NetworkError when attempting to fetch resource."
- TEST-UNEXPECTED-FAIL | /html/cross-origin-embedder-policy/none-sw-from-none.https.html | making a cross-origin request for CORP: cross-origin - promise_test: Unhandled rejection with value: object "TypeError: NetworkError when attempting to fetch resource."
- TEST-UNEXPECTED-FAIL | /html/semantics/scripting-1/the-script-element/module/credentials.sub.html | Modules should be loaded with or without the credentials based on the same-origin-ness and the crossOrigin attribute - promise_test: Unhandled rejection with value: object "TypeError: NetworkError when attempting to fetch resource."
Upstream PR was closed without merging
Comment 19•1 year ago
|
||
Assignee | ||
Comment 20•1 year ago
|
||
This test tests resource-timing can generate entries with cross origin
redirects, so we just need a dummy request, use empty_script.js instead to
avoid ORB stepping in.
Assignee | ||
Comment 21•1 year ago
|
||
nothing-cross-origin-corp.txt can be replaced by any other files,
because it's used a dummy file. This patch replaces it with a different
dummy file that has JS as the content, to avoid ORB blocks the request.
This doesn't change the semantic of the tests.
Depends on D170911
Assignee | ||
Comment 22•1 year ago
|
||
This test tests fetch and opaque responses, no need for
ORB to block these opaque responses.
Depends on D170912
Assignee | ||
Comment 23•1 year ago
|
||
Use a dummy JS file instead of dummy text file to avoid ORB taking
effects.
This patch should impact
- worker-in-sandboxed-iframe-by-csp-fetch-event.https.html
- sandboxed-iframe-fetch-event.https.html
- opaque-response-preloaded.https.html
- local-url-inherit-controller-frame.html
Depends on D170913
Assignee | ||
Comment 24•1 year ago
|
||
The cookie value used to be blocked by ORB which causes the
test fail, use a JS-like dummy value to avoid it's blocked
by ORB.
Depends on D170914
Assignee | ||
Comment 25•1 year ago
|
||
It doesn't look like we care this test since the test is being flaky
and lots of EXPECTED: FAIL in the ini file. Our ORB changes made it
being [OK, TIMEOUT] on non-fission platforms as well, I think it's
okay to just update the ini file to reflect that.
Depends on D170915
Assignee | ||
Comment 26•1 year ago
|
||
Created a few more patches to fix the test failures.
Comment 27•1 year ago
|
||
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/563403090c7f Recreate JSOracleParent instance when Utility Process crashes r=farre https://hg.mozilla.org/integration/autoland/rev/ae56071e154f Use stencil parsing to do the Javascript check for ORB in Utility Process r=farre,smaug,tcampbell https://hg.mozilla.org/integration/autoland/rev/597cb423049d Update test_fetch_event* related tests based on the status of the ORB r=farre https://hg.mozilla.org/integration/autoland/rev/c02d3f25c880 Update more fetch tests that use `fetch_test_framework.js` based on the status of ORB r=farre https://hg.mozilla.org/integration/autoland/rev/cc88d68be920 Update test_fetch_cors.js based on the status of ORB r=farre https://hg.mozilla.org/integration/autoland/rev/224ccbc28c49 Update test_css_cross_domain.html based on the status of ORB r=farre https://hg.mozilla.org/integration/autoland/rev/724a5c7bba6a Allow requests that are maded by devtools bypass ORB r=farre,necko-reviewers https://hg.mozilla.org/integration/autoland/rev/b6e6065c79ff Special case the HTTPS Only timeout request to make it bypass ORB r=farre,necko-reviewers https://hg.mozilla.org/integration/autoland/rev/92b774c122c9 Fix fetch-cross-origin-redirect.https.html for ORB r=farre https://hg.mozilla.org/integration/autoland/rev/85f4c2ca24e0 Replace nothing-cross-origin-corp.txt with a JS file from COEP tests r=farre https://hg.mozilla.org/integration/autoland/rev/eda8f3ef3fdb Fix fetch/origin/assorted.window.js for ORB r=farre https://hg.mozilla.org/integration/autoland/rev/b1f9dcd5f147 Use a dummy JS file instead of sample.txt for some service-worker tests r=farre https://hg.mozilla.org/integration/autoland/rev/8f77fb0ddfef Fix the-script-element/module/credentials.sub.html for ORB r=farre https://hg.mozilla.org/integration/autoland/rev/3f29ad282371 Update navigation-headers.https.html.ini r=farre https://hg.mozilla.org/integration/autoland/rev/d245efcf2257 apply code formatting via Lando
Comment 28•1 year ago
|
||
Backed out 15 changesets (Bug 1809518) for wpt failures on navigation-headers.https.html.
Backout link
Push with failures <--> wpt3
Failure Log
Upstream PR was closed without merging
Assignee | ||
Comment 30•1 year ago
|
||
I mischanged something in a ini file. Going to try landing them again.
Comment 31•1 year ago
|
||
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8b7e6300391f Recreate JSOracleParent instance when Utility Process crashes r=farre https://hg.mozilla.org/integration/autoland/rev/9a6b3b38f141 Use stencil parsing to do the Javascript check for ORB in Utility Process r=farre,smaug,tcampbell https://hg.mozilla.org/integration/autoland/rev/1839f604af9b Update test_fetch_event* related tests based on the status of the ORB r=farre https://hg.mozilla.org/integration/autoland/rev/72c114e55d5c Update more fetch tests that use `fetch_test_framework.js` based on the status of ORB r=farre https://hg.mozilla.org/integration/autoland/rev/476acd84e171 Update test_fetch_cors.js based on the status of ORB r=farre https://hg.mozilla.org/integration/autoland/rev/2d05f87dcef7 Update test_css_cross_domain.html based on the status of ORB r=farre https://hg.mozilla.org/integration/autoland/rev/aa4a50acfc13 Allow requests that are maded by devtools bypass ORB r=farre,necko-reviewers https://hg.mozilla.org/integration/autoland/rev/e2b235e836b7 Special case the HTTPS Only timeout request to make it bypass ORB r=farre,necko-reviewers https://hg.mozilla.org/integration/autoland/rev/ff881dc47051 Fix fetch-cross-origin-redirect.https.html for ORB r=farre https://hg.mozilla.org/integration/autoland/rev/29720d7132cf Replace nothing-cross-origin-corp.txt with a JS file from COEP tests r=farre https://hg.mozilla.org/integration/autoland/rev/6cd3b5d8362b Fix fetch/origin/assorted.window.js for ORB r=farre https://hg.mozilla.org/integration/autoland/rev/d19285be01a8 Use a dummy JS file instead of sample.txt for some service-worker tests r=farre https://hg.mozilla.org/integration/autoland/rev/37263ae5c4c8 Fix the-script-element/module/credentials.sub.html for ORB r=farre https://hg.mozilla.org/integration/autoland/rev/767c63fa5c50 Update navigation-headers.https.html.ini r=farre https://hg.mozilla.org/integration/autoland/rev/ef3388874d8b apply code formatting via Lando
Comment 32•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8b7e6300391f
https://hg.mozilla.org/mozilla-central/rev/9a6b3b38f141
https://hg.mozilla.org/mozilla-central/rev/1839f604af9b
https://hg.mozilla.org/mozilla-central/rev/72c114e55d5c
https://hg.mozilla.org/mozilla-central/rev/476acd84e171
https://hg.mozilla.org/mozilla-central/rev/2d05f87dcef7
https://hg.mozilla.org/mozilla-central/rev/aa4a50acfc13
https://hg.mozilla.org/mozilla-central/rev/e2b235e836b7
https://hg.mozilla.org/mozilla-central/rev/ff881dc47051
https://hg.mozilla.org/mozilla-central/rev/29720d7132cf
https://hg.mozilla.org/mozilla-central/rev/6cd3b5d8362b
https://hg.mozilla.org/mozilla-central/rev/d19285be01a8
https://hg.mozilla.org/mozilla-central/rev/37263ae5c4c8
https://hg.mozilla.org/mozilla-central/rev/767c63fa5c50
https://hg.mozilla.org/mozilla-central/rev/ef3388874d8b
Upstream PR merged by moz-wptsync-bot
Updated•1 year ago
|
Updated•1 year ago
|
Comment 35•1 year ago
|
||
(In reply to Pulsebot from comment #31)
Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8b7e6300391f
Recreate JSOracleParent instance when Utility Process crashes r=farre
https://hg.mozilla.org/integration/autoland/rev/9a6b3b38f141
Use stencil parsing to do the Javascript check for ORB in Utility Process
r=farre,smaug,tcampbell
https://hg.mozilla.org/integration/autoland/rev/1839f604af9b
Update test_fetch_event* related tests based on the status of the ORB r=farre
https://hg.mozilla.org/integration/autoland/rev/72c114e55d5c
Update more fetch tests that usefetch_test_framework.js
based on the
status of ORB r=farre
https://hg.mozilla.org/integration/autoland/rev/476acd84e171
Update test_fetch_cors.js based on the status of ORB r=farre
https://hg.mozilla.org/integration/autoland/rev/2d05f87dcef7
Update test_css_cross_domain.html based on the status of ORB r=farre
https://hg.mozilla.org/integration/autoland/rev/aa4a50acfc13
Allow requests that are maded by devtools bypass ORB r=farre,necko-reviewers
https://hg.mozilla.org/integration/autoland/rev/e2b235e836b7
Special case the HTTPS Only timeout request to make it bypass ORB
r=farre,necko-reviewers
https://hg.mozilla.org/integration/autoland/rev/ff881dc47051
Fix fetch-cross-origin-redirect.https.html for ORB r=farre
https://hg.mozilla.org/integration/autoland/rev/29720d7132cf
Replace nothing-cross-origin-corp.txt with a JS file from COEP tests r=farre
https://hg.mozilla.org/integration/autoland/rev/6cd3b5d8362b
Fix fetch/origin/assorted.window.js for ORB r=farre
https://hg.mozilla.org/integration/autoland/rev/d19285be01a8
Use a dummy JS file instead of sample.txt for some service-worker tests
r=farre
https://hg.mozilla.org/integration/autoland/rev/37263ae5c4c8
Fix the-script-element/module/credentials.sub.html for ORB r=farre
https://hg.mozilla.org/integration/autoland/rev/767c63fa5c50
Update navigation-headers.https.html.ini r=farre
https://hg.mozilla.org/integration/autoland/rev/ef3388874d8b
apply code formatting via Lando
== Change summary for alert #37574 (as of Wed, 08 Mar 2023 02:24:55 GMT) ==
Improvements:
Ratio | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|
4% | displaylist_mutate | macosx1015-64-shippable-qr | e10s fission stylo webrender-sw | 1,898.40 -> 1,830.87 |
3% | displaylist_mutate | macosx1015-64-shippable-qr | e10s fission stylo webrender-sw | 1,889.88 -> 1,825.40 |
Updated•1 year ago
|
Description
•