Bug 1642415 - Add metasource to L10nFileSourceDescriptor; r=platform-i18n-reviewers,gregtatum
authorDan Minor <dminor@mozilla.com>
Wed, 22 Sep 2021 18:16:08 +0000
changeset 592957 e7f3e1f5b6253d91b5eeb60ac23a35cb12bafa5a
parent 592956 b1c1070d30b556a53ccf98627c7c5c95be47abf3
child 592958 890d147bad1d62d4c73b4283d6777e95ae265eed
push id38815
push userccozmuta@mozilla.com
push dateWed, 22 Sep 2021 21:53:01 +0000
treeherdermozilla-central@e7f3e1f5b625 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersplatform-i18n-reviewers, gregtatum
bugs1642415
milestone94.0a1
first release with
nightly linux32
e7f3e1f5b625 / 94.0a1 / 20210922215301 / files
nightly linux64
e7f3e1f5b625 / 94.0a1 / 20210922215301 / files
nightly mac
e7f3e1f5b625 / 94.0a1 / 20210922215301 / files
nightly win32
e7f3e1f5b625 / 94.0a1 / 20210922215301 / files
nightly win64
e7f3e1f5b625 / 94.0a1 / 20210922215301 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1642415 - Add metasource to L10nFileSourceDescriptor; r=platform-i18n-reviewers,gregtatum Differential Revision: https://phabricator.services.mozilla.com/D125242
dom/ipc/PContent.ipdl
intl/l10n/L10nRegistry.cpp
intl/l10n/rust/l10nregistry-ffi/src/registry.rs
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -326,16 +326,17 @@ struct GMPCapabilityData
 {
     nsCString name;
     nsCString version;
     GMPAPITags[] capabilities;
 };
 
 struct L10nFileSourceDescriptor {
   nsCString name;
+  nsCString metasource;
   nsCString[] locales;
   nsCString prePath;
   nsCString[] index;
 };
 
 struct XPCOMInitData
 {
     bool isOffline;
--- a/intl/l10n/L10nRegistry.cpp
+++ b/intl/l10n/L10nRegistry.cpp
@@ -238,16 +238,17 @@ already_AddRefed<FluentBundleAsyncIterat
 void L10nRegistry::GetParentProcessFileSourceDescriptors(
     nsTArray<L10nFileSourceDescriptor>& aRetVal) {
   MOZ_ASSERT(XRE_IsParentProcess());
   nsTArray<ffi::L10nFileSourceDescriptor> sources;
   ffi::l10nregistry_get_parent_process_sources(&sources);
   for (const auto& source : sources) {
     auto descriptor = aRetVal.AppendElement();
     descriptor->name() = source.name;
+    descriptor->metasource() = source.metasource;
     descriptor->locales().AppendElements(std::move(source.locales));
     descriptor->prePath() = source.pre_path;
     descriptor->index().AppendElements(std::move(source.index));
   }
 }
 
 /* static */
 void L10nRegistry::RegisterFileSourcesFromParentProcess(
@@ -260,16 +261,17 @@ void L10nRegistry::RegisterFileSourcesFr
   //
   // L10nRegistry is lightweight and performs no operations, so
   // we believe this behavior to be acceptable.
   MOZ_ASSERT(XRE_IsContentProcess());
   nsTArray<ffi::L10nFileSourceDescriptor> sources;
   for (const auto& desc : aDescriptors) {
     auto source = sources.AppendElement();
     source->name = desc.name();
+    source->metasource = desc.metasource();
     source->locales.AppendElements(desc.locales());
     source->pre_path = desc.prePath();
     source->index.AppendElements(desc.index());
   }
   ffi::l10nregistry_register_parent_process_sources(&sources);
 }
 
 /* static */
--- a/intl/l10n/rust/l10nregistry-ffi/src/registry.rs
+++ b/intl/l10n/rust/l10nregistry-ffi/src/registry.rs
@@ -80,16 +80,17 @@ impl<V> GeckoReportError<V, L10nRegistry
         self
     }
 }
 
 #[derive(Debug)]
 #[repr(C)]
 pub struct L10nFileSourceDescriptor {
     name: nsCString,
+    metasource: nsCString,
     locales: ThinVec<nsCString>,
     pre_path: nsCString,
     index: ThinVec<nsCString>,
 }
 
 fn get_l10n_registry_category_entries() -> Vec<crate::xpcom_utils::CategoryEntry> {
     crate::xpcom_utils::get_category_entries(&nsCString::from("l10n-registry")).unwrap_or_default()
 }
@@ -196,16 +197,17 @@ pub unsafe extern "C" fn l10nregistry_ge
     //
     // This is architecturally imperfect, but acceptable for simplicity reasons because
     // `L10nRegistry` instance is cheap and mainly servers as a store of state.
     let reg = get_l10n_registry();
     for name in reg.get_source_names().unwrap() {
         let source = reg.get_source(&name).unwrap().unwrap();
         let descriptor = L10nFileSourceDescriptor {
             name: source.name.as_str().into(),
+            metasource: source.metasource.as_str().into(),
             locales: source
                 .locales()
                 .iter()
                 .map(|l| l.to_string().into())
                 .collect(),
             pre_path: source.pre_path.as_str().into(),
             index: source
                 .get_index()