mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
add embedding method for load_handler::on_load_error
still needs error text messages I guess
This commit is contained in:
parent
8e78febaac
commit
14a6390f03
1 changed files with 15 additions and 1 deletions
|
@ -361,7 +361,21 @@ impl WindowMethods for Window {
|
|||
}
|
||||
}
|
||||
|
||||
fn load_error(&self, _: NetError, _: String) {
|
||||
fn load_error(&self, code: NetError, url: String) {
|
||||
let browser = self.cef_browser.borrow();
|
||||
let browser = match *browser {
|
||||
None => return,
|
||||
Some(ref browser) => browser,
|
||||
};
|
||||
if check_ptr_exist!(browser.get_host().get_client(), get_load_handler) &&
|
||||
check_ptr_exist!(browser.get_host().get_client().get_load_handler(), on_load_error) {
|
||||
let utf16_chars: Vec<u16> = Utf16Encoder::new((url).chars()).collect();
|
||||
browser.get_host()
|
||||
.get_client()
|
||||
.get_load_handler()
|
||||
.on_load_error((*browser).clone(), browser.get_main_frame(),
|
||||
code, &[], utf16_chars.as_slice());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_page_title(&self, string: Option<String>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue