mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Converted --max-session-history opt into a pref, updated its uses to PREF api
updated test docs
This commit is contained in:
parent
4c401e47dc
commit
0fae39f468
4 changed files with 4 additions and 12 deletions
|
@ -2136,7 +2136,8 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
} else if let Some(frame) = self.frames.get_mut(&frame_change.frame_id) {
|
||||
debug!("Adding pipeline to existing frame.");
|
||||
frame.load(frame_change.new_pipeline_id, frame_change.url.clone());
|
||||
let evicted_id = frame.prev.len().checked_sub(opts::get().max_session_history)
|
||||
let evicted_id = frame.prev.len()
|
||||
.checked_sub(PREFS.get("session-history.max-length").as_u64().unwrap_or(20) as usize)
|
||||
.and_then(|index| frame.prev.get_mut(index))
|
||||
.and_then(|entry| entry.pipeline_id.take());
|
||||
(evicted_id, false, true, true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue