Commit Graph
169 Commits
Author SHA1 Message Date
Ray Kraesig 496ebbaeae Bug 1598915 - [1/2] Drive-by cleanup: replace manual pointer-fiddling with RefPtr r=win-reviewers,handyman
`nsDataObj::mTransferable`'s lifecycle and ownership semantics are
trivially that of `RefPtr`. Use it.

(We do not presently extend this to `m_enumFE`, below; according to
comments in IEnumFE.h, that one's less trivial.)

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D216624
2024-07-16 22:09:38 +00:00
Tamas Szentpeteri 68012aa965 Backed out 2 changesets (bug 1598915) for causing build bustages on nsDragService.cpp. CLOSED TREE
Backed out changeset 340e2d1b2d23 (bug 1598915)
Backed out changeset 415be9b49528 (bug 1598915)
2024-07-17 00:53:21 +03:00
Ray Kraesig b3fe11866a Bug 1598915 - [1/2] Drive-by cleanup: replace manual pointer-fiddling with RefPtr r=win-reviewers,handyman
`nsDataObj::mTransferable`'s lifecycle and ownership semantics are
trivially that of `RefPtr`. Use it.

(We do not presently extend this to `m_enumFE`, below; according to
comments in IEnumFE.h, that one's less trivial.)

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D216624
2024-07-16 17:49:30 +00:00
Edgar Chen 546880ae4d Bug 1867636 - Rename nsITransferable::requestingPrincipal; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D207272
2024-04-18 10:06:07 +00:00
Tom Schuster 30930ea2b7 Bug 1808146 - When creating a file promise for images, remember the referrer. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D172920
2023-03-22 21:55:08 +00:00
Ray Kraesig 6fbd73be75 Bug 1815987 - Rewrite data-read loop in OnDataAvailable r=yjuglaret
The read-loop in OnDataAvailable is needlessly baroque and uses a very
strange dialect of Hungarian notation. Factor out the zero-element case
for simplicity (of explication, if nothing else), and add justificatory
comments as appropriate.

Differential Revision: https://phabricator.services.mozilla.com/D171001
2023-03-14 19:54:26 +00:00
Neil Deakin 5195217e8b Bug 1819760, don't modify extensions when trying to create a desktop shortcut, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D171639
2023-03-07 14:01:04 +00:00
Nika Layzell 1582a62a38 Bug 1542802 - Part 1: Replace LazyIdleThread with a thin wrapper around nsThreadPool, r=jesup,gstoll
This does not reduce the number of threads we end up using in these
cases, but simplifies the complex implementation substantially by
relying on the idle thread lifetime management logic from nsThreadPool.

The nsISerialEventTarget implementation is maintained by wrapping the
nsThreadPool with a TaskQueue.

As a result of using these more reliable backing implementations, the
type is now also safe to use from any thread, rather than requiring
dispatches to all occur from the creator thread.

Unfortunately, this required some changes to the
UntrustedModulesProcessor, which was relying on the ability to fetch the
PRThread* (and from that the HANDLE) from the lazy thread in order to
perform priority changes on it. This was fixed by using a
nsIThreadPoolListener to watch the thread being created and destroyed,
and manually record a HANDLE to the thread which can be used for these
priority changes.

Differential Revision: https://phabricator.services.mozilla.com/D168017
2023-03-02 15:52:32 +00:00
Csoregi Natalia d542110f53 Backed out changeset eafcabbf729b (bug 1542802) for causing Gtest crashes. CLOSED TREE 2023-02-03 00:03:53 +02:00
Nika Layzell b735298e12 Bug 1542802 - Replace LazyIdleThread with a thin wrapper around nsThreadPool, r=jesup,gstoll
This does not reduce the number of threads we end up using in these
cases, but simplifies the complex implementation substantially by
relying on the idle thread lifetime management logic from nsThreadPool.

The nsISerialEventTarget implementation is maintained by wrapping the
nsThreadPool with a TaskQueue.

As a result of using these more reliable backing implementations, the
type is now also safe to use from any thread, rather than requiring
dispatches to all occur from the creator thread.

Unfortunately, this required some changes to the
UntrustedModulesProcessor, which was relying on the ability to fetch the
PRThread* (and from that the HANDLE) from the lazy thread in order to
perform priority changes on it. This was fixed by using a
nsIThreadPoolListener to watch the thread being created and destroyed,
and manually record a HANDLE to the thread which can be used for these
priority changes.

Differential Revision: https://phabricator.services.mozilla.com/D168017
2023-02-02 19:43:31 +00:00
Neil Deakin 21426e24f4 Bug 1776879, replace text/unicode for clipboard and drag and drop and use text/plain directly, r=edgar,mak,stransky,geckoview-reviewers,extension-reviewers,zombie,m_kato
Most usage is a straight replacement but gtk needs extra changes as it transfers plain text in UTF8 natively and needs to be converted into UTF16, and Windows uses single-byte characters for RTF and CF_HTML formats so we preserve this.

Differential Revision: https://phabricator.services.mozilla.com/D158587
2023-02-01 23:30:55 +00:00
Neil Deakin 0d5fd6af29 Bug 1806730, remove the redundant filename length checking that ValidateFileNameForSaving already does, r=cmartin
Differential Revision: https://phabricator.services.mozilla.com/D165477
2023-01-16 18:15:02 +00:00
Tyler Paplham 37ea6c5ac0 Bug 1335111 - Changed shortcut link extensions to '.url' instead of '.URL'. r=rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D166250
2023-01-09 16:50:15 +00:00
Nicolai Kasper 3b62dfb454 Bug 1746139 - Keeping filename ending intact when using windows with events like drag and drop. r=cmartin
Differential Revision: https://phabricator.services.mozilla.com/D141941
2022-11-05 03:21:35 +00:00
Ray Kraesig 598d90fb75 Bug 1754803 - expand size-field to 16 digits if 8 won't suffice r=handyman
... while retaining the existing 8-wide padding for backward
compatibility with existing consumers.

Differential Revision: https://phabricator.services.mozilla.com/D154705
2022-08-17 22:46:57 +00:00
Neil Deakin 408281a805 Bug 1774683, use ValidateFilenameForSaving to validate dropped links on Windows, r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D149746
2022-06-22 08:27:07 +00:00
Neil Deakin fea26084bc 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
Noemi Erli 7690ca54a5 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 24d9bdd9c8 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
Csoregi Natalia cc401bfc0c 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
Mike Hommey 30f26f1da0 Bug 1766561 - Add missing z modifier for size_t formatting. r=gfx-reviewers,necko-reviewers,keeler,rkraesig,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D144918
2022-05-03 20:49:09 +00:00
Neil Deakin 13b7395aa0 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
Ray Kraesig fc32add347 Bug 302092 - Perform various minor modernizations r=handyman
Perform some cleanup to bring the code in this function closer to modern
standards. (This includes, but is not limited to, the simple
variable-name change requested by the Bugzilla bug.)

This commit should have no effective functional changes.

Tested via `browser/base/content/test/general/browser_clipboard.js`,
which was confirmed to complain if changes were made to this function's
output (and, specifically, to the values in the start- and
end-positions).

Differential Revision: https://phabricator.services.mozilla.com/D138087
2022-02-11 22:53:12 +00:00
Bob Owen 5ce42caace Bug 1664149: Hold a self reference in nsDataObj. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D133099
2021-12-20 17:32:48 +00:00
Cristian Tuns d90f7adfe9 Backed out changeset 08324a167e6b (bug 1664149) for causing mochitest failures on test_bug1123480.xhtml CLOSED TREE 2021-12-20 06:14:25 -05:00
Bob Owen 3886fadd47 Bug 1664149: Hold a self reference in nsDataObj. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D133099
2021-12-20 09:23:17 +00:00
Nika Layzell 0e975d0e8d Bug 1741665 - Align nsCString's public size_type better with other C++ APIs, r=mccr8,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D131422
2021-12-13 21:47:56 +00:00
Jens Stutte 2e2c3fae06 Bug 1731564: Use motivated SpinEventLoopUntil inside widget/*. r=smaug
Depends on D127235

Differential Revision: https://phabricator.services.mozilla.com/D127236
2021-10-07 08:06:15 +00:00
Marian-Vasile Laza 7de6967c5a Backed out 18 changesets (bug 1731564) for causing build bustages on SpinEventLoopUntil. CLOSED TREE
Backed out changeset 0464dbdc8584 (bug 1731564)
Backed out changeset 0d996df13545 (bug 1731564)
Backed out changeset 5630a0e7a109 (bug 1731564)
Backed out changeset 37b41d187cdb (bug 1731564)
Backed out changeset d37700fa60b6 (bug 1731564)
Backed out changeset b0ce7db44b99 (bug 1731564)
Backed out changeset aa5ec3aa1535 (bug 1731564)
Backed out changeset 73b648f1fa70 (bug 1731564)
Backed out changeset bb8fb0f9833e (bug 1731564)
Backed out changeset 0d8905144f5d (bug 1731564)
Backed out changeset 2cfb094a1ec3 (bug 1731564)
Backed out changeset 78d3b0257a6a (bug 1731564)
Backed out changeset e9d32926e93c (bug 1731564)
Backed out changeset 874cab520ce5 (bug 1731564)
Backed out changeset d8071cc32bd9 (bug 1731564)
Backed out changeset 283c5393cbbc (bug 1731564)
Backed out changeset 317bc38e3de5 (bug 1731564)
Backed out changeset 53e3f4862439 (bug 1731564)
2021-10-07 00:09:19 +03:00
Jens Stutte 620a8f3747 Bug 1731564: Use motivated SpinEventLoopUntil inside widget/*. r=smaug
Depends on D127235

Differential Revision: https://phabricator.services.mozilla.com/D127236
2021-10-06 19:45:17 +00:00
sotaro 37c0d94749 Bug 1732733 - Add support of window occlusion on Windows by disabling it by pref r=jrmuizel,gfx-reviewers
Implementation is basically borrowed from chromium's NativeWindowOcclusionTrackerWin. For now, window occlusion could be applied only to toplevel window with compositor. Overview of current implementation is the following.
https://github.com/sotaroikeda/firefox-diagrams/blob/master/widget/widget_WinWindowOcclusionTracker_94.pdf

Capability of window occlusion is disabled by pref. VirtualDesktop handling is going to be handled by Bug 1732737.
nsPrintDialogUtil.cpp is moved to non-unified source to avoid build failure.

Differential Revision: https://phabricator.services.mozilla.com/D126710
2021-10-06 07:21:59 +00:00
Florian Quèze 8ae91181d2 Bug 1729285 - Observers used with NS_NewTimerWithObserver should implement nsINamed, r=smaug.
Differential Revision: https://phabricator.services.mozilla.com/D124619
2021-09-07 08:01:19 +00:00
Chris Martin ba95f0d758 Bug 1701757 - Change clipboard format static initializers to lazy statics r=tkikuchi,bobowen
Differential Revision: https://phabricator.services.mozilla.com/D110147
2021-03-30 13:04:03 +00:00
Alexis Beingessner b376547204 Bug 1686616 - make StringBundle use Components instead of Services. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D105531
2021-02-18 13:26:32 +00:00
Tim Huang 4ebaa63406 Bug 1689600 - Making the Drag&Drop downloading be aware of cookieJarSettings on Windows platform. r=smaug
The channel used on Windows for Drag&Drop downloading doesn't have the correct
cookieJarSettings. The patch fixes this issue that it will pass the
correct cookieJarSettings to the channel.

Differential Revision: https://phabricator.services.mozilla.com/D103678
2021-02-03 13:22:16 +00:00
Masatoshi Kimura 279bad6dbb Bug 1682103 - Make nsContentPolicyType a CEnum type. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D99580
2020-12-16 11:36:47 +00:00
Simon Giesecke c83a083a0c Bug 1676365 - Move SpinEventLoopUntil to separate header. r=#xpcom-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96556

Depends on D96554
2020-11-23 16:10:41 +00:00
Simon Giesecke 6234f47ba2 Bug 1669419 - Remove unnecessary literal string constant from nsDataObj::CMemStream::Stat. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D92617
2020-10-13 21:39:09 +00:00
Simon Giesecke 29be3fd4d5 Bug 1668757 - Fix lifetime extension issues with 0-length literals. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D92179
2020-10-06 15:03:01 +00:00
Simon Giesecke ab6f0a7137 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Frederik Braun 617d3006d9 Bug 1366973: Rename security flags to not contain DATA anymore r=geckoview-reviewers,ckerschb,snorp
Differential Revision: https://phabricator.services.mozilla.com/D83490
2020-07-15 11:20:45 +00:00
Simon Giesecke d2e71d5859 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Simon Giesecke a69d79b6db Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Masatoshi Kimura 099eadbe57 Bug 1636740 - Block CMemStream::Read only if the drop target initiated an async operation. r=aklotz
If the drop target did not initiate an async operation, `DoDragDrop` will
block on the main thread until the data transfer completes. Although the
`ObtainCachedIconFile` callback itself will run off the main thread,
`ObtainCachedIconFile` will end up with calling `NotifyIconObservers` that
heavily relies on the main thread. So `ObtainCachedIconFile` will have no
chance to run the callback.

To complete the data transfer, however, the `ObtainCachedIconFile` callback
must signal the event object to unblock `CMemStream::Read`. Deadlock.

Differential Revision: https://phabricator.services.mozilla.com/D75531
2020-05-20 14:07:19 +00:00
Nicklas Boman 72b2085951 Bug 1515419 - fixing ToNewCString (and ToNewUnicode as well) xpcom/string/nsReadableUtils.cpp r=froydnj,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D17411
2020-05-17 06:58:48 +00:00
Tim Huang 37f162c69d Bug 1616570 - Part 1: Rename CookieSettings to CookieJarSettings. r=Ehsan
Given that we are going to add ContentBlockingAllowList in
CookieSettings, so CookieSettings will be responsible for more stuff than the
cookie behavior and cookie permission. We should use a proper name to
reflect the purpose of it. The name 'CookieSettings' is misleading that
this is only for cookie related stuff. So, we decide to rename
'CookieSettins' to 'CookieJarSettings' which serves better meaning here.

Differential Revision: https://phabricator.services.mozilla.com/D63935
2020-03-04 08:59:08 +00:00
Masatoshi Kimura 0a09fdcb6b Bug 1615293 - Do not free global memory when TYMED_HGLOBAL is selected. r=masayuki
The caller will take the ownership in this case.

Differential Revision: https://phabricator.services.mozilla.com/D64055
2020-03-02 02:52:26 +00:00
Masatoshi Kimura fdd15e188a Bug 1602615 - Add a support for free-threaded IStream to handle Internet shortcuts. r=jmathies
By making the IStream object free-threaded (or "agile"), IStream::Read will be
called off the main thread. So we can wait until favicon is created.

Depends on D56478

Differential Revision: https://phabricator.services.mozilla.com/D56479
2020-01-06 13:31:47 +00:00
Masatoshi Kimura 8bff061855 Bug 1602615 - Add a callback parameter to ObtainCachedIconFile and use it in GetFileContentsInternetShortcut. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D56478
2020-01-06 13:31:54 +00:00
Gabriele Svelto f03cdb2b2d Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55444
2019-12-06 09:17:57 +00:00