Fix a Null Pointer Dereference crash in `GetInsecureTopLevelSite()`
affecting sites with heavy Service Worker usage (e.g., Discord, Reddit).
This rewrite also hardens our custom `Partition-blobs-by-top-frame-URL`
logic against upstream cross-partition token leak vectors.
In `public_url_manager.cc`, the custom helper was passing the result of
`worker_global_scope->top_level_frame_security_origin()` straight into the
`BlinkSchemefulSite` constructor. However, this property is intentionally
null for Service Workers, causing a fatal null pointer dereference crash.
Additionally, since Cromite's partition checks execute downstream from
vanilla Chromium's native mitigations, the browser-side fallback using
`agent_cluster_id` inside `IsSamePartition()` was redundant dead code.
Changes:
1. Blink: Fully rewrote `GetInsecureTopLevelSite()` using safe `DynamicTo`
casts. For Service Workers, it now safely pulls the browser-validated
partition directly via `service_worker->storage_key().top_level_site()`,
eliminating the null pointer crash surface.
2. Blink / Hardening: Intentionally excluded Shared Workers from Blob URL
support (`IsSharedWorkerGlobalScope()`) by returning `std::nullopt` to prevent
unpartitioned fallback vectors in shared contexts.
3. Storage: Streamlined `IsSamePartition()` in `blob_url_store_impl.cc`
by removing the obsolete `agent_cluster_id` fallback, leaving a clean,
deterministic verification of the top-level site partition.
In Chromium, extension support on Android suffers from a number of issues caused by incorrect pointer handling during dtor, since the dtor behaviour for profiles and windows differs from that of the desktop version.
With these changes, all issues should be resolved (until the next major :) and cromite no longer crashes for these reasons.
Modifies the handling of the system mutex to distinguish Cromite from other Chromium forks and the policy registry path. Disables the forced loading of chrome extensions specified in the registry key.
Currently, all fields in the Chromium bookmark model are marked as “untriaged”, unfortunately since 2022, but they're working on it (https://issues.chromium.org/issues/40212619)
Note that the enable_glic argument is already disabled in cromite's gn args. It is explicitly stated in the patch for clarity.
This patch fixes desktop builds of 145.0.7632.120.