Changes name of "WorkerAssociatedBrowsingContext" in LoadInfo to just
"AssociatedBrowsingContext" to signal it's somewhat broader use case.
For reporting api, to show up in dev tools, we need dev tooling to match
against the channel and for that it needs a browsing context id (or
something similar). We set the associated bc id and then try matching
against that in NetworkUtils.sys.mjs.
Differential Revision: https://phabricator.services.mozilla.com/D283896
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
This reverts commit 5e25aa2de6.
Revert "Bug 1968722 - Storage-Access-Headers: Set Request header with storage-access state and frame activation r=necko-reviewers,jesup,timhuang"
This reverts commit f72bb573c1.
To show the trackers who access partitioned cookies, we need to notify
the STATE_COOKIES_PARTITIONED_TRACKER content blocking event.
The patch changes the cookie service to nofity when accessing the
partitioned tracker cookies. And replace the
STATE_COOKIES_LOADED_TRACKER and
STATE_COOKIES_LOADED_SOCIALTRACKER events with the
STATE_COOKIES_PARTITIONED_TRACKER for the ContentBlockingNotifier.
Differential Revision: https://phabricator.services.mozilla.com/D229330
Those query interfaces on image load show up in profiles, eg it's about 0.05% of total time of the NewsSite test on sp3.
Differential Revision: https://phabricator.services.mozilla.com/D192726
Those query interfaces on image load show up in profiles, eg it's about 0.05% of total time of the NewsSite test on sp3.
Differential Revision: https://phabricator.services.mozilla.com/D192726
The patch modifies the ShouldAllowAccessFor(nsIChannel) to handle the
channels that don't have target browsing context. For example, the
channel for loading shared worker scripts won't have a associated
browsing context. In this case, the ShouldAllowAccessFor() should still
work but just ignore the checks that require the browsing context.
Differential Revision: https://phabricator.services.mozilla.com/D212542
The targetBrowsingContext is not available for fetch requests from
worker scopes. So, we cannot get the target browsing context in
ShouldAllowAccessFor().
To fix this, we can use the WorkerAssociatedBrowsingContext if the target
browsing context is not available.
Differential Revision: https://phabricator.services.mozilla.com/D208757
The bulk of this is updating the comments. That makes everything easier to understand, and will be useful to understand when StorageKeying.
Other changes:
- remove an extra CJS Create call when we already have one.
- create and use a CookiesBehavior-esque helper for the ApproximateAllowAccessFor function. This creates a parallel structure adds a minor improvement for webextensions for Image caching.
- Use the CheckCookiePermissionPrincipal helper in the ShouldAllowAccessFor(principal) function. This was the only of the SAAF funcitons that didn't use this helper and it is functionally equivalent to do so. Parallel structure is good!
Differential Revision: https://phabricator.services.mozilla.com/D198714
Similarly to part 2, this makes one function bigger, but removes a funciton.
IMO the "and then do more stuff" helper call at the end of a function without a clear separation/purpose and no other callsites
mostly makes the code harder to reason about. Especially when that helper is exported in the header so you can't tell at a
glance that there aren't other callers.
Differential Revision: https://phabricator.services.mozilla.com/D198036
This makes the single remaining function larger, but makes things much easier to read to my eyes and reuses the branches that exist instead of mirroring them in both functions
Differential Revision: https://phabricator.services.mozilla.com/D198035
I'm considering dropping this if statement entirely because this is only hit when we disable network state partitioning.
According to code coverage, we only see the ""_ns as the result of this ternary in our testing too.
But, if you disable network state partitioning and then block cookies from a given domain, then we would still want to partition network state I suppose, so I'll leave it like this..
Differential Revision: https://phabricator.services.mozilla.com/D198034
This probably should have been done earlier, but became obvious with uses of Document::HasStorageAccessPermissionGrated in this stack.
Differential Revision: https://phabricator.services.mozilla.com/D184825
This probably should have been done earlier, but became obvious with uses of Document::HasStorageAccessPermissionGrated in this stack.
Differential Revision: https://phabricator.services.mozilla.com/D184825
I have done my best to figure out what these specific call-sites
actually want to be using, however I do not understand the AntiTracking
implementation. Please look over these callers somewhat carefully to
make sure this is actually the desired behaviour.
It seems like the majority of these cases are in places where
`OriginNoSuffix` has been mixed up with
`GetWebExposedOriginSerialization`. This makes sense, as these will be
identical strings for the majority of web-exposed URLs. The big
differences between the two are with other URL types, like null
principals.
The logic seems somewhat inconsistent about its handling of origin
attributes, which was also confusing when reading through it. I've tried
to align with the existing code when possible.
Differential Revision: https://phabricator.services.mozilla.com/D182226