Commit Graph

2791 Commits

Author SHA1 Message Date
Gijs Kruitbosch
29de7f7b00 Bug 1596668, r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D58206

--HG--
extra : moz-landing-system : lando
2020-01-11 16:04:19 +00:00
Toshihito Kikuchi
7b04cb1b04 Bug 1602726 - Fall back to ShellExecuteEx if ShellExecuteByExplorer fails. r=aklotz
It turned out that `ShellExecuteByExplorer` does not work on VDI such as Citrix
or Microsoft RemoteApp.  This patch adds a fallback to the original launching
code if `ShellExecuteByExplorer` fails.  This will be a temporary solution until
we find out a way to solve both interop issues `PreferSystem32Images` and VDI.

Differential Revision: https://phabricator.services.mozilla.com/D58054

--HG--
extra : moz-landing-system : lando
2020-01-08 16:41:03 +00:00
Eric Rahm
6012f510a8 Bug 1241518 - Part 2: Use Maybe instead of nsAutoPtr in nsInputStreamTee r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D58283

--HG--
extra : moz-landing-system : lando
2020-01-07 00:06:02 +00:00
Eric Rahm
6d75492859 Bug 1241518 - Part 1: Remove unused nsAutoPtr.h includes in xpcom/ r=kmag
This removes various unused `#include "nsAutoPtr.h"` in `xpcom/`. Additionally
adds a few includes to the media stack.

Differential Revision: https://phabricator.services.mozilla.com/D58282

--HG--
extra : moz-landing-system : lando
2020-01-07 00:06:01 +00:00
Chris Peterson
406763af7f Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

Differential Revision: https://phabricator.services.mozilla.com/D56440

--HG--
extra : moz-landing-system : lando
2019-12-20 07:16:43 +00:00
Gabriele Svelto
5dc21d568c 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

--HG--
extra : moz-landing-system : lando
2019-12-06 09:17:57 +00:00
Kershaw Chang
f3bddbd52b Bug 1596409 - P1.1: Make socket process support IPCStream r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D54289

--HG--
extra : moz-landing-system : lando
2019-12-03 13:41:58 +00:00
Emilio Cobos Álvarez
d11fea7f89 Bug 1599614 - nsDirectoryService::SetCurrentProcessDirectory is infallible. r=froydnj
Depends on D54829

Differential Revision: https://phabricator.services.mozilla.com/D54830

--HG--
extra : moz-landing-system : lando
2019-12-02 13:56:14 +00:00
Toshihito Kikuchi
7d84bc7ec1 Bug 1597963 - Pass VT_ERROR for Explorer to call ShellExecuteExW with null verb. r=aklotz
The patch for Bug 1588975 specified the "open" verb to execute a target, but
the default verb is not always "open".  For example, the default verb for a font
file is "preview".  We should specify null verb to start the default operation.

Now we use `IShellDispatch2.ShellExecute` to ask explorer.exe to call
`ShellExecuteExW`.  That method takes an optional `VARIANT` parameter as a verb.
According to https://devblogs.microsoft.com/oldnewthing/20140919-00/?p=44023,
we need to pass `VT_ERROR` to omit an optional parameter.  If we pass
other values such as `nullptr` with `VT_BSTR` or `VT_EMPTY`, explorer.exe calls
`ShellExecuteExW` with the empty string `""` instead of `nullptr`, which is not
considered as a valid verb if the target file is not associated with any app.

Differential Revision: https://phabricator.services.mozilla.com/D54036

--HG--
extra : moz-landing-system : lando
2019-11-22 22:52:00 +00:00
Toshihito Kikuchi
e01d0b296f Bug 1597794 - Return NS_ERROR_FILE_EXECUTION_FAILED if shell failed to launch a file. r=aklotz
Calling `AsWin32Error()` for the return value from `ShellExecuteByExplorer` can
cause the crash because it may not be a Win32 error.  We simply return
`NS_ERROR_FILE_EXECUTION_FAILED` as we do in `nsProcess::RunProcess` or
`ShellExecuteWithIFile`.

We used to check the return value from `ShellExecuteExW` against `SE_ERR_NOASSOC`,
but it never happens because `SE_ERR_` is returned as `SHELLEXECUTEINFO::hInstApp`.
No worry about the no-association case because `IShellDispatch2.ShellExecute`
displays the "How do you want to open this file?" popup when needed.

Differential Revision: https://phabricator.services.mozilla.com/D54052

--HG--
extra : moz-landing-system : lando
2019-11-22 21:11:24 +00:00
Toshihito Kikuchi
4d2777385a Bug 1588975 - Replace ShellExecuteExW with mozilla::ShellExecuteByExplorer. r=aklotz,asuth
The launcher process turns on the `PreferSystem32Images` mitigation policy for
the browser process.  Since the mitigation policy is inherited, a process launched
by the browser process also has `PreferSystem32Images`.  If an application which
does not support `PreferSystem32Images`, such as Skype for Business, is launched
via a hyperlink, a custom uri, or a downloaded file, it would fail to launch.

Bug 1567614 fixed this issue by introducing `mozilla::ShellExecuteByExplorer` to
`nsMIMEInfoWin::LoadUriInternal`.  This patch introduces
`mozilla::ShellExecuteByExplorer` to two more places.

1. xul!nsLocalFile::Launch
This is invoked when a user opens a file from the Download Library, or a user
opens a downloaded file with the default application without saving it.

2. xul!nsMIMEInfoWin::LaunchWithFile
This is invoked when a user opens a downloaded file with a custom application
(configured in about:preference) without saving it.

*Why does this patch change worker.js?*

The mochitest dom/tests/browser/browser_test_new_window_from_content.js failed
if it was executed after dom/serviceworkers/test/browser_download.js in the
same batch.  This was because browser_download.js launched Notepad to open
fake_download.bin.txt, preventing a new window from being opened in the
foreground in browser_test_new_window_from_content.js.

The test browser_download.js can verify downloaded data without opening an
associated application.  So this patch adds the content-type to the response
header in order not to open Notepad on Windows.

Differential Revision: https://phabricator.services.mozilla.com/D52567

--HG--
extra : moz-landing-system : lando
2019-11-14 19:47:29 +00:00
Sylvestre Ledru
d2eabf8906 Bug 1562642 - add missing license in xpcom/ r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D52579

--HG--
extra : moz-landing-system : lando
2019-11-11 21:44:32 +00:00
Matt Woodrow
1ec616f192 Bug 1593560 - Only return false from NS_InputStreamIsBuffered if the underlying object doesn't implement ReadSegments. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D51549

--HG--
extra : moz-landing-system : lando
2019-11-06 22:37:07 +00:00
Coroiu Cristina
cbdbc8bc4b Backed out 7 changesets (bug 1593560) for crashtest failures at tests/layout/base/crashtests/446328.html on a CLOSED TREE
Backed out changeset 7dfae085a4cb (bug 1593560)
Backed out changeset 9842c80c98d8 (bug 1593560)
Backed out changeset d67a10437af7 (bug 1593560)
Backed out changeset 3e3948e9531c (bug 1593560)
Backed out changeset a7d04e276b44 (bug 1593560)
Backed out changeset 9f52c9f6dc54 (bug 1593560)
Backed out changeset 90572c49d464 (bug 1593560)
2019-11-07 00:32:53 +02:00
Matt Woodrow
8e9f3c627d Bug 1593560 - Only return false from NS_InputStreamIsBuffered if the underlying object doesn't implement ReadSegments. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D51549

--HG--
extra : moz-landing-system : lando
2019-11-06 18:22:30 +00:00
Gijs Kruitbosch
608f3e7539 Bug 1545123 - simplify how we get directory information for plugins, r=handyman,mconley
In this change we:
- stop treating the nsPluginDirServiceProvider as a directory provider, as its
  GetFile implementation was a no-op anyway - registering it didn't make any
  difference.
- stop treating it as a class entirely, because the PLID getters were already
  static, so instantiating it also didn't do anything.
- move IO from the plugin directory list provider and the Windows-only PLID
  getters into nsPluginHost. This enables us to move it off of the main thread
  later - the directory getting has to happen on the main thread, but we can
  postpone further checks on the nsIFile instances.
- in the process, stop doing exists() calls on files because we can fail more
  lazily. This allows us to remove more allowlist entries from
  browser_startup_mainthreadio, though the `isDirectory` calls will actually
  still cause IO - they don't seem to create IO markers in the profiler.
  We will move this IO away from the main thread in subsequent commits.

Depends on D48328

Differential Revision: https://phabricator.services.mozilla.com/D48329

--HG--
extra : moz-landing-system : lando
2019-11-02 22:33:42 +00:00
Ciure Andrei
fdfd0105e6 Backed out 5 changesets (bug 1545123) for causing nsPluginTags.cpp build bustages CLOSED TREE
Backed out changeset 91313cceae8c (bug 1545123)
Backed out changeset d91549e68229 (bug 1545123)
Backed out changeset 269d89e09fbb (bug 1545123)
Backed out changeset a139ee115519 (bug 1545123)
Backed out changeset eb454f238f45 (bug 1545123)
2019-11-02 14:00:38 +02:00
Gijs Kruitbosch
c04f0a7345 Bug 1545123 - simplify how we get directory information for plugins, r=handyman,mconley
In this change we:
- stop treating the nsPluginDirServiceProvider as a directory provider, as its
  GetFile implementation was a no-op anyway - registering it didn't make any
  difference.
- stop treating it as a class entirely, because the PLID getters were already
  static, so instantiating it also didn't do anything.
- move IO from the plugin directory list provider and the Windows-only PLID
  getters into nsPluginHost. This enables us to move it off of the main thread
  later - the directory getting has to happen on the main thread, but we can
  postpone further checks on the nsIFile instances.
- in the process, stop doing exists() calls on files because we can fail more
  lazily. This allows us to remove more allowlist entries from
  browser_startup_mainthreadio, though the `isDirectory` calls will actually
  still cause IO - they don't seem to create IO markers in the profiler.
  We will move this IO away from the main thread in subsequent commits.

Depends on D48328

Differential Revision: https://phabricator.services.mozilla.com/D48329

--HG--
extra : moz-landing-system : lando
2019-10-29 05:30:29 +00:00
Andrea Marchesini
af392c3e5b Bug 1584898 - Free nsPipe memory on a separate thread, r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D50278

--HG--
extra : moz-landing-system : lando
2019-10-24 11:08:43 +00:00
Henri Sivonen
c193518677 Bug 1490601 part 2 - Move C++ entry points to encoding_c_mem to mfbt/. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D43957

--HG--
extra : moz-landing-system : lando
2019-09-18 08:26:34 +00:00
Gijs Kruitbosch
81785d9cb9 Bug 1163021 - add debug assert that directory service usage happens only on the main thread, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D45832

--HG--
extra : moz-landing-system : lando
2019-09-13 16:08:48 +00:00
Gijs Kruitbosch
b4ce4fda42 Bug 1580282 - Remove checks for plugins that are part of extensions and support for loading plugins from the app and profile dir, r=mconley,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D45450

--HG--
extra : moz-landing-system : lando
2019-09-12 23:15:49 +00:00
Gijs Kruitbosch
e3898f89a1 Bug 1163079 - ensure we fetch app/profile dir information on the main thread in GeckoChildProcessHost r=jld,bryce,haik
Differential Revision: https://phabricator.services.mozilla.com/D42860

--HG--
extra : moz-landing-system : lando
2019-09-04 12:04:52 +00:00
Gijs Kruitbosch
10013b939f Bug 1575566 - stop using the directory service when creating anonymous temporary files, r=froydnj
Note that this code asserts it gets run in the parent process, so we can be sure that we never
want the content process sandbox-accessible dir or similar (though tbf, that seems odd given
we have DOM machinery to proxy from the child to here... but that's what happens today).

This will start using the actual temp dir even in the case of e.g. xpcshell, which normally
dependency-injects a different (also temp) dir and reuses it as the profile as well as temp
dir ( https://searchfox.org/mozilla-central/rev/03853a6e87c4a9405fce1de49e5d03b9e7a7a274/testing/xpcshell/head.js#1207-1226 )
if and only if anything calls do_get_profile .

I think this is likely OK... but if not, we'll have to come up with a more complicated
solution...

Differential Revision: https://phabricator.services.mozilla.com/D42950

--HG--
extra : moz-landing-system : lando
2019-08-23 14:00:27 +00:00
Honza Bambas
2da6575574 Bug 1561912, r=michal
Differential Revision: https://phabricator.services.mozilla.com/D37297

--HG--
extra : moz-landing-system : lando
2019-07-26 22:58:39 +00:00
Boris Zbarsky
0f70d08ec8 Bug 1566595. Stop using [array] in nsIBinaryOutputStream. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D38387

--HG--
extra : moz-landing-system : lando
2019-07-22 20:27:39 +00:00
Ciure Andrei
98278afa46 Backed out changeset a858e4411532 (bug 1566595) for causing Windows MinGW builds bustages CLOSED TREE 2019-07-22 21:39:08 +03:00
Boris Zbarsky
9c74919340 Bug 1566595. Stop using [array] in nsIBinaryOutputStream. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D38387

--HG--
extra : moz-landing-system : lando
2019-07-22 14:52:04 +00:00
Boris Zbarsky
cadd9a872e Bug 1565627. Stop using [array] in nsIBinaryInputStream. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D37897

--HG--
extra : moz-landing-system : lando
2019-07-16 18:39:16 +00:00
Barret Rennie
9d33bd810d Bug 1289211 - Rename InfallibleTArray to nsTArray in xpcom/ r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D36970

--HG--
extra : moz-landing-system : lando
2019-07-10 03:33:59 +00:00
Masatoshi Kimura
c0b1864c56 Bug 1559403 - Implement nsIStringInputStream.setUTF8Data. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D35027

--HG--
extra : moz-landing-system : lando
2019-06-14 15:48:41 +00:00
Jonathan Kingston
a9be4620ee Bug 1508939 - cpp serialization r=ckerschb,mccr8,mikedeboer
Migrating to pure Cpp

Differential Revision: https://phabricator.services.mozilla.com/D29221

--HG--
extra : moz-landing-system : lando
2019-06-03 12:37:12 +00:00
Sylvestre Ledru
d57d4905f1 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D30883

--HG--
extra : moz-landing-system : lando
2019-05-25 17:46:15 +00:00
arthur.iakab
af8e458c5f Backed out changeset a296439a25ff (bug 1519636) for frequent Windows cppunit failures CLOSED TREE 2019-05-24 14:26:01 +03:00
Sylvestre Ledru
c82ea97226 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D30883

--HG--
extra : moz-landing-system : lando
2019-05-24 09:59:17 +00:00
Sylvestre Ledru
993c03acb1 Bug 1552795 - Remove all trailing whitespaces in idl files r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D31769

--HG--
extra : moz-landing-system : lando
2019-05-22 22:37:14 +00:00
Boris Zbarsky
b468b7b77b Bug 1551984. Improve OOM and overflow handling in NS_ConsumeStream. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31312

--HG--
extra : moz-landing-system : lando
2019-05-15 18:50:44 +00:00
Boris Zbarsky
2bf79c096c Bug 1551981. Add an nsTArray version of NS_ConsumeStream. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31299

--HG--
extra : moz-landing-system : lando
2019-05-15 18:29:28 +00:00
Boris Zbarsky
17561de5b9 Bug 1551962. Add a way to create an input stream from a moved nsTArray<uint8_t>. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31296

--HG--
extra : moz-landing-system : lando
2019-05-15 18:28:00 +00:00
Boris Zbarsky
d24853373a Bug 1551647. Stop using [array] in nsIProperties. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31110

--HG--
extra : moz-landing-system : lando
2019-05-14 18:46:13 +00:00
Andrew McCreight
2841945140 Bug 1550860 - Mark implicit builtinclass interfaces explicitly. r=nika
If an XPIDL interface has a method or attribute that is [notxpcom],
then it is implicitly treated as [builtinclass], even if it is not
marked as such. For clarity, this patch goes through and marks every
place that relies on this behavior (aside from some test code).

Differential Revision: https://phabricator.services.mozilla.com/D30714

--HG--
extra : moz-landing-system : lando
2019-05-13 19:51:49 +00:00
Andreea Pavel
accc389b66 Merge mozilla-inbound to mozilla-central. a=merge 2019-05-01 18:56:07 +03:00
Gijs Kruitbosch
01fbd8d525 Bug 1544009 - stop doing remote drive and directory exist/creation checks for renames/moves on Windows, esp. if in the same directory, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D29222

--HG--
extra : moz-landing-system : lando
2019-05-01 00:17:22 +00:00
Sylvestre Ledru
e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Ciure Andrei
58c8915ecd Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-04-04 00:57:38 +03:00
Dave Townsend
3dc26d41d2 Bug 1540854: Add MOZ_DBG support for nsIURI and nsIFile. r=froydnj
I am 90% sure that this is wrong but this is the only way I can get it to
compile and work. Unlike other examples of supporting MOZ_DBG it only declares
an operator for `nsIURI* not` `const nsIURI`. I had to drop the const because
then I couldn't call GetSpec as it isn't marked const. I had to switch to a
pointer since otherwise it would complain about virtual methods.

Still in practice this works, I think it is rare that we hold an nsIURI in
anything other than a pointer and same for the constness.

Differential Revision: https://phabricator.services.mozilla.com/D25669

--HG--
extra : rebase_source : 9760674375563ec312568caf4a5ad46facfb6f68
2019-04-01 15:05:37 -07:00
Honza Bambas
1296f23329 Bug 1538812 - Remove the dangerous default 'NS_ASSIGNMENT_DEPEND' of argument 'assignment' on NS_NewByteInputStream to let it be defined expicitly and thus visibly, r=michal
Differential Revision: https://phabricator.services.mozilla.com/D25462

--HG--
extra : moz-landing-system : lando
2019-04-03 11:39:41 +00:00
Sylvestre Ledru
ef0bfc3822 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D24168

--HG--
extra : moz-landing-system : lando
2019-03-31 15:12:55 +00:00
Boris Zbarsky
92f7b5dd5e Bug 1539716. Remove nsIHashable. r=froydnj
It's dead code.

Differential Revision: https://phabricator.services.mozilla.com/D25190

--HG--
extra : moz-landing-system : lando
2019-03-28 13:07:05 +00:00
Alex Gaynor
177fb00eba Bug 1375863 - fold MOZ_CONTENT_SANDBOX and MOZ_GMP_SANDBOX into MOZ_SANDBOX; r=jld,firefox-build-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D22975

--HG--
extra : moz-landing-system : lando
2019-03-18 22:31:59 +00:00