servo: Merge #19772 - Do not fire pending callbacks on disconnected performance observer (from ferjm:performance.wpt); r=nox
authorFernando Jiménez Moreno <ferjmoreno@gmail.com>
Mon, 15 Jan 2018 03:20:57 -0600
changeset 453565 df10cf0252d0e8bd8f02aaa702bd9085a5c3bf89
parent 453564 ab6c457eac94fed47844d470aa18ecbfa8da0cfc
child 453566 f13e1bf54640cc830abab85a206a48c20cb20ff4
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnox
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #19772 - Do not fire pending callbacks on disconnected performance observer (from ferjm:performance.wpt); r=nox Implement this change in the Performance Timeline API https://github.com/w3c/performance-timeline/issues/66 - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] There are tests for these changes Source-Repo: https://github.com/servo/servo Source-Revision: f866e1aacb5bcf17a7d11c6106d34b474d6b4f33
servo/components/script/dom/performance.rs
--- a/servo/components/script/dom/performance.rs
+++ b/servo/components/script/dom/performance.rs
@@ -179,24 +179,16 @@ impl Performance {
     /// Remove a PerformanceObserver from the list of observers.
     pub fn remove_observer(&self, observer: &DOMPerformanceObserver) {
         let mut observers = self.observers.borrow_mut();
         let index = match observers.iter().position(|o| &(*o.observer) == observer) {
             Some(p) => p,
             None => return,
         };
 
-        if self.pending_notification_observers_task.get() {
-            if let Some(o) = observers.iter().nth(index) {
-                DOMPerformanceObserver::new(&self.global(),
-                                            o.observer.callback(),
-                                            o.observer.entries()).notify();
-            }
-        }
-
         observers.remove(index);
     }
 
     /// Queue a notification for each performance observer interested in
     /// this type of performance entry and queue a low priority task to
     /// notify the observers if no other notification task is already queued.
     ///
     /// Algorithm spec: