mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Implement history state
This commit is contained in:
parent
e4472f7c1f
commit
17bd80a7b1
55 changed files with 316 additions and 359 deletions
|
@ -131,6 +131,7 @@ fn create_http_states(config_dir: Option<&Path>) -> (Arc<HttpState>, Arc<HttpSta
|
|||
auth_cache: RwLock::new(auth_cache),
|
||||
http_cache: RwLock::new(http_cache),
|
||||
hsts_list: RwLock::new(hsts_list),
|
||||
history_states: RwLock::new(HashMap::new()),
|
||||
ssl_client: ssl_client.clone(),
|
||||
connector: create_http_connector(ssl_client),
|
||||
};
|
||||
|
@ -243,6 +244,14 @@ impl ResourceChannelManager {
|
|||
let cookies = cookie_jar.cookies_data_for_url(&url, source).map(Serde).collect();
|
||||
consumer.send(cookies).unwrap();
|
||||
}
|
||||
CoreResourceMsg::GetHistoryState(history_state_id, consumer) => {
|
||||
let history_states = http_state.history_states.read().unwrap();
|
||||
consumer.send(history_states.get(&history_state_id).cloned()).unwrap();
|
||||
}
|
||||
CoreResourceMsg::SetHistoryState(history_state_id, history_state) => {
|
||||
let mut history_states = http_state.history_states.write().unwrap();
|
||||
history_states.insert(history_state_id, history_state);
|
||||
}
|
||||
CoreResourceMsg::Synchronize(sender) => {
|
||||
let _ = sender.send(());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue