Граф коммитов

5612 Коммитов

Автор SHA1 Сообщение Дата
Greg Tatum 0f321c2172 Bug 1773733 - Remove some commented out code in l10n-registry; r=nordzilla
Depends on D159715

Differential Revision: https://phabricator.services.mozilla.com/D159716
2022-10-19 21:17:33 +00:00
Greg Tatum 4299b58786 Bug 1773733 - Add a README.md for l10nregistry-rs; r=nordzilla
Depends on D159714

Differential Revision: https://phabricator.services.mozilla.com/D159715
2022-10-19 21:17:32 +00:00
Greg Tatum caa67f36e3 Bug 1773733 - Add a fuzzing test for the l10nregistry; r=nordzilla
Depends on D159446

Differential Revision: https://phabricator.services.mozilla.com/D159714
2022-10-19 21:17:32 +00:00
Greg Tatum f0ed9daad0 Bug 1773733 - Remove locking and add a MetaSources struct; r=nordzilla
I believe the crashes are due to the metasources list being mutated
while the async iterators are running. This changes should fix this
issue if it is in fact the root cause. The scope of this patch is a bit
larger since it changes the implementation to use a proper MetaSources
struct.

This struct centralizes access and mutation to the MetaSources,
providing an ergonomic API that should be fairly idiomatic and similar
to other Rust APIs.

The Mutex is not needed as this code is not multi-threaded. The RefCell
should provide proper access controls for handling the mutation of the
MetaSources.

The MetaSources struct also favors a Vec<Vec<Rc<T>>> rather than
Vec<Vec<T>> so that it can be copied very cheaply for the async
iterators.

Differential Revision: https://phabricator.services.mozilla.com/D159446
2022-10-19 21:17:32 +00:00
Greg Tatum e055b8e94a Bug 1773733 - Add a bit more documentation to various pieces of the L10nRegistry; r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D159445
2022-10-19 21:17:31 +00:00
Greg Tatum 1a8e733b51 Bug 1773733 - Rename L10nRegistry methods to be consistent and idiomatic; r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D159444
2022-10-19 21:17:31 +00:00
Greg Tatum 79cc2c219c Bug 1773733 - Re-work and document the L10nRegistry bundle algorithm; r=nordzilla
This is probably the riskiest patch in the group, as it's touching the
core async iterator algorithm. The previous implementation relied on
pure match branches for handling things, but it made it awkward to share
some of the logic with a macro. I kept on running into issues with
refactoring tools not being able to work on the macro.

The changes here makes the code a bit more imperative, but I added
documentation of the current state that thing are in, so that it's
clearer where we were in the process of the algorithm.

This is a pure refactor and should not have any behavior changes.

Differential Revision: https://phabricator.services.mozilla.com/D159443
2022-10-19 21:17:30 +00:00
Greg Tatum 6c32be54a6 Bug 1773733 - Remove the bundle_adapter from the L10nRegistryLocked; r=nordzilla
This is a bit of chore work, as the upcoming MetaSources struct will not
need access to this member, and it's simpler without it.

Differential Revision: https://phabricator.services.mozilla.com/D159442
2022-10-19 21:17:30 +00:00
Greg Tatum 8dc7797215 Bug 1773733 - Fill in reasons for unreachable panics; r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D159441
2022-10-19 21:17:29 +00:00
Greg Tatum 6b697478cc Bug 1773733 - Rename generate_sources_for_file to get_sources_for_resource; r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D159440
2022-10-19 21:17:29 +00:00
Greg Tatum 22a6e7c007 Bug 1773733 - Mark test-only methods as cfg(test); r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D159439
2022-10-19 21:17:29 +00:00
Greg Tatum 75cddf17e6 Bug 1773733 - Rename get_source to file_source_by_name; r=nordzilla
Depends on D159437

Differential Revision: https://phabricator.services.mozilla.com/D159438
2022-10-19 21:17:28 +00:00
Greg Tatum f5418b7733 Bug 1773733 - Rename set_adapt_bundle to set_bundle_adapter; r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D159437
2022-10-19 21:17:28 +00:00
Mark Banner 2ffde1e92f Bug 1792341 - Migrate more toolkit/modules consumers to use direct ES module import. r=Gijs,webdriver-reviewers,perftest-reviewers,necko-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,sgalich,owlish,bytesized,AlexandruIonescu,whimboo,mconley,mixedpuppy
Mainly automated changes. Some manual ESLint fixes and whitespace cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D158452
2022-10-18 11:21:26 +00:00
Andrew McCreight 566e2d6cec Bug 1792920, part 1 - Remove the unused return values for various Rust AddRef and Release methods. r=necko-reviewers,platform-i18n-reviewers,gregtatum,valentin
Rust's definition of nsrefcnt is incorrect, so I'm eliminating uses of it
where possible. Nobody actually uses these return values, so remove them.

Differential Revision: https://phabricator.services.mozilla.com/D159320
2022-10-17 16:09:20 +00:00
Sean Burke be3eb81a13 Bug 1790071 - work around ICU-22132. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D157023
2022-10-06 18:50:51 +00:00
Andrew McCreight 2da84b8ac4 Bug 1792574, part 3 - Don't include nsMemory where it isn't needed. r=xpcom-reviewers,necko-reviewers,valentin,nika
There are only 3 places where nsMemory.h is still needed (image/RasterImage.cpp,
gfx/thebes/gfxFT2FontList.cpp, and nsMemory.cpp). Remove the rest.

Differential Revision: https://phabricator.services.mozilla.com/D158213
2022-09-28 15:17:46 +00:00
Andrew McCreight e626a91a81 Bug 1792354, part 2 - Remove nsErrorService and nsIErrorService. r=xpcom-reviewers,necko-reviewers,nika,valentin
Nika pointed out that there are only two places that register
something, and only one place that uses it, so this entire module
can be turned into a couple of lines of a switch statement.

Differential Revision: https://phabricator.services.mozilla.com/D158132
2022-09-27 21:27:17 +00:00
Mark Banner a9ba6e830d Bug 1792398 - Enable ESLint rule 'strict' on mjs files as the directive is not necessary for modules. r=arai,pip-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158115
2022-09-26 21:47:50 +00:00
Marian-Vasile Laza 130adc5d9a Backed out changeset 0679274d6ed5 (bug 1792398) for causing bc failures on browser_sendQuery.js. CLOSED TREE 2022-09-26 22:53:00 +03:00
Mark Banner 3e99025d45 Bug 1792398 - Enable ESLint rule 'strict' on mjs files as the directive is not necessary for modules. r=arai,pip-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158115
2022-09-26 18:51:57 +00:00
Narcis Beleuzu 6c2d0d8cea Backed out changeset 849faf753208 (bug 1792398) for bc failures on browser_sendQuery.js . CLOSED TREE 2022-09-26 20:44:40 +03:00
Mark Banner 05dcda5a7f Bug 1792398 - Enable ESLint rule 'strict' on mjs files as the directive is not necessary for modules. r=arai,pip-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158115
2022-09-26 16:51:10 +00:00
Nika Layzell 0316dc51b9 Bug 1790614 - Part 2: Use {ASSERT,ENSURE}_NS_{SUCCEEEDED,FAILED} in gtests, r=ahal,necko-reviewers
These macros will produce better outputs when they fail than these existing
patterns using `ENSURE_TRUE(NS_SUCCEEDED(...))` or similar, so this is a bulk
rewrite of existing tests to use them.

It should also help with discoverability when people base their tests off of
other existing tests.

Differential Revision: https://phabricator.services.mozilla.com/D157214
2022-09-15 14:51:50 +00:00
Nika Layzell 3d9a6d0374 Bug 1789902 - Part 2: Use XPCOM static components instead of Services in Rust, r=xpcom-reviewers,necko-reviewers,barret,valentin
Differential Revision: https://phabricator.services.mozilla.com/D156891
2022-09-13 13:47:13 +00:00
Mike Kaply 0ce6d5df0f Bug 1297520 - For Snap, only install language for system locale. r=nalexander,OlivierTilloy
Differential Revision: https://phabricator.services.mozilla.com/D151052
2022-09-12 18:41:56 +00:00
justchen1369 4743055749 Bug 1789765 - Fix broken links to 'Fluent for Firefox Developers' page. r=firefox-source-docs-reviewers,marco DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D156761
2022-09-08 19:03:25 +00:00
André Bargull eff8ea5f7f Bug 1752253: Change era skeleton to "GGG" to produce the expected era field length. r=platform-i18n-reviewers,gregtatum
This is actually exploiting an ICU bug, but ensures we return the same results
as other browsers. When the ICU bug has been fixed, we can revert this back to
"G".

Differential Revision: https://phabricator.services.mozilla.com/D156413
2022-09-08 06:05:55 +00:00
Mike Hommey 0e59ca6e3c Bug 1789524 - Use drop(Box::from_raw). r=platform-i18n-reviewers,dminor
As of rustc 1.64, Box::from_raw is #[must_use].

Differential Revision: https://phabricator.services.mozilla.com/D156617
2022-09-07 20:48:02 +00:00
Olli Pettay 93acdfad59 Bug 1777574, automate CC zone handling, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D155084
2022-09-07 11:22:51 +00:00
Masatoshi Kimura e7b3d513d4 Bug 1787633 - Make nsTextToSubURI::UnEscapeNonAsciiURI static. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D156007
2022-09-06 15:59:06 +00:00
Eemeli Aro 9e7ffeb5e0 Bug 1446164 - Migrate formautofill edit dialogs to Fluent. r=sgalich,fluent-reviewers,flod
Migrating the strings used by the edit dialogs also allows/requires for their migration elsewhere.

Some streamlining is applied to how autofillEditForms.js gets access to e.g. FormFillUtils methods, so that they are no longer routed via the XHTML files' script tags. The prior independence of this file from internal dependencies appears to have been in place to support its use as a part of the Payments API's UI, but that was dropped in bug 1721229.

The Fluent migration script included in this patch also covers changes from the immediately preceding patch.

The intl documentation change is a typo correction that was noticed while working on this patch.

Differential Revision: https://phabricator.services.mozilla.com/D155705
2022-09-01 20:35:37 +00:00
Norisz Fay e1a0b90205 Backed out 2 changesets (bug 1786708, bug 1446164) for causing multiple failures CLOSED TREE
Backed out changeset 469e2500f00e (bug 1446164)
Backed out changeset 0d298c6f7475 (bug 1786708)
2022-09-01 15:34:56 +03:00
Eemeli Aro 5475c4b139 Bug 1446164 - Migrate formautofill edit dialogs to Fluent. r=sgalich,fluent-reviewers,flod
Migrating the strings used by the edit dialogs also allows/requires for their migration elsewhere.

Some streamlining is applied to how autofillEditForms.js gets access to e.g. FormFillUtils methods, so that they are no longer routed via the XHTML files' script tags. The prior independence of this file from internal dependencies appears to have been in place to support its use as a part of the Payments API's UI, but that was dropped in bug 1721229.

The Fluent migration script included in this patch also covers changes from the immediately preceding patch.

The intl documentation change is a typo correction that was noticed while working on this patch.

Depends on D155478

Differential Revision: https://phabricator.services.mozilla.com/D155705
2022-09-01 08:26:47 +00:00
Bobby Holley f7234adda2 Bug 1787306 - Upgrade serial_test to 0.6 to leverage Embark's audit. r=supply-chain-reviewers,nika
This unfortunately pulls in rustversion but it was easy enough to audit.

Differential Revision: https://phabricator.services.mozilla.com/D155641
2022-08-26 04:06:55 +00:00
criss 055a8632de Backed out 6 changesets (bug 1787306) for causing Toolchains bustages. CLOSED TREE
Backed out changeset bcee96aa7df1 (bug 1787306)
Backed out changeset b5be37b86b21 (bug 1787306)
Backed out changeset 7e518de15dbb (bug 1787306)
Backed out changeset 07d938340e27 (bug 1787306)
Backed out changeset 9b8971442df5 (bug 1787306)
Backed out changeset 4d719c2b2711 (bug 1787306)
2022-08-26 02:25:46 +03:00
Bobby Holley 34fe6c3121 Bug 1787306 - Upgrade serial_test to 0.6 to leverage Embark's audit. r=supply-chain-reviewers,nika
This unfortunately pulls in rustversion but it was easy enough to audit.

Differential Revision: https://phabricator.services.mozilla.com/D155641
2022-08-25 23:05:41 +00:00
samronning f832ff9ad3 Bug 1786402 - Fix ESLint rule warnings for no-unused-vars in intl/uconv/tests/unit/test_bug340714.js r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D155290
2022-08-25 08:28:17 +00:00
Ed Lee 96460bcff8 Bug 1784901 - Show Language Mismatch Screen with negotiated language on left secondary section and switch button r=pdahiya
As part of installing the lang pack, add the negotiated language as string args and convert to raw if it wants to use the lang pack.

Differential Revision: https://phabricator.services.mozilla.com/D155021
2022-08-19 22:07:10 +00:00
André Bargull 52aed99c43 Bug 1786025: Update time zone data to tzdata2022b. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D155068
2022-08-19 17:14:03 +00:00
Nika Layzell 4011409c5d Bug 1783282 - Use a custom attribute instead of derive for implementing xpcom interfaces in rust, r=xpcom-reviewers,necko-reviewers,dragana,barret
Differential Revision: https://phabricator.services.mozilla.com/D153801
2022-08-18 13:57:35 +00:00
Eemeli Aro d831257098 Bug 1771917 - Add FormatMessagesSync C++ Localization gtests. r=nordzilla,emilio
Differential Revision: https://phabricator.services.mozilla.com/D154379
2022-08-16 17:46:53 +00:00
Andi-Bogdan Postelnicu 5981839b9a Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio
Updated with rustfmt 1.5.1-stable (4b91a6e 2022-08-08)
# ignore-this-changeset

Depends on D154661

Differential Revision: https://phabricator.services.mozilla.com/D154662
2022-08-16 07:08:28 +00:00
Mark Banner 53b35796e0 Bug 1784699 - Add more ESLint worker annotations to test files. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D154601
2022-08-15 16:50:31 +00:00
André Bargull 8c3a6dad95 Bug 1784375: Call LocaleParser::TryParse() with a new, empty Locale. r=platform-i18n-reviewers,dminor
For this to work, we need to add a move-constructor to `Locale`, so that it's
possible to write `loc = {}`. (We need move instead of copy semantics, because
`Locale` has UniquePtr members.) All other `Locale` members except for
`LanguageTagSubtag` already support move semantics. Add copy-constructors to
`LanguageTagSubtag`, so defaulted move-constructor/assignment works for `Locale`.
`LanguageTagSubtag` gets copy- instead of move-constructors, because there isn't
a good reason to disallow copying when moving is allowed.

Also add extra assertions and comments to document the requirement that `TryParse`
expects a new, empty `Locale`.

Differential Revision: https://phabricator.services.mozilla.com/D154496
2022-08-15 15:37:20 +00:00
Nika Layzell aef919f890 Bug 1170668 - Improve short read handling in nsConverterInputStream, r=hsivonen
This patch changes how nsConverterInputStream handles passing data
through to the underlying unicode converter in order to make it more
reliably handle propagating errors and deal with short reads from the
underlying input stream.

This was done by making the code continuously read within the Fill
method until at least one character has been decoded from the input
stream, so that we don't spuriously communicate an EOF to the caller due
to a short read not producing enough bytes for the decoder to produce a
UTF-16 character.

In addition, while making this change it became easier to signal to
the decoder about the final read from the input stream, meaning that
partial characters at the end of the stream will now generate a
replacement character, rather than being ignored.

Differential Revision: https://phabricator.services.mozilla.com/D152682
2022-08-11 17:37:20 +00:00
Norisz Fay 948922a968 Backed out changeset 2c6bb36b0667 (bug 1170668) for causing build bustages on TestShortRead.cpp CLOSED TREE 2022-08-11 00:01:03 +03:00
Nika Layzell 1972b3b710 Bug 1170668 - Improve short read handling in nsConverterInputStream, r=hsivonen
This patch changes how nsConverterInputStream handles passing data
through to the underlying unicode converter in order to make it more
reliably handle propagating errors and deal with short reads from the
underlying input stream.

This was done by making the code continuously read within the Fill
method until at least one character has been decoded from the input
stream, so that we don't spuriously communicate an EOF to the caller due
to a short read not producing enough bytes for the decoder to produce a
UTF-16 character.

In addition, while making this change it became easier to signal to
the decoder about the final read from the input stream, meaning that
partial characters at the end of the stream will now generate a
replacement character, rather than being ignored.

Differential Revision: https://phabricator.services.mozilla.com/D152682
2022-08-10 19:44:41 +00:00
Mark Banner 7428be4a86 Bug 1782008 - Remove now unnecessary .eslintrc.js files. r=webcompat-reviewers,extension-reviewers,media-playback-reviewers,pip-reviewers,denschub,rpl,alwu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D152736
2022-08-03 11:16:20 +00:00
Nika Layzell c15823d075 Bug 1772006 - Part 5: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-07-30 00:12:48 +00:00