make protocol handlers registrable (#33104)

Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
webbeef 2024-08-21 21:11:16 -07:00 committed by GitHub
parent 562d32c051
commit 663a92a5df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 516 additions and 219 deletions

View file

@ -31,6 +31,7 @@ ipc-channel = { workspace = true }
keyboard-types = { workspace = true }
libc = { workspace = true }
log = { workspace = true }
net = { path = "../net" }
net_traits = { workspace = true }
pixels = { path = "../pixels" }
profile_traits = { workspace = true }

View file

@ -12,6 +12,7 @@ use embedder_traits::{EmbedderProxy, EventLoopWaker};
use euclid::Scale;
use keyboard_types::KeyboardEvent;
use libc::c_void;
use net::protocols::ProtocolRegistry;
use script_traits::{
GamepadEvent, MediaSessionActionType, MouseButton, TouchEventType, TouchId, TraversalDirection,
WheelDelta,
@ -222,6 +223,12 @@ pub trait EmbedderMethods {
fn get_user_agent_string(&self) -> Option<String> {
None
}
/// Returns the protocol handlers implemented by that embedder.
/// They will be merged with the default internal ones.
fn get_protocol_handlers(&self) -> ProtocolRegistry {
ProtocolRegistry::default()
}
}
#[derive(Clone, Copy, Debug)]