diff options
author | Josh Matthews <josh@joshmatthews.net> | 2019-11-14 11:48:04 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2019-11-14 14:11:53 -0500 |
commit | 8846cda501bd0523a07180b1ea5606a7b8299f1a (patch) | |
tree | 58cc54907385226d4cf19fd17dfe4404ce49e2bb /components/script/script_thread.rs | |
parent | 36c2a131ac9c854001ab5ce046138c867e9bcece (diff) | |
download | servo-8846cda501bd0523a07180b1ea5606a7b8299f1a.tar.gz servo-8846cda501bd0523a07180b1ea5606a7b8299f1a.zip |
script: Reduce scope of borrows for history updates.
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 20ac88b7bc1..6a8d0306715 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -2538,7 +2538,8 @@ impl ScriptThread { source_origin: ImmutableOrigin, data: StructuredSerializedData, ) { - match { self.documents.borrow().find_window(pipeline_id) } { + let window = self.documents.borrow().find_window(pipeline_id); + match window { None => return warn!("postMessage after target pipeline {} closed.", pipeline_id), Some(window) => { // FIXME: synchronously talks to constellation. @@ -2621,7 +2622,8 @@ impl ScriptThread { history_state_id: Option<HistoryStateId>, url: ServoUrl, ) { - match { self.documents.borrow().find_window(pipeline_id) } { + let window = self.documents.borrow().find_window(pipeline_id); + match window { None => { return warn!( "update history state after pipeline {} closed.", @@ -2637,7 +2639,8 @@ impl ScriptThread { pipeline_id: PipelineId, history_states: Vec<HistoryStateId>, ) { - match { self.documents.borrow().find_window(pipeline_id) } { + let window = self.documents.borrow().find_window(pipeline_id); + match window { None => { return warn!( "update history state after pipeline {} closed.", |