Backed out changeset 44298fb8f4e2 (bug 1597481) for build bustages in MessagePortService.cpp on a CLOSED TREE
authorOana Pop Rus <opoprus@mozilla.com>
Mon, 16 Dec 2019 21:51:08 +0200
changeset 507269 5979b9ae60c04db5fbbc1d55c0b173bc51d6e194
parent 507268 eb0d6b29ae1dd33bd06f8399d6801f22de40a5e5
child 507270 3a9f7aa3da7dcf00b03584211629238846eaf7b4
push id103332
push useropoprus@mozilla.com
push dateMon, 16 Dec 2019 19:52:20 +0000
treeherderautoland@5979b9ae60c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1597481
milestone73.0a1
backs out44298fb8f4e295facdf395741b8500c6553afc3a
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
Backed out changeset 44298fb8f4e2 (bug 1597481) for build bustages in MessagePortService.cpp on a CLOSED TREE
dom/messagechannel/MessagePortParent.h
dom/messagechannel/MessagePortService.cpp
--- a/dom/messagechannel/MessagePortParent.h
+++ b/dom/messagechannel/MessagePortParent.h
@@ -3,26 +3,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_MessagePortParent_h
 #define mozilla_dom_MessagePortParent_h
 
 #include "mozilla/dom/PMessagePortParent.h"
-#include "mozilla/dom/quota/CheckedUnsafePtr.h"
 
 namespace mozilla {
 namespace dom {
 
 class MessagePortService;
 
-class MessagePortParent final
-    : public PMessagePortParent,
-      public SupportsCheckedUnsafePtr<CheckIf<DiagnosticAssertEnabled>> {
+class MessagePortParent final : public PMessagePortParent {
   friend class PMessagePortParent;
 
  public:
   explicit MessagePortParent(const nsID& aUUID);
   ~MessagePortParent();
 
   bool Entangle(const nsID& aDestinationUUID, const uint32_t& aSequenceID);
 
--- a/dom/messagechannel/MessagePortService.cpp
+++ b/dom/messagechannel/MessagePortService.cpp
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MessagePortService.h"
 #include "MessagePortParent.h"
 #include "SharedMessagePortMessage.h"
-#include "mozilla/dom/quota/CheckedUnsafePtr.h"
 #include "mozilla/ipc/BackgroundParent.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/Unused.h"
 #include "nsTArray.h"
 
 using mozilla::ipc::AssertIsOnBackgroundThread;
 
 namespace mozilla {
@@ -21,35 +20,18 @@ namespace dom {
 namespace {
 
 StaticRefPtr<MessagePortService> gInstance;
 
 void AssertIsInMainProcess() {
   MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
 }
 
-struct NextParent {
-  uint32_t mSequenceID;
-  // MessagePortParent keeps the service alive, and we don't want a cycle.
-  CheckedUnsafePtr<MessagePortParent> mParent;
-};
-
 }  // namespace
 
-}  // namespace dom
-}  // namespace mozilla
-
-// Need to call CheckedUnsafePtr's copy constructor and destructor when
-// resizing dynamic arrays containing NextParent (by calling NextParent's
-// implicit copy constructor/destructor rather than memmove-ing NextParents).
-DECLARE_USE_COPY_CONSTRUCTORS(mozilla::dom::NextParent);
-
-namespace mozilla {
-namespace dom {
-
 class MessagePortService::MessagePortServiceData final {
  public:
   explicit MessagePortServiceData(const nsID& aDestinationUUID)
       : mDestinationUUID(aDestinationUUID),
         mSequenceID(1),
         mParent(nullptr)
         // By default we don't know the next parent.
         ,
@@ -61,17 +43,23 @@ class MessagePortService::MessagePortSer
   MessagePortServiceData(const MessagePortServiceData& aOther) = delete;
   MessagePortServiceData& operator=(const MessagePortServiceData&) = delete;
 
   ~MessagePortServiceData() { MOZ_COUNT_DTOR(MessagePortServiceData); }
 
   nsID mDestinationUUID;
 
   uint32_t mSequenceID;
-  CheckedUnsafePtr<MessagePortParent> mParent;
+  MessagePortParent* mParent;
+
+  struct NextParent {
+    uint32_t mSequenceID;
+    // MessagePortParent keeps the service alive, and we don't want a cycle.
+    MessagePortParent* mParent;
+  };
 
   FallibleTArray<NextParent> mNextParents;
   FallibleTArray<RefPtr<SharedMessagePortMessage>> mMessages;
 
   bool mWaitingForNewParent;
   bool mNextStepCloseAll;
 };
 
@@ -167,17 +155,18 @@ bool MessagePortService::RequestEntangli
       CloseAll(aParent->ID());
     }
 
     return true;
   }
 
   // This new parent will be the next one when a Disentangle request is
   // received from the current parent.
-  NextParent* nextParent = data->mNextParents.AppendElement(mozilla::fallible);
+  MessagePortServiceData::NextParent* nextParent =
+      data->mNextParents.AppendElement(mozilla::fallible);
   if (!nextParent) {
     CloseAll(aParent->ID());
     return false;
   }
 
   nextParent->mSequenceID = aSequenceID;
   nextParent->mParent = aParent;
 
@@ -271,20 +260,19 @@ void MessagePortService::CloseAll(const 
   MessagePortServiceData* data;
   if (!mPorts.Get(aUUID, &data)) {
     MaybeShutdown();
     return;
   }
 
   if (data->mParent) {
     data->mParent->Close();
-    data->mParent = nullptr;
   }
 
-  for (const NextParent& parent : data->mNextParents) {
+  for (const MessagePortServiceData::NextParent& parent : data->mNextParents) {
     parent.mParent->CloseAndDelete();
   }
 
   nsID destinationUUID = data->mDestinationUUID;
 
   // If we have informations about the other port and that port has some
   // pending messages to deliver but the parent has not processed them yet,
   // because its entangling request didn't arrive yet), we cannot close this