Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unloading, active BC, and clearing js runtime #24789

Merged
merged 1 commit into from Nov 22, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

ensure unload run with old pipeline as currently-active, do not nulli…

…fy proxy unless currently-active
  • Loading branch information
gterzian committed Nov 21, 2019
commit a21c0bfd1a6463422f84b52b8781a5d6aee1c4d1
@@ -1389,7 +1389,18 @@ impl Window {

self.current_state.set(WindowState::Zombie);
*self.js_runtime.borrow_mut() = None;
self.window_proxy.set(None);

// If this is the currently active pipeline,
// nullify the window_proxy.
if let Some(proxy) = self.window_proxy.get() {
let pipeline_id = self.upcast::<GlobalScope>().pipeline_id();
if let Some(currently_active) = proxy.currently_active() {
if currently_active == pipeline_id {
self.window_proxy.set(None);
}
}
}

if let Some(performance) = self.performance.get() {
performance.clear_and_disable_performance_entry_buffer();
}
@@ -3118,7 +3118,8 @@ impl ScriptThread {
opener: Option<BrowsingContextId>,
) -> DomRoot<WindowProxy> {
if let Some(window_proxy) = self.window_proxies.borrow().get(&browsing_context_id) {
window_proxy.set_currently_active(&*window);
// Note: we do not set the window to be the currently-active one,
// this will be done instead when the script-thread handles the `SetDocumentActivity` msg.
return DomRoot::from_ref(window_proxy);
}
let iframe = parent_info.and_then(|parent_id| {
@@ -1,6 +1,5 @@
[083.html]
type: testharness
expected: ERROR
[ scheduler: event listener defined by script in a document in history]
expected: FAIL

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.