Commit Graph

499 Commits

Author SHA1 Message Date
Rob Wu
e520e9fd35 Bug 1903780 - Support directory names again in downloads.download r=geckoview-reviewers,NeilDeakin,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D218719
2024-08-20 18:53:21 +00:00
Sean
1b9454cdef Bug 1893313 - Leaks in nsMIMEHeaderParamImpl::DoParameterInternal() r=valentin,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D211607
2024-05-27 13:08:49 +00:00
Randell Jesup
22df14537c Bug 1871963: Implement zstd content-encoding support r=necko-reviewers,valentin,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D205109
2024-04-09 15:26:46 +00:00
Tamas Szentpeteri
1f27a4022f Backed out 3 changesets (bug 1871963) for causing dt failures on browser_net_copy_as_powershell.js. CLOSED TREE
Backed out changeset 94e286542c9d (bug 1871963)
Backed out changeset dc2ad0369b86 (bug 1871963)
Backed out changeset 9fb8ccb2f305 (bug 1871963)
2024-04-09 17:24:37 +03:00
Randell Jesup
b1ad40b8ee Bug 1871963: Implement zstd content-encoding support r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D205109
2024-04-09 12:31:56 +00:00
Michael Hughes
64fe1d816e Bug 1884785 - Expose the path to the os default application to privileged extensions r=Gijs,necko-reviewers
Added in some code to expose the path to the os default application. Tested via tests on Windows. Mac and Linux will use the nsMIMEInfoImpl which will supply the functionality for them and be tested with the auto-tests.

Differential Revision: https://phabricator.services.mozilla.com/D204306
2024-03-25 23:19:17 +00:00
Michael Hughes
e66ab7ac30 Bug 1884265 - Expose pretty ApplicationName from the registry to file handlers r=nrishel,nalexander,necko-reviewers,barret,valentin
Some code to exercise this in the browser console:

```
{
  const printNames = async (appList) => {
    let buffer = "Start:\n";

    for (let index = 0; index < appList4.length; index++) {
      let app = appList4.queryElementAt(index, Ci.nsILocalHandlerApp);
      buffer += app.executable.leafName;
      buffer += "\n";
    }

    buffer += "\n";

    for (let index = 0; index < appList4.length; index++) {
      let app = appList4.queryElementAt(index, Ci.nsILocalHandlerApp);
      let prettyName = await app.prettyNameAsync();
      buffer += prettyName;
      buffer += "\n";
    }

    buffer += "\n";

    for (let index = 0; index < appList4.length; index++) {
      let app = appList4.queryElementAt(index, Ci.nsILocalHandlerApp);
      buffer += app.executable.displayName;
      buffer += "\n";
    }

    buffer += "\n";

    for (let index = 0; index < appList4.length; index++) {
      let app = appList4.queryElementAt(index, Ci.nsILocalHandlerApp);
      if (AppConstants.platform == "win") {
      	let file = app.executable;
        if (file instanceof Ci.nsILocalFileWin) {
          try {
          	buffer += file.getVersionInfoField("FileDescription");
          } catch (e) {
          }
        }
      }
      buffer += "\n";
    }

    buffer += "\nEnd\n";

    console.log(buffer);
  };

  const lazy4 = {};

  XPCOMUtils.defineLazyServiceGetters(lazy4, {
    gMIMEService: ["@mozilla.org/mime;1", "nsIMIMEService"],
  });

  let mimeInfo4 = lazy4.gMIMEService.getFromTypeAndExtension("text/html", "html");

  if (mimeInfo4.hasDefaultHandler) {
    console.log(`HasDefaultHandler = true`);
    console.log(`Description = ${mimeInfo4.defaultDescription}`);
  } else {
    console.log(`HasDefaultHandler = false`);
  }

  let appList4 = mimeInfo4.possibleLocalHandlers || [];
  console.log("appList4 = ");
  console.log(JSON.stringify(appList4));

  printNames(appList4);
}
```

That produces output that can be seen in a pretty form here:
https://docs.google.com/spreadsheets/d/1OvtrZgMlPMJO4Wgu6wwAYvm89orj9HdS_tsDxYn7yrA/edit#gid=0

This does not fix-up things so that all calls to getName() on the LocalHandlerApp are switched to prettyNameAsync. That work is tracked here: https://bugzilla.mozilla.org/show_bug.cgi?id=1884267

Differential Revision: https://phabricator.services.mozilla.com/D203876
2024-03-25 23:19:17 +00:00
Ryan VanderMeulen
87a2b0ae6f Backed out changeset 102fa1186f2a (bug 1884265) for non-unified build bustage and test_getFromTypeAndExtension.js failures. 2024-03-18 21:55:00 -04:00
Michael Hughes
d4689a98d0 Bug 1884265 - Expose pretty ApplicationName from the registry to file handlers r=nalexander,necko-reviewers,barret,valentin
Some code to exercise this in the browser console:

```
{
  const printNames = async (appList) => {
    let buffer = "Start:\n";

    for (let index = 0; index < appList4.length; index++) {
      let app = appList4.queryElementAt(index, Ci.nsILocalHandlerApp);
      buffer += app.executable.leafName;
      buffer += "\n";
    }

    buffer += "\n";

    for (let index = 0; index < appList4.length; index++) {
      let app = appList4.queryElementAt(index, Ci.nsILocalHandlerApp);
      let prettyName = await app.prettyNameAsync();
      buffer += prettyName;
      buffer += "\n";
    }

    buffer += "\n";

    for (let index = 0; index < appList4.length; index++) {
      let app = appList4.queryElementAt(index, Ci.nsILocalHandlerApp);
      buffer += app.executable.displayName;
      buffer += "\n";
    }

    buffer += "\n";

    for (let index = 0; index < appList4.length; index++) {
      let app = appList4.queryElementAt(index, Ci.nsILocalHandlerApp);
      if (AppConstants.platform == "win") {
      	let file = app.executable;
        if (file instanceof Ci.nsILocalFileWin) {
          try {
          	buffer += file.getVersionInfoField("FileDescription");
          } catch (e) {
          }
        }
      }
      buffer += "\n";
    }

    buffer += "\nEnd\n";

    console.log(buffer);
  };

  const lazy4 = {};

  XPCOMUtils.defineLazyServiceGetters(lazy4, {
    gMIMEService: ["@mozilla.org/mime;1", "nsIMIMEService"],
  });

  let mimeInfo4 = lazy4.gMIMEService.getFromTypeAndExtension("text/html", "html");

  if (mimeInfo4.hasDefaultHandler) {
    console.log(`HasDefaultHandler = true`);
    console.log(`Description = ${mimeInfo4.defaultDescription}`);
  } else {
    console.log(`HasDefaultHandler = false`);
  }

  let appList4 = mimeInfo4.possibleLocalHandlers || [];
  console.log("appList4 = ");
  console.log(JSON.stringify(appList4));

  printNames(appList4);
}
```

That produces output that can be seen in a pretty form here:
https://docs.google.com/spreadsheets/d/1OvtrZgMlPMJO4Wgu6wwAYvm89orj9HdS_tsDxYn7yrA/edit#gid=0

This does not fix-up things so that all calls to getName() on the LocalHandlerApp are switched to prettyNameAsync. That work is tracked here: https://bugzilla.mozilla.org/show_bug.cgi?id=1884267

Differential Revision: https://phabricator.services.mozilla.com/D203876
2024-03-18 16:18:27 +00:00
Cristian Tuns
cc0efecf5c Backed out 3 changesets (bug 1884785, bug 1884265) for causing build bustages in nsLocalHandlerApp.cpp CLOSED TREE
Backed out changeset 08cb16bededc (bug 1884265)
Backed out changeset dc60eabb35ec (bug 1884785)
Backed out changeset 2de1412ec7e3 (bug 1884265)
2024-03-13 13:43:40 -04:00
Michael Hughes
444d0ac965 Bug 1884785 - Expose the path to the os default application to privileged extensions r=Gijs,necko-reviewers
Added in some code to expose the path to the os default application. Tested via tests on Windows. Mac and Linux will use the nsMIMEInfoImpl which will supply the functionality for them and be tested with the auto-tests.

Differential Revision: https://phabricator.services.mozilla.com/D204306
2024-03-13 16:24:50 +00:00
Michael Hughes
826b0f1e77 Bug 1884265 - Expose pretty ApplicationName from the registry to file handlers r=nalexander,necko-reviewers,barret,valentin
Some code to exercise this in the browser console:

```
{
  const printNames = async (appList) => {
    let buffer = "Start:\n";

    for (let index = 0; index < appList4.length; index++) {
      let app = appList4.queryElementAt(index, Ci.nsILocalHandlerApp);
      buffer += app.executable.leafName;
      buffer += "\n";
    }

    buffer += "\n";

    for (let index = 0; index < appList4.length; index++) {
      let app = appList4.queryElementAt(index, Ci.nsILocalHandlerApp);
      let prettyName = await app.prettyNameAsync();
      buffer += prettyName;
      buffer += "\n";
    }

    buffer += "\n";

    for (let index = 0; index < appList4.length; index++) {
      let app = appList4.queryElementAt(index, Ci.nsILocalHandlerApp);
      buffer += app.executable.displayName;
      buffer += "\n";
    }

    buffer += "\n";

    for (let index = 0; index < appList4.length; index++) {
      let app = appList4.queryElementAt(index, Ci.nsILocalHandlerApp);
      if (AppConstants.platform == "win") {
      	let file = app.executable;
        if (file instanceof Ci.nsILocalFileWin) {
          try {
          	buffer += file.getVersionInfoField("FileDescription");
          } catch (e) {
          }
        }
      }
      buffer += "\n";
    }

    buffer += "\nEnd\n";

    console.log(buffer);
  };

  const lazy4 = {};

  XPCOMUtils.defineLazyServiceGetters(lazy4, {
    gMIMEService: ["@mozilla.org/mime;1", "nsIMIMEService"],
  });

  let mimeInfo4 = lazy4.gMIMEService.getFromTypeAndExtension("text/html", "html");

  if (mimeInfo4.hasDefaultHandler) {
    console.log(`HasDefaultHandler = true`);
    console.log(`Description = ${mimeInfo4.defaultDescription}`);
  } else {
    console.log(`HasDefaultHandler = false`);
  }

  let appList4 = mimeInfo4.possibleLocalHandlers || [];
  console.log("appList4 = ");
  console.log(JSON.stringify(appList4));

  printNames(appList4);
}
```

That produces output that can be seen in a pretty form here:
https://docs.google.com/spreadsheets/d/1OvtrZgMlPMJO4Wgu6wwAYvm89orj9HdS_tsDxYn7yrA/edit#gid=0

This does not fix-up things so that all calls to getName() on the LocalHandlerApp are switched to prettyNameAsync. That work is tracked here: https://bugzilla.mozilla.org/show_bug.cgi?id=1884267

Differential Revision: https://phabricator.services.mozilla.com/D203876
2024-03-13 16:24:49 +00:00
Gregory Pappas
ea69b62538 Bug 1883217 - Remove unused defines in IDL files r=webdriver-reviewers,necko-reviewers,credential-management-reviewers,places-reviewers,dom-core,Standard8,valentin,mccr8,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D203347
2024-03-06 19:04:25 +00:00
Sean Feng
c52e5ee750 Bug 1838052 - Allow audio/aacp to always bypass the ORB check r=farre,necko-reviewers,valentin
audio/aacp is a variant of acc, since we've allowed acc, accp should be
allowed as well.

Differential Revision: https://phabricator.services.mozilla.com/D180830
2023-06-13 16:51:53 +00:00
Andreas Farre
1125476080 Bug 1828375 - Do gradual ORB transition. r=sefeng,necko-reviewers
Add a separate check for spec breaking allows of certain MIME
types. Having this separated out means that we can make the rest of
the implementation behave exactly like spec.

Some tradeoffs that we need in the current state are:

* Allowing "application/dash+xml"
* Allowing "application/vnd.apple.mpegurl"
* Allowing "text/vtt"
* Allow all MIME types beginning with "audio/mpeg"
* Allow "text/plain" when there is a no-sniff header.

Differential Revision: https://phabricator.services.mozilla.com/D176821
2023-05-10 14:35:52 +00:00
sunil mayya
a8ecb95b28 Bug 1784348 - improve checks while parsing MIME parameters. r=necko-reviewers,jesup,valentin
Differential Revision: https://phabricator.services.mozilla.com/D172110
2023-03-14 10:42:12 +00:00
Neil Deakin
1cc5883b43 Bug 1815062, move filename and extension validity checks into SanitizeFileName so that they get called after sanitization is complete, r=Gijs,necko-reviewers
For now, this leaves existing callers of DownloadPaths.sanitize as is using a flag.

Differential Revision: https://phabricator.services.mozilla.com/D169124
2023-02-28 18:57:24 +00:00
Gijs Kruitbosch
3dca426d77 Bug 1807260 - ensure nsMimeInfoWin's default app information is always-up-to-date, r=mhowell,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D169712
2023-02-20 16:44:18 +00:00
Sylvestre Ledru
1f8d23143a Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D165559
2022-12-28 09:52:44 +00:00
Shane Caraveo
d3e7b16fa3 Bug 1705044 r=freddyb,Gijs,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D154919
2022-11-03 17:00:40 +00:00
Sean Feng
6181fdcbf8 Bug 1785331 - Allow partially implemented ORB to be used in Nightly r=emilio,smaug,necko-reviewers,valentin
This patch starts to actually blocking opaque responses
for most type of the resources that are defined in the spec.
There are still pieces missing such as blocking JSON responses,
and this is why it's called partially implemented.

This patch was originally written by farre, and I made some
modifications based on it.

Depends on D155128

Differential Revision: https://phabricator.services.mozilla.com/D155129
2022-10-27 19:18:11 +00:00
Neil Deakin
747ddabbcd Bug 1778597, append valid extensions only when saving a page, r=Gijs,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D159478
2022-10-19 12:50:16 +00:00
Serge Guelton
daee4de4d2 Bug 1769027 - Cleanup netwerk includes r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D146164
2022-05-30 14:21:13 +00:00
Neil Deakin
d8b26cb066 Bug 1746052, don't allow Windows reserved filenames when sanitizing filenames. Move MangleTextToValidFileName to nsLocalFileWin and rename it to CheckForReservedFileName, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D138737
2022-05-06 10:00:55 +00:00
Neil Deakin
fd86ee2ff6 Bug 1746052, select a default filename for saving if the filename ends up being empty, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135957
2022-05-06 10:00:55 +00:00
Neil Deakin
3dd82cbf48 Bug 1746052, improve file sanitization by filtering and collpasing more whitespace characters and truncating files to 255 bytes, r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D138736
2022-05-06 10:00:52 +00:00
Neil Deakin
45e161641c Bug 1746052, add methods to the mime service that compute and validate a filename for a given content type, r=Gijs
The code in SanitizeFilename will be expanded upon in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D135951
2022-05-06 10:00:52 +00:00
Noemi Erli
295eab376a Backed out 14 changesets (bug 1746052) for causing build bustages in nsExternalHelperAppService.cpp CLOSED TREE
Backed out changeset bf46b0add531 (bug 1746052)
Backed out changeset 684b2aca10bb (bug 1746052)
Backed out changeset d4796eeeaf64 (bug 1746052)
Backed out changeset 5cf2378f6eb4 (bug 1746052)
Backed out changeset 2055ec1e9a57 (bug 1746052)
Backed out changeset 1398fc0669d2 (bug 1746052)
Backed out changeset 1f979899c843 (bug 1746052)
Backed out changeset 561a24801d4d (bug 1746052)
Backed out changeset 73e4689120f0 (bug 1746052)
Backed out changeset 9891f3b0229b (bug 1746052)
Backed out changeset 4c1ab30de0bd (bug 1746052)
Backed out changeset 108e14122e53 (bug 1746052)
Backed out changeset 1ee59c52578a (bug 1746052)
Backed out changeset 41fe77c5f4b2 (bug 1746052)
2022-05-05 23:13:33 +03:00
Neil Deakin
c1e573cd3c Bug 1746052, don't allow Windows reserved filenames when sanitizing filenames. Move MangleTextToValidFileName to nsLocalFileWin and rename it to CheckForReservedFileName, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D138737
2022-05-05 19:46:48 +00:00
Neil Deakin
679f61ea4c Bug 1746052, select a default filename for saving if the filename ends up being empty, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135957
2022-05-05 19:46:48 +00:00
Neil Deakin
7fdbbc3e3c Bug 1746052, improve file sanitization by filtering and collpasing more whitespace characters and truncating files to 255 bytes, r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D138736
2022-05-05 19:46:45 +00:00
Neil Deakin
d0aaa88f44 Bug 1746052, add methods to the mime service that compute and validate a filename for a given content type, r=Gijs
The code in SanitizeFilename will be expanded upon in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D135951
2022-05-05 19:46:45 +00:00
Csoregi Natalia
7896e7e124 Backed out 13 changesets (bug 1746052) for causing failures on uriloader/exthandler/tests/. CLOSED TREE
Backed out changeset d19cc58e3cab (bug 1746052)
Backed out changeset 229edc158a2b (bug 1746052)
Backed out changeset b0ef7c68abcf (bug 1746052)
Backed out changeset 30de4b77f242 (bug 1746052)
Backed out changeset ebc6720fdab3 (bug 1746052)
Backed out changeset daccb796a093 (bug 1746052)
Backed out changeset 5b76d8d76b2b (bug 1746052)
Backed out changeset a698068d078f (bug 1746052)
Backed out changeset 73d17535d8d1 (bug 1746052)
Backed out changeset 94c95f004221 (bug 1746052)
Backed out changeset 1a389759585a (bug 1746052)
Backed out changeset c91230a8ea90 (bug 1746052)
Backed out changeset 7665f02c114e (bug 1746052)
2022-05-04 01:15:12 +03:00
Neil Deakin
c203e5ec80 Bug 1746052, don't allow Windows reserved filenames when sanitizing filenames. Move MangleTextToValidFileName to nsLocalFileWin and rename it to CheckForReservedFileName, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D138737
2022-05-03 19:44:27 +00:00
Neil Deakin
f560834464 Bug 1746052, select a default filename for saving if the filename ends up being empty, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135957
2022-05-03 19:44:27 +00:00
Neil Deakin
daa3b8b384 Bug 1746052, improve file sanitization by filtering and collpasing more whitespace characters and truncating files to 255 bytes, r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D138736
2022-05-03 19:44:25 +00:00
Neil Deakin
2596b808fa Bug 1746052, add methods to the mime service that compute and validate a filename for a given content type, r=Gijs
The code in SanitizeFilename will be expanded upon in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D135951
2022-05-03 19:44:24 +00:00
Chris Peterson
f6fdbf028a Bug 1738401 - Remove -Wno-shadow warning suppressions. r=firefox-build-system-reviewers,glandium
-Wshadow warnings are not enabled globally, so these -Wno-shadow suppressions have no effect. I had intended to enable -Wshadow globally along with these suppressions in some directories (in bug 1272513), but that was blocked by other issues.

There are too many -Wshadow warnings (now over 2000) to realistically fix them all. We should remove all these unnecessary -Wno-shadow flags cluttering many moz.build files.

Differential Revision: https://phabricator.services.mozilla.com/D132289
2021-12-01 06:40:04 +00:00
Nicklas Boman
ad454095ed Bug 1308103 - Replace PL_strcmp/PL_strncmp with strcmp/strncmp in netwerk/ r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D123877
2021-09-09 19:36:10 +00:00
Nicklas Boman
558464ac5b Bug 1308106 - Replace PL_strstr with a safer Gecko string class or function r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D116931
2021-08-05 09:31:30 +00:00
Nicklas Boman
5a72708d0a Bug 1308104 - Replace PL_strchr with a safer Gecko string class or function netwerk/ r=necko-reviewers,dragana,valentin
Differential Revision: https://phabricator.services.mozilla.com/D89326
2021-08-05 09:25:15 +00:00
Valentin Gosu
d595491cc7 Bug 1714307 - Autofix static-analysis warnings in netwerk/ r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D116701
2021-06-04 12:35:16 +00:00
Butkovits Atila
692bda1ca1 Backed out changeset c4b44c4ef15b (bug 1714307) for causing build bustages on nsHTTPCompressConv.h. CLOSED TREE 2021-06-04 13:53:37 +03:00
Valentin Gosu
98146ae90b Bug 1714307 - Autofix static-analysis warnings in netwerk/ r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D116701
2021-06-04 10:00:55 +00:00
Kagami Sascha Rosylight
7b88bc8e6d Bug 1707590 - Part 2: Implement nsJXLDecoder r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D113359
2021-05-06 02:00:57 +00:00
Noemi Erli
13aa18b8d4 Backed out 4 changesets (bug 1707590) for causing gtest crashes CLOSED TREE
Backed out changeset 3bd322893127 (bug 1707590)
Backed out changeset 8cc3eaf728b6 (bug 1707590)
Backed out changeset 21f41a9df048 (bug 1707590)
Backed out changeset 3201d860afef (bug 1707590)
2021-05-06 04:57:44 +03:00
Kagami Sascha Rosylight
46370f6828 Bug 1707590 - Part 2: Implement nsJXLDecoder r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D113359
2021-05-06 01:14:21 +00:00
Noemi Erli
3487bbd1ee Backed out 4 changesets (bug 1707590) for causing gtest crashes CLOSED TREE
Backed out changeset 6edab66fe2c5 (bug 1707590)
Backed out changeset e5d2d6824408 (bug 1707590)
Backed out changeset 9c7204c3f03c (bug 1707590)
Backed out changeset 25da391baa22 (bug 1707590)
2021-05-06 02:07:42 +03:00
Kagami Sascha Rosylight
c0edfd67fc Bug 1707590 - Part 2: Implement nsJXLDecoder r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D113359
2021-05-05 21:44:08 +00:00
Csoregi Natalia
df171582fd Backed out 4 changesets (bug 1707590) for causing gtest crashes. CLOSED TREE
Backed out changeset fec7b65cc3d7 (bug 1707590)
Backed out changeset 3a7e5c98dd13 (bug 1707590)
Backed out changeset 9dfd0d516062 (bug 1707590)
Backed out changeset 9ab607973f20 (bug 1707590)
2021-05-05 22:23:06 +03:00