| blocker.rs |
Holds [`Blocker`], which handles all network-based adblocking queries. |
19920 |
46 % |
| content_blocking.rs |
Transforms filter rules into content blocking syntax used on iOS and MacOS. |
28500 |
- |
| cosmetic_filter_cache.rs |
Provides behavior related to cosmetic filtering - that is, modifying a page's contents after
it's been loaded into a browser. This is primarily used to hide or clean up unwanted page
elements that are served inline with the rest of the first-party content from a page, but can
also be used to inject JavaScript "scriptlets" that intercept and modify the behavior of
scripts on the page at runtime.
The primary API exposed by this module is the `CosmeticFilterCache` struct, which stores
cosmetic filters and allows them to be queried efficiently at runtime for any which may be
relevant to a particular page.
To build `CosmeticFilterCache`, use `CosmeticFilterCacheBuilder`. |
16130 |
2 % |
| cosmetic_filter_cache_builder.rs |
Provides API to prepare and serialize cosmetic filter rules to a flatbuffer.
To build the struct, use `CosmeticFilterCacheBuilder`.
To use the serialized rules, use `CosmeticFilterCache`. |
12699 |
24 % |
| cosmetic_filter_utils.rs |
Some utility functions for manipulating cosmetic filter rules.
Used by `CosmeticFilterCacheBuilder` and `CosmeticFilterCache`. |
5911 |
0 % |
| data_format |
|
|
0 % |
| engine.rs |
The adblock [`Engine`] is the primary interface for adblocking. |
15399 |
41 % |
| filters |
|
|
47 % |
| flatbuffers |
|
|
43 % |
| lib.rs |
|
1120 |
- |
| lists.rs |
Parsing functions and collections for handling with multiple filter rules. |
21741 |
35 % |
| malloc_size_of_impls.rs |
`MallocSizeOf` implementations for the types that own the engine's heap, so
that Gecko can report it in about:memory, plus the per-component breakdown
that reporter shows.
These live in one module rather than next to each type to keep the diff
against upstream adblock-rust confined to files upstream does not have.
[`crate::engine::Engine`] is the exception: only it can reach its private
`filter_data_context`. |
5151 |
100 % |
| network_filter_list.rs |
Holds the implementation of [NetworkFilterList] and related functionality. |
5830 |
60 % |
| optimizer.rs |
let union_domain_group = UnionDomainGroup {};
let (fused, unfused) = apply_optimisation(&union_domain_group, filters);
optimized.extend(fused);
|
7044 |
51 % |
| regex_manager.rs |
Compiled regexes can take up large amounts of memory. To reduce the overall memory footprint of
the [`crate::Engine`], infrequently used regexes can be discarded. The [`RegexManager`] is
responsible for managing the storage of regexes used by filters. |
13615 |
67 % |
| request.rs |
Contains structures needed to describe network requests. |
7710 |
66 % |
| resources |
|
|
2 % |
| url_parser |
|
|
1 % |
| utils.rs |
Common utilities used by the library. Some tests and benchmarks rely on this module having
public visibility. |
3762 |
88 % |