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

953 Коммитов

Автор SHA1 Сообщение Дата
Diego E. Moreno 2b51bcabcc Bug 1805100 - Remove "else if" after interruptions of control flow. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D164467
2022-12-13 09:12:55 +00:00
Nika Layzell 1f06e7ba7b Bug 1793463 - Part 6: Remove nsIProtocolHandler.{defaultPort,protocolFlags}, r=necko-reviewers,valentin
This removes all implementations of these types. Some implementations in JS
code were also removed in the previous part, when updating tests to use
`Services.io.registerProtocolHandler`.

Code which used to access these members should go through the IOService now
instead.

Differential Revision: https://phabricator.services.mozilla.com/D162805
2022-12-01 15:43:19 +00:00
Nika Layzell 98304d1200 Bug 1793463 - Part 5: Stop using contractids to fetch protocol handlers, r=necko-reviewers,xpcom-reviewers,webdriver-reviewers,whimboo,valentin,kmag
This patch replaces the previous ContractID-based lookup system for protocol
handlers, and replaces it with a new custom system in nsIOService. It will be
pre-populated with non-overridable static protocol handlers using the
StaticComponents infrastructure added in the previous part, and callers can
also dynamically register new protocol handlers at runtime.

This new system is intended to provide access to the default port and
non-dynamic protocol flags off-main-thread, by requiring these values to be
provided up-front as constants, rather than getting them from the xpcom
interface. The data is then guarded by an RWLock.

Callers which look up specific handlers by their contractID are not changed, as
the contract IDs for existing handlers have not been changed, so the lookup
will still succeed.

This change as-implemented breaks the nsGIOProtocolHandler on Linux, as it
removes the special code which would try to use that handler for some
protocols. This will be fixed in a later part by making the
nsGIOProtocolHandler use the dynamic registration APIs to register and
un-register protocol handlers at runtime in response to the GIO pref.

Differential Revision: https://phabricator.services.mozilla.com/D162804
2022-12-01 15:43:19 +00:00
Marian-Vasile Laza 7492025127 Backed out 7 changesets (bug 1793463) for causing bustages on nsIOService.cpp. CLOSED TREE
Backed out changeset 47c3acb30de2 (bug 1793463)
Backed out changeset 71afe900eb17 (bug 1793463)
Backed out changeset d168599a269e (bug 1793463)
Backed out changeset d0f18d300818 (bug 1793463)
Backed out changeset a116e6f089f2 (bug 1793463)
Backed out changeset eba1123c8b56 (bug 1793463)
Backed out changeset 68a3eb8a3057 (bug 1793463)
2022-12-01 02:30:02 +02:00
Nika Layzell 20db36cecb Bug 1793463 - Part 6: Remove nsIProtocolHandler.{defaultPort,protocolFlags}, r=necko-reviewers,valentin
This removes all implementations of these types. Some implementations in JS
code were also removed in the previous part, when updating tests to use
`Services.io.registerProtocolHandler`.

Code which used to access these members should go through the IOService now
instead.

Differential Revision: https://phabricator.services.mozilla.com/D162805
2022-11-30 18:13:43 +00:00
Nika Layzell 9cc8ee8c01 Bug 1793463 - Part 5: Stop using contractids to fetch protocol handlers, r=necko-reviewers,xpcom-reviewers,webdriver-reviewers,whimboo,valentin,kmag
This patch replaces the previous ContractID-based lookup system for protocol
handlers, and replaces it with a new custom system in nsIOService. It will be
pre-populated with non-overridable static protocol handlers using the
StaticComponents infrastructure added in the previous part, and callers can
also dynamically register new protocol handlers at runtime.

This new system is intended to provide access to the default port and
non-dynamic protocol flags off-main-thread, by requiring these values to be
provided up-front as constants, rather than getting them from the xpcom
interface. The data is then guarded by an RWLock.

Callers which look up specific handlers by their contractID are not changed, as
the contract IDs for existing handlers have not been changed, so the lookup
will still succeed.

This change as-implemented breaks the nsGIOProtocolHandler on Linux, as it
removes the special code which would try to use that handler for some
protocols. This will be fixed in a later part by making the
nsGIOProtocolHandler use the dynamic registration APIs to register and
un-register protocol handlers at runtime in response to the GIO pref.

Differential Revision: https://phabricator.services.mozilla.com/D162804
2022-11-30 18:13:43 +00:00
Mark Banner ec76a72706 Bug 1799314 - Convert consumers of testing modules to import ES modules direct (miscellaneous). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D161917
2022-11-17 12:00:32 +00:00
Sean Feng 94b145368c Bug 1783497 - Don't throw if chrome URL canonicalization fails r=smaug
Looks like this is not needed and making a web-compat issue.

Differential Revision: https://phabricator.services.mozilla.com/D156985
2022-10-24 15:21:29 +00:00
Narcis Beleuzu d32bd5b832 Backed out 3 changesets (bug 1783497) for wpt failure on protocol.https.html . CLOSED TREE
Backed out changeset 0a2510ef7585 (bug 1783497)
Backed out changeset c92b392a186f (bug 1783497)
Backed out changeset 36d1dfe3d6c9 (bug 1783497)
2022-10-19 18:27:35 +03:00
Sean Feng d12fa12911 Bug 1783497 - Don't throw if chrome URL canonicalization fails r=smaug
Looks like this is not needed and making a web-compat issue.

Differential Revision: https://phabricator.services.mozilla.com/D156985
2022-10-19 13:30:59 +00:00
Noemi Erli ddc4439c1b Backed out 2 changesets (bug 1783497) for causing failures in test_displayOrigin.js CLOSED TREE
Backed out changeset 0200c81aa87f (bug 1783497)
Backed out changeset 4da944d66d96 (bug 1783497)
2022-10-18 01:45:49 +03:00
Sean Feng 8a103bff23 Bug 1783497 - Don't throw if chrome URL canonicalization fails r=smaug
Looks like this is not needed and making a web-compat issue.

Differential Revision: https://phabricator.services.mozilla.com/D156985
2022-10-17 17:33:19 +00:00
Nika Layzell f6ee20b0fd Bug 1783240 - Part 1: Remove unnecessary `Log` methods from ParamTraits impls, r=ipc-reviewers,necko-reviewers,media-playback-reviewers,mccr8,alwu
These aren't used anywhere, so can be removed, simplifying some things.

Differential Revision: https://phabricator.services.mozilla.com/D153802
2022-09-28 19:25:12 +00:00
Jens Stutte 8e845bcd74 Bug 1791350 - Replace C++ uses of Services.startup.shuttingDown with appropriate AppShutdown::IsInOrBeyond. r=florian
Differential Revision: https://phabricator.services.mozilla.com/D157628
2022-09-20 05:59:26 +00:00
criss 0dc25f7d29 Backed out changeset 09fd858a96c9 (bug 1783497) for causing Xpcshell failures on test_ext_cookies_partitionKey.js 2022-09-12 21:11:43 +03:00
Sean Feng 57df7f88fd Bug 1783497 - Don't throw if chrome URL canonicalization fails r=smaug
Looks like this is not needed and making a web-compat issue.

Differential Revision: https://phabricator.services.mozilla.com/D156985
2022-09-12 17:00:52 +00:00
Emilio Cobos Álvarez 42b7f1a58c Bug 1780788 - Use abstract strings as in-arguments for ipdl. r=nika,necko-reviewers,media-playback-reviewers,alwu,dragana
This prevents copies and avoids the hack we have to avoid this, which
right now is using nsDependent{C,}String.

Non-virtual actors can still use `nsString` if they need to on the
receiving end.

Differential Revision: https://phabricator.services.mozilla.com/D152519
2022-07-25 20:19:48 +00:00
Tooru Fujisawa bf93d07148 Bug 1667455 - Part 5: Stop importing Services.jsm from chrome-priv JS code, top-level single-line cases. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,extension-reviewers,application-update-reviewers,pip-reviewers,twisniewski,m_kato,jdescottes,mconley,AlexandruIonescu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D150894
2022-07-11 12:41:50 +00:00
Andrew McCreight c8c5c819df Bug 1514936, part 1 - Remove the outer argument to nsIFactory::createInstance. r=xpcom-reviewers,preferences-reviewers,nika,Gijs
This patch won't actually build, because a few bits of code are used
for both nsIFactory::createInstance and static components, and static
components are not fixed until the next patch.

The first place is nsLoadGroupConstructor, which uses an nsIFactory
macro to create a static component constructor. (This could be worked
around by expanding the macro to the state before this patch.)

The other issue is that nsAppShellConstructor is used in an nsIFactory
on OSX, but as a static component on all other platforms. This could
be worked around by wrapping nsAppShellConstructor in an adaptor that
passes in the extra null argument to nsAppShellConstructor.

Differential Revision: https://phabricator.services.mozilla.com/D146456
2022-05-17 20:24:19 +00:00
Karnik Kanojia fd15cc3599 Bug 1763000 - Fix ESLint rule warnings for no-unused-vars in caps/tests/unit/test_no_remote_registration.js. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D142899
2022-04-05 20:39:36 +00:00
Mark Banner 8bb4667fae Bug 1758474 - Implement an ESLint rule to disallow passing {} as the target parameter for ChromeUtils.import. r=Gijs,mossop,perftest-reviewers,preferences-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D140517
2022-03-11 16:41:29 +00:00
smolnar e89faa903f Backed out changeset 5018856d8fee (bug 1758474) for causing node eslint failure. CLOSED TREE 2022-03-10 11:58:45 +02:00
Mark Banner fe937b78bd Bug 1758474 - Implement an ESLint rule to disallow passing {} as the target parameter for ChromeUtils.import. r=Gijs,mossop,perftest-reviewers,preferences-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D140517
2022-03-10 09:25:28 +00:00
Nika Layzell 05dc5e0d76 Bug 1754037 - Part 3c: Automatically update all ParamTraits implementations, r=ipc-reviewers,media-playback-reviewers,bryce,mccr8
Automatically generated rewrites of all ParamTraits and IPDLParamTraits
implementations in-tree to use IPC::Message{Reader,Writer}.

Differential Revision: https://phabricator.services.mozilla.com/D140004
2022-03-04 15:39:41 +00:00
Mike Hommey fce6eb7d83 Bug 1747165 - Replace TK_FLAGS/TK_LIBS with MOZ_GTK3_FLAGS/MOZ_GTK3_LIBS. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D134464
2021-12-23 20:29:07 +00:00
Cristian Tuns e1e31e01f2 Backed out 2 changesets (bug 1747165) for causing nightly blockers(bustages) a=backout
Backed out changeset 4b1ab0915c94 (bug 1747165)
Backed out changeset 96043d814772 (bug 1747165)
2021-12-23 08:00:54 -05:00
Mike Hommey b55194a16f Bug 1747165 - Replace TK_FLAGS/TK_LIBS with MOZ_GTK3_FLAGS/MOZ_GTK3_LIBS. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D134464
2021-12-22 23:56:24 +00:00
Mark Banner f7ee253451 Bug 1734823 - Enable ESLint rule no-unused-vars globally for xpcshell test*.js files. r=necko-reviewers,Gijs,valentin
This enables it as a warning for all files, and as an error for some files.

Differential Revision: https://phabricator.services.mozilla.com/D127944
2021-10-11 11:07:02 +00:00
Mark Banner 11bfa90d06 Bug 1602940 - Automated replacements to use Services.uuid. r=Gijs,necko-reviewers,preferences-reviewers,kershaw
Depends on D124391

Differential Revision: https://phabricator.services.mozilla.com/D124392
2021-09-06 09:53:52 +00:00
Andi-Bogdan Postelnicu 2fc4f70e9b Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium
Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
when the module governed by the build config file is not buildable outside on the unified environment.

This needs to be done in order to have a hybrid build system that adds the possibility of combing
unified build components with ones that are built outside of the unified eco system.

Differential Revision: https://phabricator.services.mozilla.com/D122345
2021-08-25 10:46:17 +00:00
Valentin Gosu 57e3894d7d Bug 1722925 - Avoid unnecessary string copies by nsCString constructor r=necko-reviewers,kershaw CLOSED TREE
Since the Find method does not exist on nsACString, I had to use std::search
to find the "data:" substring in the spec.

Differential Revision: https://phabricator.services.mozilla.com/D122082
2021-08-12 07:40:58 +00:00
Valentin Gosu d97def2f41 Bug 1722925 - Remove NS_MutatorMethod in favor of templated nsIURIMutator::Apply r=necko-reviewers,kershaw
This basically reverts the changes in 5caa81103c00 (bug 1435671). In that bug
we switched from having a templated method to using a templated function
that returned a lambda because the templated method caused a binary size
regression on windows (MSVC). Since Firefox 67 we no longer support MSVC.
Using a lambda also required capturing the arguments by value, so it was
slightly inefficient.

This patch removes NS_MutatorMethod and makes the Apply method a template.
This improves perfomance as we can just pass the arguments to the called
function, without worrying about needing to copy them.
Since MSVC is not supported anymore, and clang and gcc didn't report a
binary size regression, this is a much better solution.

Differential Revision: https://phabricator.services.mozilla.com/D122081
2021-08-12 07:40:58 +00:00
Iulian Moraru 32090542c0 Backed out 2 changesets (bug 1722925) for causing reftest failures in color_quads. CLOSED TREE
Backed out changeset 95a6eacbef27 (bug 1722925)
Backed out changeset 2e2a98aeca5c (bug 1722925)
2021-08-12 12:22:34 +03:00
Valentin Gosu 32b251ca35 Bug 1722925 - Avoid unnecessary string copies by nsCString constructor r=necko-reviewers,kershaw
Since the Find method does not exist on nsACString, I had to use std::search
to find the "data:" substring in the spec.

Differential Revision: https://phabricator.services.mozilla.com/D122082
2021-08-12 07:40:58 +00:00
Valentin Gosu c6b1fa7e03 Bug 1722925 - Remove NS_MutatorMethod in favor of templated nsIURIMutator::Apply r=necko-reviewers,kershaw
This basically reverts the changes in 5caa81103c00 (bug 1435671). In that bug
we switched from having a templated method to using a templated function
that returned a lambda because the templated method caused a binary size
regression on windows (MSVC). Since Firefox 67 we no longer support MSVC.
Using a lambda also required capturing the arguments by value, so it was
slightly inefficient.

This patch removes NS_MutatorMethod and makes the Apply method a template.
This improves perfomance as we can just pass the arguments to the called
function, without worrying about needing to copy them.
Since MSVC is not supported anymore, and clang and gcc didn't report a
binary size regression, this is a much better solution.

Differential Revision: https://phabricator.services.mozilla.com/D122081
2021-08-12 07:40:58 +00:00
Simon Giesecke b9621d6376 Bug 1695162 - Use range-based for instead of custom hashtable iterators. r=xpcom-reviewers,kmag
Differential Revision: https://phabricator.services.mozilla.com/D108585
2021-03-17 15:49:46 +00:00
Simon Giesecke 9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Simon Giesecke c5f7800f35 Bug 1691913 - Rename nsClassHashtable::LookupOrAdd to GetOrInsertNew. r=xpcom-reviewers,nika
It should be called "Get" rather than "Lookup" because it returns
UserDataType. "Add" is called "Insert" in the other methods.

Differential Revision: https://phabricator.services.mozilla.com/D105470
2021-02-22 12:07:47 +00:00
Alexis Beingessner 3f1a425606 Bug 1686616 - make IO use Components instead of Services. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D105530
2021-02-18 13:26:32 +00:00
Simon Giesecke 661e25bf09 Bug 1692880 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D104850
2021-02-16 15:53:33 +00:00
smolnar 1afbbe67e1 Backed out 5 changesets (bug 1691894) for causing hazard failures in nsXULPrototypeCache. CLOSED TREE
Backed out changeset 22dc870ee609 (bug 1691894)
Backed out changeset 58c31e9d6ae3 (bug 1691894)
Backed out changeset 7483e84149d8 (bug 1691894)
Backed out changeset f977d6cfa973 (bug 1691894)
Backed out changeset db4503476f34 (bug 1691894)
2021-02-15 16:43:23 +02:00
Simon Giesecke 3c29a68440 Bug 1691894 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D104850
2021-02-15 10:04:46 +00:00
Mark Banner 263d555274 Bug 1608272 - Remove 'this' as the second argument to 'ChromeUtils.import', use object destructuring instead (test-only changes). r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D104683
2021-02-11 22:02:15 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Dan Minor 57441aa8cc Bug 1673054 - Migrate uses of intl.uidirection to intl.l10n.pseudo; r=Gijs,zbraniecki
This also removes pref overrides from methods like LocaleService::IsLocaleRTL or
IntlService.getLocaleInfo, because it doesn't really make sense to override the
result of checking an arbitrary locale, the relevant use case is overriding the
result for the current app locale.

Removal of the intl.uidirection pref completely will be done in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D96235
2020-11-09 15:33:39 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00