Make reload button clear the network cache.

This commit is contained in:
Josh Matthews 2020-07-27 19:56:53 -04:00
parent fe24fc3068
commit f030162ec3
10 changed files with 50 additions and 1 deletions

View file

@ -355,6 +355,13 @@ impl ServoGlue {
})
}
/// Reload the page.
pub fn clear_cache(&mut self) -> Result<(), &'static str> {
info!("clear_cache");
let event = WindowEvent::ClearCache;
self.process_event(event)
}
/// Reload the page.
pub fn reload(&mut self) -> Result<(), &'static str> {
info!("reload");

View file

@ -565,6 +565,14 @@ pub extern "C" fn load_uri(url: *const c_char) -> bool {
})
}
#[no_mangle]
pub extern "C" fn clear_cache() {
catch_any_panic(|| {
debug!("clear_cache");
call(|s| s.clear_cache())
});
}
#[no_mangle]
pub extern "C" fn reload() {
catch_any_panic(|| {