Merge mozilla-central to autoland a=merge
authorCoroiu Cristina <ccoroiu@mozilla.com>
Sat, 16 Mar 2019 23:56:14 +0200
changeset 464696 ec61f19960f3
parent 464695 634792168a9d (current diff)
parent 464369 2a96d8f9339f (diff)
child 464697 9d4aec1e584c
push id112465
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:50:10 +0000
treeherdermozilla-inbound@e0861be8d6c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone67.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
Merge mozilla-central to autoland a=merge
python/mozbuild/mozbuild/mach_commands.py
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -7004,17 +7004,18 @@ void nsPIDOMWindowInner::BroadcastReport
   }
 
   while (mReportRecords.Length() > MAX_REPORT_RECORDS) {
     mReportRecords.RemoveElementAt(0);
   }
 }
 
 void nsPIDOMWindowInner::NotifyReportingObservers() {
-  for (ReportingObserver* observer : mReportingObservers) {
+  nsTArray<RefPtr<ReportingObserver>> reportingObservers(mReportingObservers);
+  for (ReportingObserver* observer : reportingObservers) {
     observer->MaybeNotify();
   }
 }
 
 nsPIDOMWindowInner::~nsPIDOMWindowInner() {}
 
 #undef FORWARD_TO_OUTER
 #undef FORWARD_TO_OUTER_OR_THROW
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1612,17 +1612,16 @@ class StaticAnalysisMonitor(object):
         from mozbuild.compilation.warnings import (
             WarningsCollector,
             WarningsDatabase,
         )
 
         self._warnings_database = WarningsDatabase()
 
         def on_warning(warning):
-            filename = warning['filename']
             self._warnings_database.insert(warning)
 
         self._warnings_collector = WarningsCollector(on_warning, objdir=objdir)
 
     @property
     def num_files(self):
         return self._total
 
@@ -2461,17 +2460,16 @@ class StaticAnalysis(MachCommandBase):
         end = re.search(r'^Enabled checks:\n', clang_output, re.MULTILINE)
         if end is not None:
             clang_output = clang_output[:end.start()-1]
 
         # Sort headers by positions
         regex_header = re.compile(
             r'(.+):(\d+):(\d+): (warning|error): ([^\[\]\n]+)(?: \[([\.\w-]+)\])?$', re.MULTILINE)
 
-        something = regex_header.finditer(clang_output)
         headers = sorted(
             regex_header.finditer(clang_output),
             key=lambda h: h.start()
         )
 
         issues = []
         for _, header in enumerate(headers):
             header_group = header.groups()
--- a/testing/web-platform/tests/feature-policy/reporting/fullscreen-reporting.html
+++ b/testing/web-platform/tests/feature-policy/reporting/fullscreen-reporting.html
@@ -2,28 +2,44 @@
 <html>
   <head>
     <script src='/resources/testharness.js'></script>
     <script src='/resources/testharnessreport.js'></script>
   </head>
   <body>
     <div id='fs'></div>
     <script>
+var observer1;
+var observer2;
+
 var check_report_format = (reports, observer) => {
+  // Test that observer2 is notified, even if it is disconnected.
+  observer1.disconnect();
+  observer2.disconnect();
   let report = reports[0];
   assert_equals(report.type, "feature-policy-violation");
   assert_equals(report.url, document.location.href);
   assert_equals(report.body.featureId, "fullscreen");
   assert_equals(report.body.sourceFile, document.location.href);
   assert_equals(typeof report.body.lineNumber, "number");
   assert_equals(typeof report.body.columnNumber, "number");
   assert_equals(report.body.disposition, "enforce");
 };
 
+var check_second_observer = (reports, observer) => {
+  let report = reports[0];
+  assert_equals(report.type, "feature-policy-violation");
+  assert_equals(report.body.featureId, "fullscreen");
+};
+
 async_test(t => {
-  new ReportingObserver(t.step_func_done(check_report_format),
-                        {types: ['feature-policy-violation']}).observe();
+  observer1 = new ReportingObserver(t.step_func(check_report_format),
+                                    {types: ['feature-policy-violation']});
+  observer1.observe();
+  observer2 = new ReportingObserver(t.step_func_done(check_second_observer),
+                                    {types: ['feature-policy-violation']});
+  observer2.observe();
   document.getElementById('fs').requestFullscreen().then(t.unreached_func(
     "Fullscreen should not be allowed in this document.")).catch(()=>{});
 }, "Fullscreen Report Format");
     </script>
   </body>
 </html>