Bug 1612894, bring back the IsDiscarded check, r=farre
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Thu, 06 Feb 2020 15:17:53 +0000
changeset 512770 1188d4a563355f444b705e85f66110486df9f5b0
parent 512769 caed697fb694d70f40b2d5abb7d91fd9cd56cef8
child 512771 9c032d3199e5e3a36c7b070d5f1414aec4a1faff
push id37097
push usercsabou@mozilla.com
push dateThu, 06 Feb 2020 21:47:20 +0000
treeherdermozilla-central@b372743705c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfarre
bugs1612894, 1613431
milestone74.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
Bug 1612894, bring back the IsDiscarded check, r=farre This brings back https://hg.mozilla.org/mozilla-central/rev/641b9a29f6ee#l1.346 for now. The patch is based on code auditing, since haven't managed to reproduce the crash. To sort out what behavior is wanted eventually, see https://bugzilla.mozilla.org/show_bug.cgi?id=1613431 Differential Revision: https://phabricator.services.mozilla.com/D61716
docshell/base/SyncedContextInlines.h
--- a/docshell/base/SyncedContextInlines.h
+++ b/docshell/base/SyncedContextInlines.h
@@ -13,16 +13,20 @@
 #include "mozilla/dom/ContentChild.h"
 
 namespace mozilla {
 namespace dom {
 namespace syncedcontext {
 
 template <typename Context>
 nsresult Transaction<Context>::Commit(Context* aOwner) {
+  if (NS_WARN_IF(aOwner->IsDiscarded())) {
+    return NS_ERROR_FAILURE;
+  }
+
   if (!Validate(aOwner, nullptr)) {
     MOZ_CRASH("Attempt to commit invalid transaction");
   }
 
   if (XRE_IsContentProcess()) {
     ContentChild* cc = ContentChild::GetSingleton();
 
     // Increment the field epoch for fields affected by this transaction.