summaryrefslogtreecommitdiffstats
path: root/xpcom/components
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /xpcom/components
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xpcom/components')
-rw-r--r--xpcom/components/StaticComponents.cpp.in15
-rw-r--r--xpcom/components/gen_static_components.py19
-rw-r--r--xpcom/components/nsIComponentManager.idl2
-rw-r--r--xpcom/components/nsIServiceManager.idl3
4 files changed, 28 insertions, 11 deletions
diff --git a/xpcom/components/StaticComponents.cpp.in b/xpcom/components/StaticComponents.cpp.in
index 7f3fee6859..d717b9f64a 100644
--- a/xpcom/components/StaticComponents.cpp.in
+++ b/xpcom/components/StaticComponents.cpp.in
@@ -83,9 +83,14 @@ const nsXPTInterface gInterfaces[] = {
//# @interfaces@
};
+//# @define_has_component_jsms@
+
+#ifdef HAS_COMPONENT_JSMS
+// TODO: Remove this once m-c and c-c migrations finish (bug 1881887).
const StringOffset gComponentJSMs[] = {
//# @component_jsms@
};
+#endif
const StringOffset gComponentESModules[] = {
//# @component_esmodules@
@@ -148,9 +153,9 @@ static nsresult ConstructJSMOrESMComponent(const nsACString& aURI,
(void**)aResult);
}
-static nsresult ConstructJSMComponent(const nsACString& aURI,
- const char* aConstructor,
- nsISupports** aResult) {
+[[maybe_unused]] static nsresult ConstructJSMComponent(const nsACString& aURI,
+ const char* aConstructor,
+ nsISupports** aResult) {
return ConstructJSMOrESMComponent<ComponentType::JSM>(
aURI, aConstructor, aResult);
}
@@ -351,11 +356,15 @@ const StaticProtocolHandler* StaticProtocolHandler::Lookup(const nsACString& aSc
/* static */ already_AddRefed<nsIUTF8StringEnumerator>
StaticComponents::GetComponentJSMs() {
+#ifdef HAS_COMPONENT_JSMS
auto jsms = MakeUnique<nsTArray<nsCString>>(MOZ_ARRAY_LENGTH(gComponentJSMs));
for (const auto& entry : gComponentJSMs) {
jsms->AppendElement(GetString(entry));
}
+#else
+ auto jsms = MakeUnique<nsTArray<nsCString>>(0);
+#endif
nsCOMPtr<nsIUTF8StringEnumerator> result;
MOZ_ALWAYS_SUCCEEDS(NS_NewAdoptingUTF8StringEnumerator(getter_AddRefs(result),
diff --git a/xpcom/components/gen_static_components.py b/xpcom/components/gen_static_components.py
index f759dc3132..122b7b21ca 100644
--- a/xpcom/components/gen_static_components.py
+++ b/xpcom/components/gen_static_components.py
@@ -920,14 +920,18 @@ def gen_substs(manifests):
cid_phf = PerfectHash(modules, PHF_SIZE, key=lambda module: module.cid.bytes)
- contract_phf = PerfectHash(contracts, PHF_SIZE, key=lambda entry: entry.contract)
+ contract_phf = PerfectHash(
+ contracts, PHF_SIZE, key=lambda entry: entry.contract.encode()
+ )
js_services_phf = PerfectHash(
- list(js_services.values()), PHF_SIZE, key=lambda entry: entry.js_name
+ list(js_services.values()), PHF_SIZE, key=lambda entry: entry.js_name.encode()
)
protocol_handlers_phf = PerfectHash(
- list(protocol_handlers.values()), TINY_PHF_SIZE, key=lambda entry: entry.scheme
+ list(protocol_handlers.values()),
+ TINY_PHF_SIZE,
+ key=lambda entry: entry.scheme.encode(),
)
js_services_json = {}
@@ -945,7 +949,7 @@ def gen_substs(manifests):
substs["contract_count"] = len(contracts)
substs["protocol_handler_count"] = len(protocol_handlers)
- substs["default_protocol_handler_idx"] = protocol_handlers_phf.get_index("default")
+ substs["default_protocol_handler_idx"] = protocol_handlers_phf.get_index(b"default")
gen_module_funcs(substs, module_funcs)
@@ -954,6 +958,9 @@ def gen_substs(manifests):
substs["component_jsms"] = (
"\n".join(" %s," % strings.entry_to_cxx(jsm) for jsm in sorted(jsms)) + "\n"
)
+ substs["define_has_component_jsms"] = (
+ "#define HAS_COMPONENT_JSMS" if len(jsms) > 0 else ""
+ )
substs["component_esmodules"] = (
"\n".join(
" %s," % strings.entry_to_cxx(esModule) for esModule in sorted(esModules)
@@ -1021,7 +1028,9 @@ def gen_substs(manifests):
key_length="aKey.Length()",
)
- substs["js_services_json"] = json.dumps(js_services_json, sort_keys=True, indent=4)
+ substs["js_services_json"] = (
+ json.dumps(js_services_json, sort_keys=True, indent=2) + "\n"
+ )
# Do this only after everything else has been emitted so we're sure the
# string table is complete.
diff --git a/xpcom/components/nsIComponentManager.idl b/xpcom/components/nsIComponentManager.idl
index 9abde9960c..6b921be004 100644
--- a/xpcom/components/nsIComponentManager.idl
+++ b/xpcom/components/nsIComponentManager.idl
@@ -99,6 +99,8 @@ interface nsIComponentManager : nsISupports
/**
* Returns a list of JSM URLs which are used to create components. This
* should only be used in automation.
+ *
+ * TODO: Remove this once m-c and c-c migrations finish (bug 1881887).
*/
nsIUTF8StringEnumerator getComponentJSMs();
diff --git a/xpcom/components/nsIServiceManager.idl b/xpcom/components/nsIServiceManager.idl
index dd613070e9..e327b49d79 100644
--- a/xpcom/components/nsIServiceManager.idl
+++ b/xpcom/components/nsIServiceManager.idl
@@ -59,9 +59,6 @@ interface nsIServiceManager : nsISupports
%{C++
-// Observing xpcom autoregistration. Topics will be 'start' and 'stop'.
-#define NS_XPCOM_AUTOREGISTRATION_OBSERVER_ID "xpcom-autoregistration"
-
#ifdef MOZILLA_INTERNAL_API
#include "nsXPCOM.h"
#include "nsComponentManagerUtils.h"