From b62a1ca66204160f3461503ed8c0b3ffbae573fd Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 10 Dec 2018 18:43:26 -0500 Subject: Delay setting the constellation's active browser id until the context exists. --- components/constellation/constellation.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'components/constellation') diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 828db1ce88e..2f921537f2d 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -4034,17 +4034,16 @@ where /// Send the current frame tree to compositor fn send_frame_tree(&mut self, top_level_browsing_context_id: TopLevelBrowsingContextId) { - self.active_browser_id = Some(top_level_browsing_context_id); - let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id); - // Note that this function can panic, due to ipc-channel creation failure. // avoiding this panic would require a mechanism for dealing // with low-resource scenarios. - debug!( - "Sending frame tree for browsing context {}.", - browsing_context_id - ); + let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id); if let Some(frame_tree) = self.browsing_context_to_sendable(browsing_context_id) { + debug!( + "Sending frame tree for browsing context {}.", + browsing_context_id + ); + self.active_browser_id = Some(top_level_browsing_context_id); self.compositor_proxy .send(ToCompositorMsg::SetFrameTree(frame_tree)); } -- cgit v1.2.3