Commit Graph
186 Commits
Author SHA1 Message Date
Daniel Holbert 3073bdc4ca Bug 2043345: Use MakeRefPtr to do allocation for various RefPtr variables in widget/windows. r=win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D302956
2026-05-29 03:43:03 +00:00
Emilio Cobos Álvarez f097472815 Bug 2022763 - Propagate owner global from input element to DOM files properly. r=dom-core,win-reviewers,smaug,gstoll,devtools-reviewers,jdescottes
This required some refactoring of the MockFilePicker to test somewhat (ugh)
reliably, but hopefully an improvement.

Differential Revision: https://phabricator.services.mozilla.com/D288166
2026-04-18 10:00:15 +00:00
rperta 2b400e7aa3 Revert "Bug 2022763 - Propagate owner global from input element to DOM files properly. r=dom-core,win-reviewers,smaug,gstoll,devtools-reviewers,jdescottes" for causing bc failures at browser_screenshots_test_downloads.js This reverts commit 0f75054261. 2026-04-18 02:20:17 +00:00
Emilio Cobos Álvarez 0f75054261 Bug 2022763 - Propagate owner global from input element to DOM files properly. r=dom-core,win-reviewers,smaug,gstoll,devtools-reviewers,jdescottes
This required some refactoring of the MockFilePicker to test somewhat (ugh)
reliably, but hopefully an improvement.

Differential Revision: https://phabricator.services.mozilla.com/D288166
2026-04-17 22:25:42 +00:00
Atila Butkovits ffcaa992e6 Revert "Bug 2022763 - Clean up existing usages of MockFilePicker.init(). r=dom-core,mtigley,extension-reviewers,credential-management-reviewers,devtools-reviewers,omc-reviewers,migration-reviewers,profiles-reviewers,layout-reviewers,emz,fchasen,nchevobbe,mconley,smaug,mossop,robwu,hanna_a,jwatt" for causing multiple failures.
This reverts commit 85b2d0d3dd.

Revert "Bug 2022763 - Propagate owner global from input element to DOM files properly. r=dom-core,win-reviewers,smaug,gstoll"

This reverts commit ff40c521b2.
2026-04-17 10:52:18 +00:00
Emilio Cobos Álvarez ff40c521b2 Bug 2022763 - Propagate owner global from input element to DOM files properly. r=dom-core,win-reviewers,smaug,gstoll
This required some refactoring of the MockFilePicker to test somewhat (ugh)
reliably, but hopefully an improvement.

Differential Revision: https://phabricator.services.mozilla.com/D288166
2026-04-17 09:07:32 +00:00
Sylvestre Ledru 4f6b8b516d Bug 2023419 - Remove Emacs/Vim modelines from widget/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287877
2026-03-16 17:22:02 +00:00
serge-sans-paille 78faa720d8 Bug 2017377 - Remove MOZ_RUNINIT occurrences for trivially constructible types r=necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,layout-reviewers,timhuang,padenot,emilio,valentin,gstoll
And also for types with very simple constructors, following adjustment
to the GlobalVariableInitialization pass.

This basically means flagging some default constructors constexpr, and
the global variable declaration constinit.

Maybe<...> types are left without annotation, marking them constinit is
incompatible with Bug 1992162.

In some cases, this depends on libstdc++ version which lags behind
other standard library we use, then MOZ_GLIBCXX_CONSTINIT is used.

Differential Revision: https://phabricator.services.mozilla.com/D284267
2026-02-26 16:31:02 +00:00
rperta e10f03a3d6 Revert "Bug 2017377 - Remove MOZ_RUNINIT occurrences for trivially constructible types r=necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,layout-reviewers,timhuang,padenot,emilio,valentin,gstoll" for causing build bustages on xpcrtfuzzing.cpp
This reverts commit ea54d84735.

This reverts commit 3e4bbf72af.
2026-02-26 11:35:21 +00:00
serge-sans-paille ea54d84735 Bug 2017377 - Remove MOZ_RUNINIT occurrences for trivially constructible types r=necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,layout-reviewers,timhuang,padenot,emilio,valentin,gstoll
And also for types with very simple constructors, following adjustment
to the GlobalVariableInitialization pass.

This basically means flagging some default constructors constexpr, and
the global variable declaration constinit.

Maybe<...> types are left without annotation, marking them constinit is
incompatible with Bug 1992162.

In some cases, this depends on libstdc++ version which lags behind
other standard library we use, then MOZ_GLIBCXX_CONSTINIT is used.

Differential Revision: https://phabricator.services.mozilla.com/D284267
2026-02-26 08:05:32 +00:00
Cristian Tuns 46ee0caf26 Revert "Bug 2017377 - Remove MOZ_RUNINIT occurrences for trivially constructible types r=necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,layout-reviewers,timhuang,padenot,emilio,valentin,gstoll" for causing multiple build bustages regarding MOZ_RUNINIT
This reverts commit fbb2488509.

Revert "Bug 2017377 - Improve GlobalVariableInitialization pass to catch common patterns r=firefox-static-analysis-reviewers,sylvestre"

This reverts commit c4d03b539a.
2026-02-25 22:03:14 +00:00
serge-sans-paille fbb2488509 Bug 2017377 - Remove MOZ_RUNINIT occurrences for trivially constructible types r=necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,layout-reviewers,timhuang,padenot,emilio,valentin,gstoll
And also for types with very simple constructors, following adjustment
to the GlobalVariableInitialization pass.

This basically means flagging some default constructors constexpr, and
the global variable declaration constinit.

Maybe<...> types are left without annotation, marking them constinit is
incompatible with Bug 1992162.

In some cases, this depends on libstdc++ version which lags behind
other standard library we use, then MOZ_GLIBCXX_CONSTINIT is used.

Differential Revision: https://phabricator.services.mozilla.com/D284267
2026-02-25 21:02:30 +00:00
serge-sans-paille 72609da313 Bug 1996641 - Remove unused mfbt inclusion in widget/** r=emilio,necko-reviewers,geckoview-reviewers,win-reviewers,gstoll,ohall,sunil
Differential Revision: https://phabricator.services.mozilla.com/D270216
2025-10-29 13:06:08 +00:00
Sandor Molnar 50c434493d Revert "Bug 1996641 - Remove unused mfbt inclusion in widget/** r=emilio,necko-reviewers,geckoview-reviewers,win-reviewers,gstoll,ohall,sunil" for causing build bustages @ nsHttpChannel.cpp
This reverts commit 66b97f2926.
2025-10-29 11:31:08 +00:00
serge-sans-paille 66b97f2926 Bug 1996641 - Remove unused mfbt inclusion in widget/** r=emilio,necko-reviewers,geckoview-reviewers,win-reviewers,gstoll,ohall,sunil
Differential Revision: https://phabricator.services.mozilla.com/D270216
2025-10-29 11:00:27 +00:00
Greg Stoll b3316f58d6 Bug 1965504 part 1 - add Download operation type and rename fileNameForDisplay r=dlp-reviewers,fluent-reviewers,bolsson,handyman
We only ever used operationDisplayString to represent a filename,
so go ahead and formalize that.

Differential Revision: https://phabricator.services.mozilla.com/D251877
2025-06-16 20:32:17 +00:00
Greg Stoll 8ba9956d41 Bug 1961170 part 1 - add autoAcknowledge to CheckFilesInBatchMode() r=dlp-reviewers,win-reviewers,handyman
The new entry point analyzeBatchContentRequest() (added in a later part)
is going to want this parameter.

Differential Revision: https://phabricator.services.mozilla.com/D248518
2025-05-21 17:33:11 +00:00
Greg Stoll 67e81e9465 Bug 1950424 part 2 - make nsFilePicker call the new Content Analysis "batch" entry point r=dlp-reviewers,win-reviewers,rkraesig,handyman
Differential Revision: https://phabricator.services.mozilla.com/D241090
2025-03-13 21:34:51 +00:00
Ray Kraesig 0bdb9dd88c Bug 1950056 - extend use of FOS_NODEREFERENCELINKS r=Gijs,win-reviewers,gstoll
In the modern era of user-customizable Quick Access sidebars on every
file dialog, navigating via `.lnk` files is rather less useful than it
was twenty years ago.

Disable link-following in file-open dialogs by default, to prevent any
of the usual security issues involving symlink smuggling. Allow
overriding this behavior via a pref, for users who don't care.

(File-save dialogs have a more nuanced guard against that sort of thing;
this patch doesn't affect that.)

Differential Revision: https://phabricator.services.mozilla.com/D239833
2025-02-28 22:52:03 +00:00
David P 1a51dc7863 Bug 1936020: Part 8 - Update the content analysis service's callers r=dlp-reviewers,win-reviewers,reusable-components-reviewers,gstoll,tgiles
AnalyzeContentRequest* calls now require fewer fields.  For example, the
URI is, by default, now obtained from the request's WindowGlobalParent's
BrowsingContext.

browser-custom-element.js needed to re-get service for tests, since it was
sometimes getting an old mock version from a previous test.

ContentAnalysisCallback does what SafeContentAnalysisResultCallback used to do.

Differential Revision: https://phabricator.services.mozilla.com/D236631
2025-02-13 19:19:18 +00:00
Florian Quèze 9609e47f62 Bug 1879329 - script generated replacement of the GleanMetrics.h includes, r=chutten,valentin,media-playback-reviewers,cookie-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,rkraesig,emz,aabh,padenot.
Differential Revision: https://phabricator.services.mozilla.com/D234744
2025-01-21 11:21:45 +00:00
Greg Stoll 407a016c57 Bug 1932480 part 3 - pass correct Reason for paste, drag/drop, file picker cases r=dlp-reviewers,win-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D231606
2024-12-10 02:30:24 +00:00
Edgar Chen 2867a4c0c2 Bug 1930101 - Minor cleanup of windows/nsFilePicker; r=win-reviewers,rkraesig
No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D228432
2024-11-18 23:38:18 +00:00
Edgar Chen e4cb522cb9 Bug 1930101 - Move AsyncShowFilePicker to cocoa/nsFilePicker; r=win-reviewers,mac-reviewers,emilio,rkraesig,bradwerth
Then other plaforms don't need to implement Show() method.
No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D228418
2024-11-18 23:38:16 +00:00
Ray Kraesig 720a4eec06 Bug 1928260 - [1/1] Remove expiring telemetry from nsFilePicker r=win-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D227531
2024-10-31 19:53:14 +00:00
serge-sans-paille 5946338a6a Bug 1920718 - Annotate all global variable with runtime initialization attributes r=glandium,application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh,geckoview-reviewers,win-reviewers,gstoll,m_kato
MOZ_RUNINIT => initialized at runtime
MOZ_CONSTINIT => initialized at compile time
MOZ_GLOBINIT => initialized either at runtime or compile time, depending on template parameter, macro parameter etc
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.

Differential Revision: https://phabricator.services.mozilla.com/D223341
2024-10-30 11:05:24 +00:00
Greg Stoll eef0bb3303 Bug 1926348 part 1 - add prefs to disable specific Content Analysis interception points r=dlp-reviewers,reusable-components-reviewers,win-reviewers,mstriemer,handyman
It would have been easier to intercept these at the time of making the
Content Analysis call, but moving these checks outward saves any time
in creating the data to analyze.

Differential Revision: https://phabricator.services.mozilla.com/D227182
2024-10-30 01:46:20 +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
David Parks 75051a962b Bug 1919752: Submit all files for content analysis when doing folder analysis r=dlp-reviewers,win-reviewers,gstoll
Converts folder scan requests, from any content analysis interception point,
into file scan requests for each file in the folder (recursively).  Folder CA
approval is given iff all files were approved.  Otherwise the folder analysis
result is denial, issued as soon as that is known.

This still has the issue that only the first file will be given busy and verdict
dialogs.  The entire CA check may silently block because of this.  See bug
1915351.

Differential Revision: https://phabricator.services.mozilla.com/D224344
2024-10-07 20:28:28 +00:00
Ray Kraesig 87b4b9d2f2 Bug 1730361 - [1/1] remove unnecessary flag from IFileDialog r=win-reviewers,handyman
Remove the `FOS_SHAREAWARE` flag, which tells Windows that we'll be
providing it with an `IFileDialogEvents` object with `.OnShareViolation()`
implemented. (We do no such thing, nor ever have.)

Differential Revision: https://phabricator.services.mozilla.com/D221273
2024-09-24 16:09:38 +00:00
Ray Kraesig e52c7976cd Bug 1884426 - [7/6] Document filepicker async-execution strategies DONTBUILD r=win-reviewers,gstoll
As a followup to the content patches of a couple of months ago: document
the meaning of the values of AsyncExecute's `enum Strategy`, and in
particular the reasoning behind the last strategy's heuristic.

No functional changes; this patch only adds comments.

Differential Revision: https://phabricator.services.mozilla.com/D222730
2024-09-19 18:49:14 +00:00
Greg Stoll 64bacd78ef Bug 1914068 - pass correct URL to Content Analysis for same-origin iframes r=dlp-reviewers,win-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D220168
2024-09-04 19:55:29 +00:00
Ray Kraesig 51287023de Bug 1883943 - Let the out-of-process file-picker ride the trains r=win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D217849
2024-07-26 17:45:30 +00:00
Ray Kraesig a824aad459 Bug 1884426 - [6/6] Add AsyncExecute strategy: retry locally except on crashes r=win-reviewers,gstoll
... and set this as the new default strategy on Nightly.

Note that the file-picker failure UI will still be displayed if, e.g.,
the file-dialog encounters a nonfatal local failure after a nonfatal
remote failure.

Differential Revision: https://phabricator.services.mozilla.com/D215559
2024-07-09 22:16:57 +00:00
Ray Kraesig 789ef0b363 Bug 1884426 - [5/6] Refactor AsyncExecute strategy-implementation code r=win-reviewers,gstoll
DRY up code slightly in preparation for adding a new strategy.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D215558
2024-07-09 22:16:56 +00:00
Ray Kraesig 7a0df6b4c8 Bug 1884426 - [3/6] Implement file-picker-crashed UI message r=Gijs,win-reviewers,fluent-reviewers,firefox-desktop-core-reviewers ,flod,gstoll
Fire a signal (via the observer service) when the file-dialog crashes or
otherwise fails.

Set up a listener for that signal which reports the failure to the
end-user via the NotificationBox.

Differential Revision: https://phabricator.services.mozilla.com/D214192
2024-07-09 22:16:55 +00:00
Ray Kraesig 3c376f16dd Bug 1884426 - [2/6] Write saved file to fallback location if possible r=win-reviewers,gstoll
If the user is trying to save a file, don't discard that file on
failure; instead, write it to some default location on the filesystem.

Differential Revision: https://phabricator.services.mozilla.com/D214190
2024-07-09 22:16:55 +00:00
Ray Kraesig 2a65db2ba6 Bug 1884426 - [1/6] Extend error propagation slightly r=win-reviewers,gstoll
Propagate error signal up into nsFilePicker::Open(), to unify error
handling between files and folders.

No functional changes (yet).

Differential Revision: https://phabricator.services.mozilla.com/D214188
2024-07-09 22:16:55 +00:00
Ray Kraesig 34f7841f44 Bug 1902737 - [1/1] Add "in shutdown" boolean to file-picker telemetry r=gstoll,win-reviewers,data-stewards
Additionally, fix a schema error: `data-sensitivity` was under
`metadata`, and also should have been spelled with an underscore.

Differential Revision: https://phabricator.services.mozilla.com/D213834
2024-06-20 00:33:37 +00:00
Greg Stoll bd48c526cb Bug 1899764 - make DLP handle nested folders r=rkraesig,dlp-reviewers,win-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D212214
2024-06-05 20:03:04 +00:00
Ray Kraesig ef11307dde Bug 1884221 - [1/1] Add fallback_v2 telemetry r=win-reviewers,gstoll
Add new telemetry for the file-dialog picker which should more precisely
pinpoint the initial cause of failures.

Data-review approval: https://bugzilla.mozilla.org/show_bug.cgi?id=1884221#c2

Differential Revision: https://phabricator.services.mozilla.com/D211120
2024-05-30 17:52:09 +00:00
Ray Kraesig 0d6d84297d Bug 1895375 - [4/4] Propagate ipc::LaunchErrors to callers r=ipc-reviewers,nika
* Adjust UtilityProcess{Host,Manager} to propagate ipc::LaunchErrors for
  their clients, or to create new ones where none previously existed.

* Adjust the various clients of the above to to handle the additional
  information -- mostly by adding the additional failure-location data
  to log messages.

* Fix an unrelated bug wherein the return type of `LaunchProcess` was
  declared as exclusive, despite being cached and reused.

In particular, filedialog::Error objects should now contain -- and report
to telemetry without further adjustment -- the actual error code from
`ipc::LaunchError`s.

(Reporting the original failure location as well will occur in bug
1884221.)

Differential Revision: https://phabricator.services.mozilla.com/D209715
2024-05-30 17:52:09 +00:00
Greg Stoll dcf7eb4ece Bug 1894260 - get folder contents for DLP in a simpler way r=win-reviewers,dlp-reviewers,handyman
We used to use GetDomFileOrDirectory(), but that creates a mozilla::dom::Directory which needs to be able to get a DOMWindow. Getting that DOMWindow is now failing, perhaps because of the out-of-process file picker?

Anyway, all we care about is getting the contents of the directory, so we can just use GetDirectoryEntries() to sidestep this, and it also makes the code a bit simpler.

Unfortunately there isn't a good way to test code that's in nsFilePicker.cpp right now, as MockFilePicker mocks all of this out.

Differential Revision: https://phabricator.services.mozilla.com/D209056
2024-05-06 00:25:41 +00:00
Ray Kraesig 078903e2e0 Bug 1886327 - [5/5] serialize error locations as constant numeric values r=win-reviewers,gstoll
Instead of passing potentially-dynamic strings over the IPDL interface,
pass an integer which corresponds to one of a fixed set of static
strings. (This is basically an enum with more steps -- or with fewer
steps, depending on which side of it you're standing on.)

This ensures that the set of possible location-strings is fixed, which
in turn both ensures that aggregation of telemetry stays relatively
simple and guards against accidental leakage of PII thereinto. (Or,
alternatively and equivalently, this minimizes the code region that
data-review needs to consider once the location string is reported to
telemetry.)

Note that we do not yet actually report the location-string via
telemetry; that's planned to occur in bug 1884221.

Differential Revision: https://phabricator.services.mozilla.com/D205169
2024-04-25 20:42:50 +00:00
Ray Kraesig 79b15dcecb Bug 1886327 - [4/5] propagate ordinary filepicker errors through IPDL r=win-reviewers,gstoll
Don't crash the file-picker host process just because a nonfatal failure
occurred. Instead, report the failure location and code over the IPDL
interface.

Differential Revision: https://phabricator.services.mozilla.com/D205168
2024-04-25 20:42:49 +00:00
Ray Kraesig ca857997cc Bug 1886327 - [3/5] rework promise type to carry metadata r=win-reviewers,gstoll
Replace most promise-types in widget/windows/filedialog with something
capable of carrying the initial cause and location of a failure.

This does not properly convey that metadata across the IPDL connection
where possible; that will be done in an upcoming commit.

Differential Revision: https://phabricator.services.mozilla.com/D205167
2024-04-25 20:42:49 +00:00
Ray Kraesig 3e671bd045 Bug 1886327 - [2/5] hide ShowFilePickerRemote _et al._ r=win-reviewers,gstoll
The `Show{File,Folder}Picker{Local,Remote}` functions don't depend on
anything in `nsFilePicker` itself except the mostly-vestigial promise
type. Pull all of them into nsFilePicker.cpp as static functions in an
anonymous namespace.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D205166
2024-04-25 20:42:49 +00:00
Ray Kraesig 99bd6bd3fc Bug 1886327 - [1/5] wrap Send* calls in FilePickerParent r=win-reviewers,gstoll
... in preparation for more interesting changes surrounding the error type.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D205165
2024-04-25 20:42:48 +00:00
Greg Stoll 8a7617b316 Bug 1875481 - Part 2: Remove [infallible] from a few nsIContentAnalysis* IDL classes to allow mocking in tests r=handyman,win-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D200978
2024-04-10 00:15:46 +00:00
Stanca Serban 4c0f6b30c1 Backed out 3 changesets (bug 1875481) for basicWindowDotPrintTest related junit failures.
Backed out changeset cd024cb2768e (bug 1875481)
Backed out changeset 6b7be15cd017 (bug 1875481)
Backed out changeset d1da53c0673b (bug 1875481)
2024-04-09 05:56:47 +03:00