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

3777 Коммитов

Автор SHA1 Сообщение Дата
Andi-Bogdan Postelnicu eeac3728d2 Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium
Updated with clang-format version 14.0.5 (taskcluster-DydCt-ryTuKvBYw1HQOugw)
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D154661
2022-08-16 07:08:27 +00:00
Dan Robertson 27907e8f9a Bug 1771423 - Set Content-Type to an empty string for an empty blob with no type. r=kershaw,smaug,necko-reviewers
Set the Content-Type to an empty string for an blob when the type was not
given. Ensure that the channel Content-Type is not overriden in the case
that it was previously set and the blob type is not valid.

Depends on D147568

Differential Revision: https://phabricator.services.mozilla.com/D147481
2022-08-15 13:52:12 +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 effe5537b9 Bug 1772006 - Part 6: Simplify and move the find+replace methods from ns[T]StringObsolete, r=xpcom-reviewers,barret
The remaining methods in ns[T]StringObsolete are all find+replace methods for
nsTSubstring. These were migrated in a similar way to the find methods, and
partially updated to avoid using methods from nsStringObsolete.cpp.

This change removes the ns[T]StringObsolete.cpp files completely, as they are
no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D148301
2022-07-30 00:12:49 +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
Christian Holler caf94dc5d4 Bug 1780741 - Add init checks to ExternalHelperAppParent. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D152633
2022-07-29 13:47:22 +00:00
Tim Huang daef272528 Bug 1773702 - Adding Content Blocking Event flags for email tracking protection. r=dimi
This patch adds a new Content Blocking Eveent flag and modifies the
current email tracking event flag. This would allow us to log the
loading of email tracker in two levels. The level 1 email tracker
contains the base list of the email trackers, The level 2 email tracker
contains both base and content email trackers.

Differential Revision: https://phabricator.services.mozilla.com/D152679
2022-07-27 20:07:53 +00:00
Neil Deakin 5c6bb2989e Bug 1778429, use utf-16 character literals when calling ReplaceChar in SanitizeFileName, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D152669
2022-07-27 09:34:14 +00:00
Neil Deakin fca5ac1f23 Bug 1779128, rework filename sanitization to ensure that the extension is properly validated, r=Gijs
The existing code doesn't use the sanitized extension part of the filename, when it replaces the filename when it is too long but instead used a version passed to SanitizeFileName. This newer version always gets the extension from the filename after it has been validated.

Some tests have slightly different results, because the file is now cropped slightly differently when the character count and byte count of long filenames don't match, resulting in some filenames being cropped a few extra characters more than needed.

Differential Revision: https://phabricator.services.mozilla.com/D151826
2022-07-26 20:36:04 +00:00
Tooru Fujisawa a032f53a63 Bug 1780543 - Part 5: Add mozilla/chrome-script environment. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D152430
2022-07-26 02:46:30 +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
Tim Huang 86d982dc94 Bug 1773695 - Part 2: Add flags for the email tracking protections. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D151049
2022-07-18 21:48:15 +00:00
Shane Hughes d5fb4566c2 Bug 1739348 - Don't open downloads panel after download dialogs. r=NeilDeakin
This is a medium sized patch to legacy download construction. It takes
advantage of the new property added in Bug 1762033 to prevent the
downloads panel from being automatically shown when a download is added
after an interaction with the unknown content type dialog or the file
picker dialog. I chose to not do the same for failed transfers since I
thought it might serve some use, but that might be wrong. I don't know
if there's a way to test the dialog that appears when you download an
executable without going through the same path I adjusted with the
patch. It seems like it's covered but I could be wrong. Also add a test
to cover these changes from the bottom up. Thanks and apologies for my
sloppy C++, though I'm sure I'll learn a lot more from the review 😅

Differential Revision: https://phabricator.services.mozilla.com/D145312
2022-07-18 20:45:41 +00:00
smolnar 1888800945 Bug 1767358 - Fix lint failure in uriloader/exthandler/tests/unit/test_handlerService.js r=emilio 2022-07-18 15:52:22 +03:00
Emilio Cobos Álvarez 780d0666b4 Bug 1767358 - Change pref rather than environment in test_handlerService.
MANUAL PUSH: Trivial test fix CLOSED TREE
2022-07-18 14:20:18 +02:00
Emilio Cobos Álvarez 7c1ba7092c Bug 1767358 - Cache mime/mailcap file location. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D151919
2022-07-18 11:35:34 +00:00
Emilio Cobos Álvarez b3e37c1628 Bug 1767358 - Clean-up logging in uriloader/exthandler. r=Gijs
This allows logging in static functions. Also add missing includes.

Differential Revision: https://phabricator.services.mozilla.com/D151920
2022-07-18 10:07:02 +00:00
criss b77dc7a479 Backed out 6 changesets (bug 1773691, bug 1773695) for causing Bp-hybrid bustages on UrlClassifierFeatureEmailTrackingProtection
Backed out changeset f402f1bd4caa (bug 1773695)
Backed out changeset 001c38822c53 (bug 1773695)
Backed out changeset 8ef4d3597d92 (bug 1773695)
Backed out changeset f4770b2fe53d (bug 1773695)
Backed out changeset fb625ae08f73 (bug 1773695)
Backed out changeset 6c23adf9184f (bug 1773691)
2022-07-14 23:41:50 +03:00
Tim Huang 1ab8b37cce Bug 1773695 - Part 2: Add flags for the email tracking protections. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D151049
2022-07-14 19:39:32 +00:00
Tooru Fujisawa 54623364da Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-12 04:21:34 +00:00
Neil Deakin e8fd25621c Bug 1773907, don't clear the extension on the possible filename if we don't have one to replace it with, r=mhowell
The issue here is that ShouldModifyExtension returns Replace because the content type isn't known.

Differential Revision: https://phabricator.services.mozilla.com/D151427
2022-07-11 19:16:16 +00:00
Andreea Pavel 7738a75fdd Backed out 11 changesets (Bug 1777486) for failing bc at browser_startup.js on a CLOSED TREE
Backed out changeset b6c4c386f1a6 (Bug 1777486)
Backed out changeset 195cc2de8433 (Bug 1777486)
Backed out changeset 20c746fb1648 (Bug 1777486)
Backed out changeset d5fd8173d62d (Bug 1777486)
Backed out changeset 6d758fab5a3e (Bug 1777486)
Backed out changeset e938b601ba15 (Bug 1777486)
Backed out changeset 0c4ea0b9416b (Bug 1777486)
Backed out changeset 0559c53cc668 (Bug 1777486)
Backed out changeset eea573d3a9f9 (Bug 1777486)
Backed out changeset 9ce3a6496a49 (bug 1777486)
Backed out changeset b0867652fc48 (bug 1777486)
2022-07-11 22:24:40 +03:00
Tooru Fujisawa 8cd6ed7409 Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-11 15:09:13 +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
Tooru Fujisawa f3a8c52c53 Bug 1667455 - Part 4: Stop importing Services.jsm from JSM. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,application-update-reviewers,pip-reviewers,twisniewski,devtools-reviewers,m_kato,jdescottes,ochameau,mconley,sfoster,AlexandruIonescu
Differential Revision: https://phabricator.services.mozilla.com/D150893
2022-07-11 12:41:50 +00:00
Neil Deakin 307cdb4029 Bug 1773894, special-case some extensions when downloading them, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D150386
2022-07-07 18:51:09 +00:00
Barret Rennie 47beac2e67 Bug 1772742 - Port osfile.jsm usage to IOUtils in uriloader/ r=nika
Differential Revision: https://phabricator.services.mozilla.com/D148445
2022-06-30 04:33:05 +00:00
smolnar 3a496831ac Backed out 2 changesets (bug 1773186, bug 1772742) for causing mochitest failures in dom/system/tests/ioutils/test_ioutils_hashfile.html
Backed out changeset ef49b1ddf9f1 (bug 1772742)
Backed out changeset 8ec51be873d4 (bug 1773186)
2022-06-28 18:50:16 +03:00
Barret Rennie 5f02c4c24c Bug 1772742 - Port osfile.jsm usage to IOUtils in uriloader/ r=nika
Differential Revision: https://phabricator.services.mozilla.com/D148445
2022-06-28 15:03:46 +00:00
Neil Deakin 467752474e Bug 1772569, add a preference so that pdf files sent as attachments can be opened either inline or download, and default to downloaded, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D150198
2022-06-27 21:25:37 +00:00
Kris Maglione 289588883e Bug 1776207: Part 1 - Remove obsolete _xpcom_factory definitions. r=mccr8
They only work with `generateNSGetFactory` definitions, which don't exist
anymore.

Differential Revision: https://phabricator.services.mozilla.com/D150191
2022-06-27 21:19:51 +00:00
Andrew McCreight d9fb12e295 Bug 1776080 - Fix browser_save_filenames.js to work with parent controlled navigation. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D150051
2022-06-27 02:20:09 +00:00
Kris Maglione 23d4c575c6 Bug 1770237: Part 14 - Update URILoader parent handler service to use static component registration. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D148194
2022-06-22 20:31:36 +00:00
Mark Banner 47835addcf Bug 1774768 - Fix accesses of undefined constants on Services.perms in tests. r=Gijs
Depends on D149604

Differential Revision: https://phabricator.services.mozilla.com/D149605
2022-06-20 09:44:14 +00:00
Tom Schuster 059cd7d495 Bug 1773947 - Correctly set returned MIME type in GetMIMEInfoFromOS. r=haik,nika
Differential Revision: https://phabricator.services.mozilla.com/D149043
2022-06-20 08:20:17 +00:00
Dimi 9e6c641b2c Bug 1773043 - Remove flashblock from necko r=kershaw,necko-reviewers
Depends on D149130

Differential Revision: https://phabricator.services.mozilla.com/D149131
2022-06-15 12:55:26 +00:00
Manuel Bucher 14dd2f26fc Bug 1761242 - Expose computing security flags for early hint preloader r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D144798
2022-06-15 09:59:44 +00:00
criss c6b2c5db61 Backed out 9 changesets (bug 1772006) causing build bustages on nsTString.cpp. CLOSED TREE
Backed out changeset f17c7565707b (bug 1772006)
Backed out changeset c725fe1f5882 (bug 1772006)
Backed out changeset d19663161261 (bug 1772006)
Backed out changeset b6611ab002d9 (bug 1772006)
Backed out changeset 790f42b64af9 (bug 1772006)
Backed out changeset 79a734b4e4d9 (bug 1772006)
Backed out changeset 42730aae16ea (bug 1772006)
Backed out changeset b2542aef3054 (bug 1772006)
Backed out changeset 962bfea4a309 (bug 1772006)
2022-06-11 01:13:42 +03:00
Nika Layzell fbec8096a9 Bug 1772006 - Part 7: Simplify and move the find+replace methods from ns[T]StringObsolete, r=xpcom-reviewers,barret
The remaining methods in ns[T]StringObsolete are all find+replace methods for
nsTSubstring. These were migrated in a similar way to the find methods, and
partially updated to avoid using methods from nsStringObsolete.cpp.

This change removes the ns[T]StringObsolete.cpp files completely, as they are
no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D148301
2022-06-10 21:12:08 +00:00
Nika Layzell b3c13bf114 Bug 1772006 - Part 6: 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-06-10 21:12:08 +00:00
Cosmin Sabou 6f043ebd93 Backed out changeset b7ac1dc2e29e (bug 1739348) for causing frequent failures on browser_downloads_panel_opens.js. 2022-06-10 23:49:24 +03:00
Shane Hughes 755d60c20a Bug 1739348 - Don't open downloads panel after download dialogs. r=NeilDeakin
This is a medium sized patch to legacy download construction. It takes
advantage of the new property added in Bug 1762033 to prevent the
downloads panel from being automatically shown when a download is added
after an interaction with the unknown content type dialog or the file
picker dialog. I chose to not do the same for failed transfers since I
thought it might serve some use, but that might be wrong. I don't know
if there's a way to test the dialog that appears when you download an
executable without going through the same path I adjusted with the
patch. It seems like it's covered but I could be wrong. Also add a test
to cover these changes from the bottom up. Thanks and apologies for my
sloppy C++, though I'm sure I'll learn a lot more from the review 😅

Differential Revision: https://phabricator.services.mozilla.com/D145312
2022-06-10 17:31:27 +00:00
Mark Banner 8d5da1fba0 Bug 1771144 - Add mjs to the list of default mime entries. r=Gijs
Depends on D148755

Differential Revision: https://phabricator.services.mozilla.com/D148771
2022-06-09 13:02:15 +00:00
Molnar Sandor 1fc858a96d Backed out 5 changesets (bug 1761242, bug 1744822, bug 1761252) for causing browser-chrome failures in netwerk/test/browser/browser_103_assets.js CLOSED TREE
Backed out changeset 33cc08eb51b3 (bug 1744822)
Backed out changeset b70697d24e75 (bug 1761252)
Backed out changeset 4a5e10110c6a (bug 1761242)
Backed out changeset 7cda175b833d (bug 1761242)
Backed out changeset 4f5ed111093b (bug 1761242)
2022-06-08 18:56:35 +03:00
Manuel Bucher 35abf46688 Bug 1761242 - Expose computing security flags for early hint preloader r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D144798
2022-06-08 14:33:10 +00:00
Neil Deakin 1874a3841a Bug 1762868, handle pdfs inline that use the content type octet-stream when they have a pdf extension, r=mhowell
To do this we look at the extension on the content disposition filename, if present, or the extension
of the url, and, if it is .pdf, we assume that the file will be a pdf.

Differential Revision: https://phabricator.services.mozilla.com/D147409
2022-06-06 18:58:19 +00:00
Norisz Fay 17c58b1a9c Backed out changeset 5e08d0841b10 (bug 1739348) for causing browser-chrome failures on browser_pdfjs_download_button.js, browser_tempfilename.js 2022-06-03 00:09:47 +03:00
Shane Hughes f51ee80012 Bug 1739348 - Don't open downloads panel after download dialogs. r=NeilDeakin
This is a medium sized patch to legacy download construction. It takes
advantage of the new property added in Bug 1762033 to prevent the
downloads panel from being automatically shown when a download is added
after an interaction with the unknown content type dialog or the file
picker dialog. I chose to not do the same for failed transfers since I
thought it might serve some use, but that might be wrong. I don't know
if there's a way to test the dialog that appears when you download an
executable without going through the same path I adjusted with the
patch. It seems like it's covered but I could be wrong. Also add a test
to cover these changes from the bottom up. Thanks and apologies for my
sloppy C++, though I'm sure I'll learn a lot more from the review 😅

Differential Revision: https://phabricator.services.mozilla.com/D145312
2022-06-02 19:33:10 +00:00
Tooru Fujisawa 95dea67f22 Bug 1772107 - Use plain object for lazy getter in uriloader/exthandler/. r=smaug
Depends on D147893

Differential Revision: https://phabricator.services.mozilla.com/D147894
2022-06-01 21:29:36 +00:00
Calixte 93528759ed Bug 1766030 - Add an optional source URL when saving an URL. r=Gijs
In pdf.js, files are saved thanks to a blob but the original URL is lost.
Consequently, the download panel doesn't contain any information about the
origins of a saved pdf.
The saveURL, internalSave and nsITransfer.init functions has now a parameter for this originalURL.

Differential Revision: https://phabricator.services.mozilla.com/D147651
2022-05-31 17:25:29 +00:00