mirror of
https://github.com/servo/servo.git
synced 2025-09-30 16:49:16 +01:00
Make reload button clear the network cache.
This commit is contained in:
parent
fe24fc3068
commit
f030162ec3
10 changed files with 50 additions and 1 deletions
|
@ -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");
|
||||
|
|
|
@ -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(|| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue