Commit Graph
524 Commits
Author SHA1 Message Date
Daniel Holbert b3b4ede596 Bug 2043789: Use MakeRefPtr to do allocation for various RefPtr variables in xpcom/{io,ioutils}/. r=xpcom-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D303598
2026-05-30 17:24:07 +00:00
agoloman 445c467866 Revert "Bug 2043790: Use MakeRefPtr to do allocation for various RefPtr variables in xpcom/tests/. r=xpcom-reviewers,emilio" for causing build bustages @TestNonBlockingAsyncInputStream.cpp.
This reverts commit ed098a6dfc.

Revert "Bug 2043789: Use MakeRefPtr to do allocation for various RefPtr variables in xpcom/{io,ioutils}/. r=xpcom-reviewers,emilio"

This reverts commit aa8e617fd8.

Revert "Bug 2043788: Use MakeRefPtr to do allocation for various RefPtr variables in xpcom/{base,ds}/. r=xpcom-reviewers,emilio"

This reverts commit 4f52fb1147.
2026-05-30 17:00:34 +00:00
Daniel Holbert aa8e617fd8 Bug 2043789: Use MakeRefPtr to do allocation for various RefPtr variables in xpcom/{io,ioutils}/. r=xpcom-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D303598
2026-05-30 15:26:23 +00:00
serge-sans-paille fac0f5e1a8 Bug 2041298 - Comply with clang-tidy's modernize-use-nullptr check for xpcom/ r=xpcom-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D301767
2026-05-25 15:20:21 +00:00
Nika Layzell 5f0f9dd22a Bug 2020817 - Part 4: Annotate & clean up nsACString callers of BeginReading/Data, r=xpcom-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,toolkit-telemetry-reviewers-rotation,layout-reviewers,dom-worker-reviewers,gfx-reviewers,webgpu-reviewers,necko-reviewers,dom-core,smaug,handyman,emilio,pehrsons,kershaw,timhuang,edenchuang,padenot,bradwerth
This is a large number of largely mechanical changes. When possible, the code
was called to directly call `.get()` instead, performing the assertions
manually. In many places PromiseFlatCString() calls were added to dynamically
copy the strings into null terminated buffers if the string was not null
terminated.

Differential Revision: https://phabricator.services.mozilla.com/D286158
2026-03-25 08:23:04 +00:00
Sylvestre Ledru 6149f49299 Bug 2023419 - Remove Emacs/Vim modelines from xpcom/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287878
2026-03-16 17:22:07 +00:00
Josh Aas 2fe6bf0fc7 Bug 1779696 - make Unix behavior match Windows during recursive file deletion. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D270965
2026-01-14 21:23:42 +00:00
Jonathan Kew d58bd4d89a Bug 1959738 - part 2 - Rewrite SanitizeFileName for better readability and correctness. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D274484
2025-12-13 00:12:31 +00:00
Alexandru Marc e7537a61ee Revert "Bug 1959738 - part 3 - Add a few SanitizeFileName tests with unpaired surrogates. r=Gijs" for causing bc failures @ browser_save_filenames
This reverts commit e9790fa9ac.

Revert "Bug 1959738 - part 2 - Rewrite SanitizeFileName for better readability and correctness. r=Gijs"

This reverts commit d5b61ae198.

Revert "Bug 1959738 - Use a standard "_files" suffix for associated files folder in all locales. r=Gijs,mak"

This reverts commit 6eb038cba9.
2025-12-11 23:37:11 +00:00
Jonathan Kew d5b61ae198 Bug 1959738 - part 2 - Rewrite SanitizeFileName for better readability and correctness. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D274484
2025-12-11 22:01:53 +00:00
Bob Owen eb81dee797 Bug 2003364 - Remove MOZ_ALWAYS_TRUE from SetNamedSecurityInfoW call. r=yjuglaret
All of the crashes looked at involve drives that might be prone to intermittent
failures or have unusual characteristics. While we could get something reported
that would be actionable it would be hard to find in the noise.

Differential Revision: https://phabricator.services.mozilla.com/D274736
2025-12-02 17:22:59 +00:00
Bob Owen f81fae7890 Bug 2000595 - If DACL has no inherited ACEs, reset to inherit in MoveOrCopyAsSingleFileOrDir. r=yjuglaret
Differential Revision: https://phabricator.services.mozilla.com/D274028
2025-11-26 15:12:53 +00:00
serge-sans-paille 1667ec582b Bug 1995723 - Remove unused inclusion of mozilla/ArrayUtils.h r=necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,firefox-svg-reviewers,layout-reviewers,gstoll,canaltinova,bytesized,alwu,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D269573
2025-10-23 07:30:37 +00:00
Yannis Juglaret 22ca0db0b5 Bug 1993904 - Acknowledge a possible failure during file copy/move. r=win-reviewers,gstoll
We provide an alternate path if we can't determine whether the file we
are copying or moving is or isn't a directory. This information is only
required to potentially avoid a slow path, so in case we can't get it we
just continue with the copy/move operation and then unconditionally take
the slow path.

Differential Revision: https://phabricator.services.mozilla.com/D268845
2025-10-16 14:01:56 +00:00
Bob Owen ac562564b2 Bug 1980886 p3 - Ensure no old inherited ACEs remain when moving files on Windows. r=yjuglaret
Differential Revision: https://phabricator.services.mozilla.com/D265007
2025-10-06 08:06:53 +00:00
Bob Owen 6def2987b4 Bug 1980886 p1 - Refactor CopySingleFile to better reflect its usage and behaviour. r=yjuglaret
Differential Revision: https://phabricator.services.mozilla.com/D266681
2025-10-06 08:06:46 +00:00
Rob Wu e39f8c3f3a Bug 1975674 - Add null check to nsIFile::Contains on Windows r=xpcom-reviewers,mccr8
+ add basic unit tests, run with: `./mach gtest TestFile.*`

Differential Revision: https://phabricator.services.mozilla.com/D256255
2025-07-07 18:30:29 +00:00
Oliver Old 054846ec0f Bug 1240005 - Users of do_CreateInstance or InitWithNativePath/InitWithPath not checking return value r=necko-reviewers,xpcom-reviewers,media-playback-reviewers,emilio,karlt,valentin
Differential Revision: https://phabricator.services.mozilla.com/D227280
2024-11-25 16:54:11 +00:00
serge-sans-paille 262f78c07f Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Alexandru Marc a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille 07101ac24d Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc 004e704b22 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille 2c916d4973 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Emilio Cobos Álvarez 4c840d573b Bug 1925866 - NS_NewLocalFile's aFollowSymlinks arg is unused. r=xpcom-reviewers,necko-reviewers,valentin,media-playback-reviewers,win-reviewers,karlt,nika,rkraesig
Remove it and related functions, and update the callers.

Differential Revision: https://phabricator.services.mozilla.com/D226261
2024-10-22 09:38:16 +00:00
Jens Stutte db38583c60 Bug 1913357 - Make GetDiskSpaceAvailable return the right error in case of GetParent failing. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D219277
2024-08-17 11:30:59 +00:00
Masatoshi Kimura 2d74e39210 Bug 1906405 - Fix nsLocalFile::GetLast(Accessed|Modified)Time. r=xpcom-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D215835
2024-07-05 18:59:43 +00:00
Cosmin Sabou 0d6df50c08 Backed out changeset d40105caed00 (bug 1906405) for causing xpcshell failures on test_localfile. CLOSED TREE 2024-07-05 21:05:34 +03:00
Masatoshi Kimura 1e927528ca Bug 1906405 - Fix nsLocalFile::GetLast(Accessed|Modified)Time. r=xpcom-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D215835
2024-07-05 16:58:55 +00:00
Jan Grulich c8affaf5e8 Bug 1882079 - Display real path when choosing download directory over portal r=settings-reviewers,Gijs,emilio
Use the new API addition to Document portal allowing clients to get real
path to the exported document. This allows to still use the same path as
provided by the document portal, but display the path as exists on the
host side.

Differential Revision: https://phabricator.services.mozilla.com/D202717
2024-06-28 19:31:13 +00:00
Norisz Fay 31c6f1a617 Backed out changeset 032d22e94bd3 (bug 1882079) for causing bustages on nsLocalFileUnix.cpp CLOSED TREE 2024-06-28 18:10:16 +03:00
Jan Grulich a2c79faafd Bug 1882079 - Display real path when choosing download directory over portal r=settings-reviewers,Gijs,emilio
Use the new API addition to Document portal allowing clients to get real
path to the exported document. This allows to still use the same path as
provided by the document portal, but display the path as exists on the
host side.

Differential Revision: https://phabricator.services.mozilla.com/D202717
2024-06-28 14:33:04 +00:00
Magnus Melin bbd67965e9 Bug 1898709 - Use GetMostRecentBrowserWindow() instead of GetMostRecentWindow(u"navigator:browser") to cater for Thunderbird's main window. r=nalexander
Based on https://github.com/Betterbird/thunderbird-patches/blob/main/115/bugs/1863798-toast-notification-foreground-mail-client-m-c.patch

Fixed cases where general code assume main window is Firefox.
GetMostRecentBrowserWindow is getting "navigator:browser" for Firefox, so there is no change in behavior,
but it means more things will work for Thunderbird.

Differential Revision: https://phabricator.services.mozilla.com/D211520
2024-05-24 17:43:52 +00:00
Yannis Juglaret 4d8a81cea9 Bug 1875036 - Speed up directory enumeration on Windows. r=win-reviewers,gstoll
We replace the use of FindFirstFileW by FindFirstFileExW with the most
optimized combination of flags on the code path reached from
nsIDirectoryEnumerator on Windows. This should make enumeration faster,
in particular when enumerating directories with thousands of files like
it can happen in QuotaManager code.

Differential Revision: https://phabricator.services.mozilla.com/D207151
2024-04-11 06:52:03 +00:00
Michael van Straten 9163961599 Bug 1870617 - Map Windows error 0x1 ERROR_INVALID_FUNCTION to NS_ERROR_FILE_DEVICE_FAILURE r=jstutte,xpcom-reviewers
`ERROR_INVALID_FUNCTION` appears to be a very generic "this device does not support this function".
Given that we deal only with file operations and errors here, this pretty much translates to "this device is not really a working file IO device for us" which makes it appear to be entirely broken for us.

Differential Revision: https://phabricator.services.mozilla.com/D196723
2024-03-22 14:35:14 +00:00
Neil Deakin 69eb68e4b7 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
Bob Owen 30f618bb47 Bug 1816694: Don't call SetNamedSecurityInfoW if permissions are already inherited. r=mhowell
This avoids a syscall and also prevents a lot of unnecessary SeTcbPrivilege
requests which may be audited by security software.

Differential Revision: https://phabricator.services.mozilla.com/D170855
2023-02-28 08:34:06 +00:00
Tom Ritter eb7f222a32 Bug 1758681: Remove unneeded defines for MinGW r=firefox-build-system-reviewers,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D169378
2023-02-15 19:01:58 +00:00
Kagami Sascha Rosylight 40205d2cc2 Bug 1788986 - Part 4: Add a counter for nsIFile r=xpcom-reviewers,nika,barret,janv
This adds `count` out parameter for recursive file remove calls to report the number of the removed entries.

  Having a lot of files removed by `::Remove(recursive=true)` has been a problem, as a slow disk can cause a hang with such call. A counter feature will help us knowing the situation better via telemetry.

  The use of out parameter here is to mark it optional and prevent unwanted changes in existing callers (because a return value can't be optional).

Differential Revision: https://phabricator.services.mozilla.com/D156940
2023-02-06 11:32:48 +00:00
Iulian Moraru 968971693d Backed out 3 changesets (bug 1788986) for causing xpcshell failures on test_backgroundtask_removeDirectory.js. CLOSED TREE
Backed out changeset d288a5d5cc3d (bug 1788986)
Backed out changeset 7f30102942bc (bug 1788986)
Backed out changeset 8c8026379e91 (bug 1788986)
2023-02-02 20:58:26 +02:00
Kagami Sascha Rosylight dd74ef8410 Bug 1788986 - Part 4: Add a counter for nsIFile r=xpcom-reviewers,nika,barret,janv
This adds `count` out parameter for recursive file remove calls to report the number of the removed entries.

  Having a lot of files removed by `::Remove(recursive=true)` has been a problem, as a slow disk can cause a hang with such call. A counter feature will help us knowing the situation better via telemetry.

  The use of out parameter here is to mark it optional and prevent unwanted changes in existing callers (because a return value can't be optional).

Differential Revision: https://phabricator.services.mozilla.com/D156940
2023-02-02 15:23:47 +00:00
Barret Rennie a11ba90df1 Bug 1786608 - Add nsIFile::accessTime{,OfLink} r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D155926
2022-11-20 22:37:17 +00:00
Barret Rennie 3cfe6a48d8 Bug 1786608 - Do not set atime on Windows in nsLocalFile::SetModifiedTime r=xpcom-reviewers,kmag
Differential Revision: https://phabricator.services.mozilla.com/D155925
2022-11-20 22:37:17 +00:00
Cristian Tuns 2fb90fc205 Backed out 3 changesets (bug 1786608) for causing mochitest failures in test_ioutils_stat_set_modification_time.html CLOSED TREE
Backed out changeset ac137b0db467 (bug 1786608)
Backed out changeset e593e8e2696b (bug 1786608)
Backed out changeset a3fd1df20b66 (bug 1786608)
2022-11-17 00:50:54 -05:00
Barret Rennie a1b048e1dc Bug 1786608 - Add nsIFile::accessTime{,OfLink} r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D155926
2022-11-17 05:09:18 +00:00
Barret Rennie 0f906a1a15 Bug 1786608 - Do not set atime on Windows in nsLocalFile::SetModifiedTime r=xpcom-reviewers,kmag
Differential Revision: https://phabricator.services.mozilla.com/D155925
2022-11-17 05:09:18 +00:00
Cristian Tuns 092144c233 Backed out 3 changesets (bug 1786608) for causing build bustages CLOSED TREE
Backed out changeset 8eb603c625f4 (bug 1786608)
Backed out changeset 0df0cf8f67b4 (bug 1786608)
Backed out changeset 2b3815684692 (bug 1786608)
2022-11-16 13:58:36 -05:00
Barret Rennie 2a2272bcc1 Bug 1786608 - Add nsIFile::accessTime{,OfLink} r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D155926
2022-11-16 18:31:57 +00:00
Barret Rennie 0ee4403e9d Bug 1786608 - Do not set atime on Windows in nsLocalFile::SetModifiedTime r=xpcom-reviewers,kmag
Differential Revision: https://phabricator.services.mozilla.com/D155925
2022-11-16 18:31:56 +00:00
Cristian Tuns 9670ee758d Backed out 3 changesets (bug 1786608) for causing build bustages CLOSED TREE
Backed out changeset dd0426463627 (bug 1786608)
Backed out changeset f2dcf20b5b44 (bug 1786608)
Backed out changeset 5b7d6807075a (bug 1786608)
2022-11-06 14:04:05 -05:00
Barret Rennie 1f6af3f8f6 Bug 1786608 - Add nsIFile::accessTime{,OfLink} r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D155926
2022-11-06 18:33:22 +00:00