Change BrowingContextId from WebViewId explicitly (#39095)

There were still some accesses to the inner BrowsingContextId from the
WebViewId. This changes it to completely rely on the From trait for
these methods. This also means we can make the field private.

For testing we add a way to create arbitrary WebViewIds.

Testing: Does not change functionality.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
Narfinger 2025-09-03 14:18:08 +02:00 committed by GitHub
parent 4ea714e6d2
commit b73c81630a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 19 additions and 13 deletions

View file

@ -89,7 +89,7 @@ mod test {
use crate::webview_manager::WebViewManager;
fn id(namespace_id: u32, index: u32) -> WebViewId {
WebViewId(BrowsingContextId {
WebViewId::mock_for_testing(BrowsingContextId {
namespace_id: PipelineNamespaceId(namespace_id),
index: Index::new(index).expect("Incorrect test case"),
})