In SitePermsAddonWrapper, we are keeping track of permission with a uniqueness on the permission type.
But for a given permission type and origin, multiple permissions can be set (for regular and private windows, ...).
This patch make it so we bookkeep all the permission that are passed, so we can then later properly
remove them when the addon gets uninstalled, or when individual permission are being revoked.
Differential Revision: https://phabricator.services.mozilla.com/D159420
Rather than having the enterprise policy push engine information to the search service, this pulls it from the policies whilst initialisation is in progress. This will ensure the search service always has the correct information for policy engines even if the search settings file is modified.
Differential Revision: https://phabricator.services.mozilla.com/D156538
The only remaining user of this function uses it as an awkward way to get the
debug name of a timer callback function. We should just provide it with a
straightforward way to do that instead.
Differential Revision: https://phabricator.services.mozilla.com/D159335
The site preference will take precedence over the pref setting when we
getting the cookie rule and the clicking rule. We will use the top-level
uri to check the site preference which aligns with the behavior of ETP
toggle.
Differential Revision: https://phabricator.services.mozilla.com/D157869
This patch implements the CookieBannerDomainPrefService which manage
the per domain pref setting for cookie banner handling. The service uses
the nsIContentPrefService2 to store the per site pref value.
Differential Revision: https://phabricator.services.mozilla.com/D157866
This error message provides extra information to developers so they know why the access was denied
(e.g. for public etld, remote subframes, ...).
Differential Revision: https://phabricator.services.mozilla.com/D159246
Without flushing the layout, new windows appear to the opener to
initially open at the size of the opener instead of the specified size.
We can flush the layout unconditionally when we have a specified size
where we otherwise would make sure that the frame loader has been
reflowed at least once.
Thanks to Emilio for providing the changes to avoid tokenizing the
window features twice.
Differential Revision: https://phabricator.services.mozilla.com/D158584
We're still holding strong references to the WebExtensionPolicy objects through
the `mExtensions` map, so we don't need to worry about the policy instances
dying earlier after this change.
Differential Revision: https://phabricator.services.mozilla.com/D159087
* Expose filter_expression field via UI.
* Removed default values to avoid them being added to JSON payload via RemoteSettings editor.
Differential Revision: https://phabricator.services.mozilla.com/D159380
Now that all fields and methods in WebAccessibleResource have been made
threadsafe, we can make the type itself be threadsafe.
Differential Revision: https://phabricator.services.mozilla.com/D158885
In order to make WebAccessibleResource threadsafe, as well as other places, it
needs to be possible to look up a `WebExtensionPolicyCore` from any thread.
This is handled by using a static method on the ExtensionPolicyService for this
task, and keeping a seperate mutex-guarded static table under the hood.
Theoretically the table within `ExtensionPolicyService()` could also be
removed, however I held off on doing that in case it would have a negative
performance impact to take extra locks and follow extra pointers.
Differential Revision: https://phabricator.services.mozilla.com/D158884
Similar to MatchGlob, this is fairly straightforward, but is complicated
slightly by `MatchPatternSet`, which allows being destructured into the
contained `MatchPattern` instances in a `[Constant]` method. To handle this a
cache is added for the wrappers in the cycle-collected `MatchPatternSet`.
Differential Revision: https://phabricator.services.mozilla.com/D158883
The mutator methods were never used, so were easy to remove, allowing the type
to be made threadsafe. The main potential for performance regression is that
the string based Contains method now uses `NS_Atomize` instead of
`NS_AtomizeMainThread`, however this is only called in once place
(WebExtensionPolicy::HasPermission). If it turns out to be an issue, we can
move the atomization into the caller to keep it using `NS_AtomizeMainThread`.
Differential Revision: https://phabricator.services.mozilla.com/D158880
This threadsafe core type also acts as a weak reference to the main-thread
WebExtensionPolicy when needed. This will be used when information about a
WebExtension is needed to be accessible off-main-thread in the future.
Differential Revision: https://phabricator.services.mozilla.com/D158879
In debug mode, the compile for some regular expressions is much slower with the
regex crate than it was with the JS engine, likely due to the regex's crate
heavy reliance on inlining and other llvm optimizations. Subsequent runs are
much faster, as they do not need to optimize and build the DFA.
Differential Revision: https://phabricator.services.mozilla.com/D158878
This also involves making MatchGlob operate on UTF8String instead of DOMString,
as the rust `regex` crate operates on utf-8 strings. This should have no
functional impact on callers.
Differential Revision: https://phabricator.services.mozilla.com/D158877
The `RustRegex` wrapper is built on the official `rure` ffi bindings for the
`regex` crate, which was added in previous parts. The `regex-ffi` crate will be
removed in the next part.
Differential Revision: https://phabricator.services.mozilla.com/D158875
While we already have an in-tree `regex-ffi` crate which provides basic
access to regex functionality for use in FormAutofillNative, the `regex`
crate itself provides and maintains its own c api as the `rure` crate.
This patch vendors in `rure` to allow us to use the more-fully-featured
official ffi.
Differential Revision: https://phabricator.services.mozilla.com/D158873
The "message" property of the pref "browser.firefox-view.feature-tour" seems to have no actual use, and only one value of "FIREFOX_VIEW_FEATURE_TOUR". We can remove it to reduce complexity.
Differential Revision: https://phabricator.services.mozilla.com/D159131