Fix typo on protocol handlers (#33565)

Signed-off-by: Wu Wayne <yuweiwu@pm.me>
This commit is contained in:
Ngo Iok Ui (Wu Yu Wei) 2024-09-27 16:16:27 +09:00 committed by GitHub
parent 78370fa6d0
commit c519a2cdb6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 10 deletions

View file

@ -61,8 +61,8 @@ impl EmbedderMethods for EmbedderCallbacks {
fn get_protocol_handlers(&self) -> ProtocolRegistry {
let mut registry = ProtocolRegistry::default();
registry.register("urlinfo", urlinfo::UrlInfoProtocolHander::default());
registry.register("servo", servo_handler::ServoProtocolHander::default());
registry.register("resource", resource::ResourceProtocolHander::default());
registry.register("servo", servo_handler::ServoProtocolHandler::default());
registry.register("resource", resource::ResourceProtocolHandler::default());
registry
}

View file

@ -23,9 +23,9 @@ use net_traits::ResourceFetchTiming;
use tokio::sync::mpsc::unbounded_channel;
#[derive(Default)]
pub struct ResourceProtocolHander {}
pub struct ResourceProtocolHandler {}
impl ResourceProtocolHander {
impl ResourceProtocolHandler {
pub fn response_for_path(
request: &mut Request,
done_chan: &mut DoneChannel,
@ -91,7 +91,7 @@ impl ResourceProtocolHander {
}
}
impl ProtocolHandler for ResourceProtocolHander {
impl ProtocolHandler for ResourceProtocolHandler {
fn load(
&self,
request: &mut Request,

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Loads resources using a mapping from well-known shortcuts to resource: urls.
//! Recognized shorcuts:
//! Recognized shortcuts:
//! - servo:newtab
use std::future::Future;
@ -14,12 +14,12 @@ use net::protocols::ProtocolHandler;
use net_traits::request::Request;
use net_traits::response::Response;
use crate::desktop::protocols::resource::ResourceProtocolHander;
use crate::desktop::protocols::resource::ResourceProtocolHandler;
#[derive(Default)]
pub struct ServoProtocolHander {}
pub struct ServoProtocolHandler {}
impl ProtocolHandler for ServoProtocolHander {
impl ProtocolHandler for ServoProtocolHandler {
fn load(
&self,
request: &mut Request,
@ -29,7 +29,7 @@ impl ProtocolHandler for ServoProtocolHander {
let url = request.current_url();
match url.path() {
"newtab" => ResourceProtocolHander::response_for_path(
"newtab" => ResourceProtocolHandler::response_for_path(
request,
done_chan,
context,