From 771d982cfc14e7e01c1f2fc18ed26c75c3875f91 Mon Sep 17 00:00:00 2001
From: Stanca Serban <sstanca@mozilla.com>
Date: Tue, 21 Feb 2023 11:06:43 +0200
Subject: [PATCH] Backed out 9 changesets (bug 1817714, bug 1817722, bug
 1817721, bug 1817719, bug 1817717, bug 1817720, bug 1817715, bug 1817716, bug
 1817718) for causing bp-hybrid bustages in nsFind.cpp. CLOSED TREE

Backed out changeset 8acd5a2263f9 (bug 1817722)
Backed out changeset 299f412fa933 (bug 1817721)
Backed out changeset 345907a5a764 (bug 1817720)
Backed out changeset d710584cc1ee (bug 1817719)
Backed out changeset 7a581148ea00 (bug 1817718)
Backed out changeset 0b9d922e895a (bug 1817717)
Backed out changeset 2878e5488069 (bug 1817716)
Backed out changeset 97b49222483f (bug 1817715)
Backed out changeset a556e575cc13 (bug 1817714)
---
 dom/media/webrtc/jsapi/PeerConnectionCtx.cpp      | 8 ++++++++
 dom/media/webrtc/jsapi/PeerConnectionCtx.h        | 7 +------
 dom/media/webrtc/jsapi/moz.build                  | 2 ++
 dom/promise/PromiseNativeHandler.cpp              | 2 --
 dom/promise/moz.build                             | 2 ++
 intl/uconv/moz.build                              | 2 ++
 security/sandbox/linux/gtest/moz.build            | 2 ++
 security/sandbox/linux/launch/moz.build           | 2 ++
 toolkit/components/autocomplete/moz.build         | 2 ++
 toolkit/components/browser/moz.build              | 2 ++
 toolkit/components/find/moz.build                 | 2 ++
 toolkit/components/find/nsWebBrowserFind.cpp      | 1 -
 toolkit/components/find/nsWebBrowserFind.h        | 1 -
 toolkit/components/resistfingerprinting/moz.build | 2 ++
 14 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/dom/media/webrtc/jsapi/PeerConnectionCtx.cpp b/dom/media/webrtc/jsapi/PeerConnectionCtx.cpp
index 33e892080c7e8..8596e40e3a50d 100644
--- a/dom/media/webrtc/jsapi/PeerConnectionCtx.cpp
+++ b/dom/media/webrtc/jsapi/PeerConnectionCtx.cpp
@@ -490,6 +490,14 @@ PeerConnectionImpl* PeerConnectionCtx::GetPeerConnection(
   return iterator->second;
 }
 
+template <typename Function>
+void PeerConnectionCtx::ForEachPeerConnection(Function&& aFunction) const {
+  MOZ_ASSERT(NS_IsMainThread());
+  for (const auto& pair : mPeerConnections) {
+    aFunction(pair.second);
+  }
+}
+
 void PeerConnectionCtx::ClearClosedStats() {
   for (auto& [id, pc] : mPeerConnections) {
     Unused << id;
diff --git a/dom/media/webrtc/jsapi/PeerConnectionCtx.h b/dom/media/webrtc/jsapi/PeerConnectionCtx.h
index e7393f786bd91..f48a3ae49e1c1 100644
--- a/dom/media/webrtc/jsapi/PeerConnectionCtx.h
+++ b/dom/media/webrtc/jsapi/PeerConnectionCtx.h
@@ -126,12 +126,7 @@ class PeerConnectionCtx {
                          PeerConnectionImpl* aPeerConnection);
   PeerConnectionImpl* GetPeerConnection(const std::string& aKey) const;
   template <typename Function>
-  void ForEachPeerConnection(Function&& aFunction) const {
-    MOZ_ASSERT(NS_IsMainThread());
-    for (const auto& pair : mPeerConnections) {
-      aFunction(pair.second);
-    }
-  }
+  void ForEachPeerConnection(Function&& aFunction) const;
 
   void ClearClosedStats();
 
diff --git a/dom/media/webrtc/jsapi/moz.build b/dom/media/webrtc/jsapi/moz.build
index fdfa4d8cf3c36..93cf879823155 100644
--- a/dom/media/webrtc/jsapi/moz.build
+++ b/dom/media/webrtc/jsapi/moz.build
@@ -37,3 +37,5 @@ UNIFIED_SOURCES += [
 ]
 
 FINAL_LIBRARY = "xul"
+
+REQUIRES_UNIFIED_BUILD = True
diff --git a/dom/promise/PromiseNativeHandler.cpp b/dom/promise/PromiseNativeHandler.cpp
index 88f7edef3ae18..ae6b112ee84fe 100644
--- a/dom/promise/PromiseNativeHandler.cpp
+++ b/dom/promise/PromiseNativeHandler.cpp
@@ -7,8 +7,6 @@
 #include "PromiseNativeHandler.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/Promise.h"
-#include "mozilla/dom/DOMException.h"
-#include "mozilla/dom/DOMExceptionBinding.h"
 #include "nsISupportsImpl.h"
 
 namespace mozilla::dom {
diff --git a/dom/promise/moz.build b/dom/promise/moz.build
index c317f1fae0804..58285d13eea3f 100644
--- a/dom/promise/moz.build
+++ b/dom/promise/moz.build
@@ -40,3 +40,5 @@ MOCHITEST_MANIFESTS += ["tests/mochitest.ini"]
 MOCHITEST_CHROME_MANIFESTS += ["tests/chrome.ini"]
 
 XPCSHELL_TESTS_MANIFESTS += ["tests/unit/xpcshell.ini"]
+
+REQUIRES_UNIFIED_BUILD = True
diff --git a/intl/uconv/moz.build b/intl/uconv/moz.build
index f21e4055f94a3..e83d8704d83f7 100644
--- a/intl/uconv/moz.build
+++ b/intl/uconv/moz.build
@@ -30,3 +30,5 @@ XPCOM_MANIFESTS += [
 ]
 
 FINAL_LIBRARY = "xul"
+
+REQUIRES_UNIFIED_BUILD = True
diff --git a/security/sandbox/linux/gtest/moz.build b/security/sandbox/linux/gtest/moz.build
index f80482aee3e27..96fc4bd6695d1 100644
--- a/security/sandbox/linux/gtest/moz.build
+++ b/security/sandbox/linux/gtest/moz.build
@@ -24,3 +24,5 @@ LOCAL_INCLUDES += [
 ]
 
 FINAL_LIBRARY = "xul-gtest"
+
+REQUIRES_UNIFIED_BUILD = True
diff --git a/security/sandbox/linux/launch/moz.build b/security/sandbox/linux/launch/moz.build
index 09f483f5194c6..50a017c18b86e 100644
--- a/security/sandbox/linux/launch/moz.build
+++ b/security/sandbox/linux/launch/moz.build
@@ -31,3 +31,5 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
 
 FINAL_LIBRARY = "xul"
+
+REQUIRES_UNIFIED_BUILD = True
diff --git a/toolkit/components/autocomplete/moz.build b/toolkit/components/autocomplete/moz.build
index 2f9a4e548905f..a751113054eb8 100644
--- a/toolkit/components/autocomplete/moz.build
+++ b/toolkit/components/autocomplete/moz.build
@@ -35,3 +35,5 @@ FINAL_LIBRARY = "xul"
 
 with Files("**"):
     BUG_COMPONENT = ("Toolkit", "Autocomplete")
+
+REQUIRES_UNIFIED_BUILD = True
diff --git a/toolkit/components/browser/moz.build b/toolkit/components/browser/moz.build
index 903390a3c86bc..a3cea2eddcd08 100644
--- a/toolkit/components/browser/moz.build
+++ b/toolkit/components/browser/moz.build
@@ -39,3 +39,5 @@ EXPORTS += [
     "nsEmbedCID.h",
     "nsWebBrowser.h",
 ]
+
+REQUIRES_UNIFIED_BUILD = True
diff --git a/toolkit/components/find/moz.build b/toolkit/components/find/moz.build
index e4f3f396f93aa..13fea66b44735 100644
--- a/toolkit/components/find/moz.build
+++ b/toolkit/components/find/moz.build
@@ -27,3 +27,5 @@ SOURCES += [
 MOCHITEST_MANIFESTS += ["test/mochitest/mochitest.ini"]
 
 FINAL_LIBRARY = "xul"
+
+REQUIRES_UNIFIED_BUILD = True
diff --git a/toolkit/components/find/nsWebBrowserFind.cpp b/toolkit/components/find/nsWebBrowserFind.cpp
index 2e06f65fc8878..045b1dcf62352 100644
--- a/toolkit/components/find/nsWebBrowserFind.cpp
+++ b/toolkit/components/find/nsWebBrowserFind.cpp
@@ -43,7 +43,6 @@
 #  include "nsString.h"
 #endif
 
-using namespace mozilla;
 using mozilla::dom::Document;
 using mozilla::dom::Element;
 using mozilla::dom::Selection;
diff --git a/toolkit/components/find/nsWebBrowserFind.h b/toolkit/components/find/nsWebBrowserFind.h
index 0c846d2f175ec..a3672908d8d91 100644
--- a/toolkit/components/find/nsWebBrowserFind.h
+++ b/toolkit/components/find/nsWebBrowserFind.h
@@ -11,7 +11,6 @@
 
 #include "nsCOMPtr.h"
 #include "nsIWeakReferenceUtils.h"
-#include "nsPIDOMWindow.h"
 
 #include "nsString.h"
 
diff --git a/toolkit/components/resistfingerprinting/moz.build b/toolkit/components/resistfingerprinting/moz.build
index 9f3d1354da62b..b5293cf50ed48 100644
--- a/toolkit/components/resistfingerprinting/moz.build
+++ b/toolkit/components/resistfingerprinting/moz.build
@@ -24,3 +24,5 @@ EXPORTS.mozilla += [
 EXTRA_JS_MODULES += [
     "RFPHelper.jsm",
 ]
+
+REQUIRES_UNIFIED_BUILD = True
-- 
GitLab