The original addition of CSP to `headersAlreadySet` in bug 1462989 was
to make sure that CSP response headers from different extensions are
merged as expected. The logic did however not take into account that
unconditionally merging modified headers means that the header would be
merged with the original CSP from the web page, which prevented add-ons
from relaxing a CSP from the web page.
This commit fixes the bug by tracking the CSP status on the
`ResponseHeaderChanger` instance, which is shared by all webRequest
handlers of a single request.
Differential Revision: https://phabricator.services.mozilla.com/D80761
- Most importantly: Fix the `test_csp` helper to actually replace the
page's CSP header. The existing tests verify that the web page's CSP
is still applied, which is trivially true if the helper extension
appends the CSP instead of replacing it.
- Expand comment on the meaning of the parameters in `test_csp`.
- `sendMessage` is not async, properly await the result.
- Unload extensions before checking assertions, to avoid unhelpful error
messages about extensions not having been unloaded at the end of the
test.
- Report which test case is being run to make debugging easier.
Differential Revision: https://phabricator.services.mozilla.com/D80760
Most of TelemetryController is only used in the parent process, but is
currently loaded in all processes, where it needlessly consumes tens of KB of
memory. This patch splits the parent- and content-specific parts, and only
loads each in the processes where they're needed.
Differential Revision: https://phabricator.services.mozilla.com/D79870
The original addition of CSP to `headersAlreadySet` in bug 1462989 was
to make sure that CSP response headers from different extensions are
merged as expected. The logic did however not take into account that
unconditionally merging modified headers means that the header would be
merged with the original CSP from the web page, which prevented add-ons
from relaxing a CSP from the web page.
This commit fixes the bug by tracking the CSP status on the
`ResponseHeaderChanger` instance, which is shared by all webRequest
handlers of a single request.
Differential Revision: https://phabricator.services.mozilla.com/D80761
- Expand comment on the meaning of the parameters in `test_csp`.
- `sendMessage` is not async, properly await the result.
- Unload extensions before checking assertions, to avoid unhelpful error
messages about extensions not having been unloaded at the end of the
test.
- Report which test case is being run to make debugging easier.
Differential Revision: https://phabricator.services.mozilla.com/D80760
Introduces a gkrust Cargo feature `glean_with_gecko` and `with_gecko` on fog
and glean. This feature signifies the presence of gecko symbols in the build.
Use this feature to implement needs_ipc() which asks Gecko which process type
we're running as.
Differential Revision: https://phabricator.services.mozilla.com/D79744
Introducing FOGIPC, the central clearinghouse for the C++ layer between
PContent and FOG's Rust impl.
Gotta add tests.
Differential Revision: https://phabricator.services.mozilla.com/D79742
This isn't 100% of a solution yet as the main process has no way of turning
a MetricId into a StringMetric (we're gonna a need a table. Maybe several.)
which we'll need before we can replay.
Also, there's no serialization or communication yet, which I guess is a bigger
deal.
Oh, and no detection of which process we're even on.
Differential Revision: https://phabricator.services.mozilla.com/D79741
Temporarily on PContent instead of managed by PBackground, there's one
parentbound message for occasionally uplifting Glean data from child processes
and one childbound message for forcing the immediate flush of Glean data in the
async return.
Can't write gtests for this as ContentChild and ContentParent include things
that aren't present in gtest.
Differential Revision: https://phabricator.services.mozilla.com/D78077
Introduces a gkrust Cargo feature `glean_with_gecko` and `with_gecko` on fog
and glean. This feature signifies the presence of gecko symbols in the build.
Use this feature to implement needs_ipc() which asks Gecko which process type
we're running as.
Differential Revision: https://phabricator.services.mozilla.com/D79744
Introducing FOGIPC, the central clearinghouse for the C++ layer between
PContent and FOG's Rust impl.
Gotta add tests.
Differential Revision: https://phabricator.services.mozilla.com/D79742
This isn't 100% of a solution yet as the main process has no way of turning
a MetricId into a StringMetric (we're gonna a need a table. Maybe several.)
which we'll need before we can replay.
Also, there's no serialization or communication yet, which I guess is a bigger
deal.
Oh, and no detection of which process we're even on.
Differential Revision: https://phabricator.services.mozilla.com/D79741
Temporarily on PContent instead of managed by PBackground, there's one
parentbound message for occasionally uplifting Glean data from child processes
and one childbound message for forcing the immediate flush of Glean data in the
async return.
Can't write gtests for this as ContentChild and ContentParent include things
that aren't present in gtest.
Differential Revision: https://phabricator.services.mozilla.com/D78077