Граф коммитов

431 Коммитов

Автор SHA1 Сообщение Дата
Mike Hommey 5af31a8886 Bug 1839762 - Cast scoped enums to their underlying type when printing them. r=media-playback-reviewers,necko-reviewers,application-update-reviewers,geckoview-reviewers,handyman,emilio,valentin,bytesized,owlish,karlt
There is no implicit conversion for scoped enums, so using them without
an explicit conversion in varargs functions is undefined behavior. GCC
has had a warning about this for a long while, but clang only gained
this a few days ago on trunk.

Differential Revision: https://phabricator.services.mozilla.com/D181723
2023-06-24 20:14:31 +00:00
Landry Breuil 0c9ebbf909 Bug 1817945 - repair opening links from thunderbird r=stransky
Only affects OpenBSD-only codepaths.
Directly use g_app_info_launch_default_for_uri() if the scheme is http(s).
Regression from bug 1714919.

Differential Revision: https://phabricator.services.mozilla.com/D176211
2023-04-24 08:05:38 +00:00
Jan Horak e42200263f Bug 1621913 Don't show the defaultBrowserBox in settings under flatpak; r=settings-reviewers,Gijs
Under Flatpak we cannot determine if the application is set as default handler
for http/https protocols and also the application cannot set the system defaults.
In order to avoid user confusion we hide the defaultBrowserBox which
under flatpak shows always: "Firefox is not your default browser" and the
"Make Default..." button does not make any change to the system.

Differential Revision: https://phabricator.services.mozilla.com/D170590
2023-03-09 15:14:26 +00:00
Theo Buehler 719116aba8 Bug 1817588 - Ensure OpenBSD URI handlers set GError on failure r=gaston,stransky
There are various failure paths that result in NULL dereferences
of error. Fix this by setting the error explicitly to match the
API contract of the glib2 functions these OpenBSD specific functions
replace. The crashes are particularly annoying since they happen in
the main process. In addition, plug a number of memory leaks.

Differential Revision: https://phabricator.services.mozilla.com/D170476
2023-02-21 10:22:09 +00:00
Matthew Noorenberghe abe53493d4 Bug 1073717 - [Web Notifications] Add support for "silent" notifications with libnotify. r=stransky
Depends on D119591

Differential Revision: https://phabricator.services.mozilla.com/D119592
2023-01-07 01:03:53 +00:00
Nicholas Rishel 47a9fb5513 Bug 1787004 - Fix notifications not closing when `notification.close()` is called. r=nalexander,geckoview-reviewers,smaug,jonalmeida
This adds context to `CloseAlert()` such that explicitly closing the notification e.g. `notification.close()` can be differentiated from a tab or window implicitly closing the notification. This is necessary as we want notifications to persist after a tab or window is closed for Windows.

This change in behavior is necessary to match user expectations. Users expect notifications to persist in the system tray and do not expect notifications to be lost due to a tab being closed. The content of the message is more important than the interaction in that lens. This change is also necessary for parity with Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D161024
2023-01-06 18:36:23 +00:00
stransky cc588457ff Bug 1804877 [Wayland] Use RequestWaylandFocus()/XDG token in nsGIOService to launch external applications r=emilio
Depends on D165151

Differential Revision: https://phabricator.services.mozilla.com/D165152
2023-01-04 07:29:25 +00:00
Iulian Moraru cad9265ea8 Backed out 3 changesets (bug 1804877) for causing multiple build bustages. CLOSED TREE
Backed out changeset 0f042a90a90b (bug 1804877)
Backed out changeset 800f78104e83 (bug 1804877)
Backed out changeset a6f5a91e18da (bug 1804877)
2023-01-04 04:27:21 +02:00
stransky 13bc9c5768 Bug 1804877 [Wayland] Use RequestWaylandFocus()/XDG token in nsGIOService to launch external applications r=emilio
Depends on D165151

Differential Revision: https://phabricator.services.mozilla.com/D165152
2023-01-03 22:20:19 +00:00
Ben Hearsum 197dfd875f Bug 1797163: handle IAsyncOperations with callbacks and events instead of spinlocking r=nrishel
Also fixes a bug when assigning campaign ID from the extended JSON section (thanks to nrishel for noticing it!).

Differential Revision: https://phabricator.services.mozilla.com/D160543
2022-11-21 21:48:21 +00:00
Makoto Kato d5e022a38e Bug 1275849 - Part 2. Merge ProxyUtils for Windows and macOS. r=necko-reviewers,valentin
Actually, both diff is the following.

```diff
@@ -22,14 +19,17 @@
 static void NormalizeAddr(const nsACString& aAddr, nsCString& aNormalized) {
   nsTArray<nsCString> addr;
   ParseString(aAddr, '.', addr);
-  aNormalized =
-      StringJoin("."_ns, IntegerRange(4), [&addr](nsACString& dst, size_t i) {
-        if (i < addr.Length()) {
-          dst.Append(addr[i]);
-        } else {
-          dst.Append('0');
-        }
-      });
+  aNormalized = "";
+  for (uint32_t i = 0; i < 4; ++i) {
+    if (i != 0) {
+      aNormalized.AppendLiteral(".");
+    }
+    if (i < addr.Length()) {
+      aNormalized.Append(addr[i]);
+    } else {
+      aNormalized.AppendLiteral("0");
+    }
+  }
 }
```

So we should share this on Windows and macOS.

Also, since gtest is same, we should merge it.

Differential Revision: https://phabricator.services.mozilla.com/D161232
2022-11-08 09:19:09 +00:00
Makoto Kato 02f2c0e21f Bug 1275849 - Part 1. Convert ProxyUtils from Objective-C++ to C++. r=necko-reviewers,valentin
`ProxyUtils` of macOS version doesn't use Objective-C++ features, so we can
change it to C++.

Differential Revision: https://phabricator.services.mozilla.com/D161231
2022-11-08 09:19:09 +00:00
marz 7e53e8854b Bug 1797896 - Proxy environment variables can be uppercase on linux now r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D161108
2022-11-03 09:48:27 +00:00
Ben Hearsum fe0d32d830 Bug 1795958: don't block windows package manager operations on successful completion of async operations. r=rkraesig
I've been unable to find confirmation of this (there is basically zero guidance on how to work with these from plain C++ as far as I can tell), but the available states imply that async operations will begin in Started, and then change to one of the other ones later.

Differential Revision: https://phabricator.services.mozilla.com/D159797
2022-10-20 16:05:59 +00:00
Landry Breuil 118080259d Bug 1714919 - fix mime handler spawning with glib >= 2.64 badly interacting with OpenBSD sandboxing r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D117338
2022-09-15 13:36:43 +00:00
Nika Layzell c15823d075 Bug 1772006 - Part 5: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-07-30 00:12:48 +00:00
criss c6b2c5db61 Backed out 9 changesets (bug 1772006) causing build bustages on nsTString.cpp. CLOSED TREE
Backed out changeset f17c7565707b (bug 1772006)
Backed out changeset c725fe1f5882 (bug 1772006)
Backed out changeset d19663161261 (bug 1772006)
Backed out changeset b6611ab002d9 (bug 1772006)
Backed out changeset 790f42b64af9 (bug 1772006)
Backed out changeset 79a734b4e4d9 (bug 1772006)
Backed out changeset 42730aae16ea (bug 1772006)
Backed out changeset b2542aef3054 (bug 1772006)
Backed out changeset 962bfea4a309 (bug 1772006)
2022-06-11 01:13:42 +03:00
Nika Layzell b3c13bf114 Bug 1772006 - Part 6: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-06-10 21:12:08 +00:00
Alexandre Lissy fc7062ad6d Bug 1772063 - Use Portal for Snap/Flatpak r=OlivierTilloy,emilio
Differential Revision: https://phabricator.services.mozilla.com/D148782
2022-06-10 11:34:32 +00:00
Sylvestre Ledru 42f6811d95 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
2022-06-07 12:32:55 +00:00
Mike Hommey af52d87089 Bug 1766561 - Use proper formatting directives in various places. r=gfx-reviewers,nika,necko-reviewers,mhowell,rkraesig,bytesized,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D144920
2022-05-03 20:49:09 +00:00
Mike Hommey 12df1ed1b6 Bug 1766561 - Use %lu for Windows Error types (DWORD). r=rkraesig,xpcom-reviewers,application-update-reviewers,mhowell,bobowen,necko-reviewers,keeler,media-playback-reviewers,bytesized,barret,alwu,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D144914
2022-05-03 20:49:07 +00:00
Serge Guelton 7648a84eba Bug 1765593 - Cleanup mozilla-unified includes r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D144202
2022-05-03 14:57:45 +00:00
Mike Hommey 028ad1b883 Bug 1766377 - Fix remaining sign-compare warnings in Windows builds. r=rkraesig,gsvelto,media-playback-reviewers,gfx-reviewers,bryce,sotaro
browser/components/shell/WindowsUserChoice.cpp(233,23): error: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long long') [-Werror,-Wsign-compare]
    for (int j = 0; j < DWORDS_PER_BLOCK; ++j) {
                    ~ ^ ~~~~~~~~~~~~~~~~
browser/components/shell/WindowsUserChoice.cpp(388,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(exts); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~
browser/components/shell/nsWindowsShellService.cpp(1225,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(shortcutCSIDLs); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
browser/components/shell/nsWindowsShellService.cpp(1492,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(folders); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~
dom/media/platforms/wmf/MFTDecoder.cpp(85,23): error: comparison of integers of different signs: 'int' and 'UINT32' (aka 'unsigned int') [-Werror,-Wsign-compare]
    for (int i = 1; i < actsNum; i++) {
                    ~ ^ ~~~~~~~
gfx/2d/Factory.cpp(1276,21): error: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Werror,-Wsign-compare]
  for (int y = 0; y < height; y++) {
                  ~ ^ ~~~~~~
gfx/layers/d3d11/CompositorD3D11.cpp(1096,36): error: comparison of integers of different signs: 'UINT' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare]
        swapDesc.BufferDesc.Height == mSize.height) ||
        ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~
gfx/layers/d3d11/CompositorD3D11.cpp(1095,35): error: comparison of integers of different signs: 'UINT' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare]
  if (((swapDesc.BufferDesc.Width == mSize.width &&
        ~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
gfx/layers/d3d11/TextureD3D11.cpp(1278,30): error: comparison of integers of different signs: 'UINT' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare]
          currentDesc.Height != mSize.height ||
          ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~
gfx/layers/d3d11/TextureD3D11.cpp(1277,29): error: comparison of integers of different signs: 'UINT' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare]
      if (currentDesc.Width != mSize.width ||
          ~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
gfx/layers/ipc/ContentCompositorBridgeParent.cpp(248,19): error: comparison of integers of different signs: 'const uint32_t' (aka 'const unsigned int') and 'int32_t' (aka 'int') [-Werror,-Wsign-compare]
  if (sequenceNum == status.sequenceNumber() && !dm->HasDeviceReset()) {
      ~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~
gfx/thebes/D3D11Checks.cpp(129,21): error: comparison of integers of different signs: 'int' and 'unsigned int' [-Werror,-Wsign-compare]
    if (resultColor != 0xffffff00) {
        ~~~~~~~~~~~ ^  ~~~~~~~~~~
gfx/thebes/D3D11Checks.cpp(154,23): error: comparison of integers of different signs: 'int' and 'unsigned long long' [-Werror,-Wsign-compare]
    for (int i = 0; i < PR_ARRAY_SIZE(checkModules); i += 1) {
                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
gfx/thebes/D3D11Checks.cpp(409,14): error: comparison of integers of different signs: 'int32_t' (aka 'int') and 'UINT' (aka 'unsigned int') [-Werror,-Wsign-compare]
  if (vendor != desc.VendorId) {
      ~~~~~~ ^  ~~~~~~~~~~~~~
gfx/thebes/gfxDWriteFontList.cpp(1248,39): error: comparison of integers of different signs: 'unsigned int' and 'int' [-Werror,-Wsign-compare]
        addFamily(names[index], index != sysLocIndex);
                                ~~~~~ ^  ~~~~~~~~~~~
intl/lwbrk/nsUniscribeBreaker.cpp(121,21): error: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Werror,-Wsign-compare]
  for (int i = 0; i < aLength; ++i) {
                  ~ ^ ~~~~~~~
intl/lwbrk/nsUniscribeBreaker.cpp(132,23): error: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Werror,-Wsign-compare]
    for (int i = 0; i < aLength; ++i) {
                    ~ ^ ~~~~~~~
intl/lwbrk/nsUniscribeBreaker.cpp(138,23): error: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Werror,-Wsign-compare]
    for (int i = 0; i < aLength; ++i) {
                    ~ ^ ~~~~~~~
mozglue/misc/PreXULSkeletonUI.cpp(319,26): error: comparison of integers of different signs: 'std::basic_string<char>::size_type' (aka 'unsigned long long') and 'int' [-Werror,-Wsign-compare]
    while (line.length() > whitespace &&
           ~~~~~~~~~~~~~ ^ ~~~~~~~~~~
mozglue/misc/PreXULSkeletonUI.cpp(1003,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 1; i < noPlaceholderSpans.length(); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
mozglue/misc/PreXULSkeletonUI.cpp(1708,21): error: comparison of integers of different signs: 'int' and 'unsigned long long' [-Werror,-Wsign-compare]
  for (int i = 0; i < dataLen / (2 * sizeof(double)); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
security/sandbox/chromium-shim/sandbox/win/permissionsService.cpp(40,16): error: comparison of integers of different signs: 'int' and 'const std::basic_string<wchar_t>::size_type' (aka 'const unsigned long long') [-Werror,-Wsign-compare]
  if (slashIdx != std::wstring::npos) {
      ~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~
toolkit/components/aboutthirdparty/tests/gtest/TestAboutThirdParty.cpp(107,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(kDirectoriesUnsorted); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/crashreporter/breakpad-client/windows/crash_generation/crash_generation_server.cc(957,23): error: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long long') [-Werror,-Wsign-compare]
    for (int i = 0; i < kExceptionAppMemoryRegions; i++) {
                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/crashreporter/client/crashreporter_win.cpp(373,21): error: comparison of integers of different signs: 'int' and 'unsigned long long' [-Werror,-Wsign-compare]
  for (int i = 0; i < sizeof(kDefaultAttachedBottom) / sizeof(UINT); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/crashreporter/client/crashreporter_win.cpp(671,21): error: comparison of integers of different signs: 'int' and 'unsigned long long' [-Werror,-Wsign-compare]
  for (int i = 0; i < sizeof(controls) / sizeof(controls[0]); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/crashreporter/client/crashreporter_win.cpp(1048,21): error: comparison of integers of different signs: 'int' and 'unsigned long long' [-Werror,-Wsign-compare]
  for (int i = 0; i < sizeof(kDefaultAttachedBottom) / sizeof(UINT); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/mozapps/defaultagent/SetDefaultBrowser.cpp(248,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < mozilla::ArrayLength(associations); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/system/windowsproxy/ProxyUtils.cpp(27,36): error: comparison of integers of different signs: 'const int' and 'nsTArray_base::size_type' (aka 'unsigned long long') [-Werror,-Wsign-compare]
                             if (i < addr.Length()) {
                                 ~ ^ ~~~~~~~~~~~~~
toolkit/xre/dllservices/mozglue/interceptor/Arm64.h(178,28): error: comparison of integers of different signs: 'int32_t' (aka 'int') and 'unsigned int' [-Werror,-Wsign-compare]
  if (signbits && signbits != 0xFE000000) {
                  ~~~~~~~~ ^  ~~~~~~~~~~
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned int, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp(35,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned int, int, nullptr>' requested here
    EXPECT_EQ(mCounters.Count(), N);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp(210,28): note: in instantiation of function template specialization 'ModuleLoadCounter::Remains<1>' requested here
    EXPECT_TRUE(waitForOne.Remains({kTestModules[0]}, {0}));
                           ^
toolkit/xre/test/gtest/TestAssembleCommandLineWin.cpp(139,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(kExpectedArgsW); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/xre/test/gtest/TestAssembleCommandLineWin.cpp(151,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(kExpectedArgsW); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/xre/test/gtest/TestAssembleCommandLineWin.cpp(164,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(kExpectedArgsW); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const int' and 'const unsigned long long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<int, unsigned long long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/xre/test/gtest/TestAssembleCommandLineWin.cpp(138,3): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<int, unsigned long long, nullptr>' requested here
  EXPECT_EQ(len, ArrayLength(kExpectedArgsW));
  ^
widget/windows/TSFTextStore.cpp(3455,28): error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'long' [-Werror,-Wsign-compare]
          range.mEndOffset == end - mComposition->StartOffset() &&
          ~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
widget/windows/TSFTextStore.cpp(3454,30): error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'long' [-Werror,-Wsign-compare]
      if (range.mStartOffset == start - mComposition->StartOffset() &&
          ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xpfe/appshell/AppWindow.cpp(1900,21): error: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Werror,-Wsign-compare]
  for (int i = 0; i < toolbarSprings->Length(); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~

Differential Revision: https://phabricator.services.mozilla.com/D144695
2022-04-29 09:14:12 +00:00
Mike Hommey a6aa1ef6f9 Bug 1766377 - Fix sign-compare warnings related to constants in gtests. r=nika,mossop
obj-build/dist/include/gtest/gtest.h(1440,28): error: comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Werror,-Wsign-compare]
GTEST_IMPL_CMP_HELPER_(GT, >)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
obj-build/dist/include/gtest/gtest.h(1422,14): note: expanded from macro 'GTEST_IMPL_CMP_HELPER_'
    if (val1 op val2) {                                                    \
        ~~~~ ^  ~~~~
toolkit/system/windowsPackageManager/tests/gtest/TestWindowsPackageManager.cpp(22,3): note: in instantiation of function template specialization 'testing::internal::CmpHelperGT<unsigned long long, int>' requested here
  ASSERT_GT(packages.Length(), 0);
  ^
obj-build/dist/include/gtest/gtest.h(1891,31): note: expanded from macro 'ASSERT_GT'
                              ^
obj-build/dist/include/gtest/gtest.h(1865,44): note: expanded from macro 'GTEST_ASSERT_GT'
  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
                                           ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long long, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/system/windowsPackageManager/tests/gtest/TestWindowsPackageManager.cpp(33,3): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long long, int, nullptr>' requested here
  ASSERT_EQ(packages.Length(), 0);
  ^
obj-build/dist/include/gtest/gtest.h(1871,31): note: expanded from macro 'ASSERT_EQ'
                              ^
obj-build/dist/include/gtest/gtest.h(1855,54): note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const int' and 'const unsigned int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<int, unsigned int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/system/windowsDHCPClient/tests/gtest/TestDHCPUtils.cpp(232,3): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<int, unsigned int, nullptr>' requested here
  ASSERT_EQ(0, size);
  ^
obj-build/dist/include/gtest/gtest.h(1871,31): note: expanded from macro 'ASSERT_EQ'
                              ^
obj-build/dist/include/gtest/gtest.h(1855,54): note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned int, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/mozapps/defaultagent/tests/gtest/CacheTest.cpp(67,3): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned int, int, nullptr>' requested here
  ASSERT_EQ(Cache::kDefaultCapacity, 2);
  ^
obj-build/dist/include/gtest/gtest.h(1871,31): note: expanded from macro 'ASSERT_EQ'
                              ^
obj-build/dist/include/gtest/gtest.h(1855,54): note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1440,28): error: comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Werror,-Wsign-compare]
GTEST_IMPL_CMP_HELPER_(GT, >)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
obj-build/dist/include/gtest/gtest.h(1422,14): note: expanded from macro 'GTEST_IMPL_CMP_HELPER_'
    if (val1 op val2) {                                                    \
        ~~~~ ^  ~~~~
toolkit/xre/dllservices/tests/gtest/TestDLLBlocklist.cpp(123,5): note: in instantiation of function template specialization 'testing::internal::CmpHelperGT<unsigned long long, int>' requested here
    EXPECT_GT(strlen(pEntry->mName), 3);
    ^
obj-build/dist/include/gtest/gtest.h(1852,44): note: expanded from macro 'EXPECT_GT'
  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
                                           ^
In file included from Unified_cpp_xpcom_tests_gtest0.cpp:2:
In file included from xpcom/tests/gtest/Helpers.cpp:12:
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long long, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
xpcom/tests/gtest/TestAvailableMemoryWatcherWin.cpp(483,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long long, int, nullptr>' requested here
    EXPECT_EQ(tokens.Length(), 3);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long long, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp(211,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long long, int, nullptr>' requested here
    EXPECT_EQ(collector.Data().length(), 1);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned int, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp(310,7): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned int, int, nullptr>' requested here
      EXPECT_EQ(evt.mLoadStatus, 0);
      ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1440,28): error: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Werror,-Wsign-compare]
GTEST_IMPL_CMP_HELPER_(GT, >)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
obj-build/dist/include/gtest/gtest.h(1422,14): note: expanded from macro 'GTEST_IMPL_CMP_HELPER_'
    if (val1 op val2) {                                                    \
        ~~~~ ^  ~~~~
toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp(332,3): note: in instantiation of function template specialization 'testing::internal::CmpHelperGT<unsigned int, int>' requested here
  EXPECT_GT(aData.mNumEvents, 0);
  ^
obj-build/dist/include/gtest/gtest.h(1852,44): note: expanded from macro 'EXPECT_GT'
  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
                                           ^

Differential Revision: https://phabricator.services.mozilla.com/D144694
2022-04-29 09:14:12 +00:00
Norisz Fay 6e06e2da92 Backed out 4 changesets (bug 1766377) for causing mochitest failures on HyperTextAccessible.cpp CLOSED TREE
Backed out changeset 6335511477a4 (bug 1766377)
Backed out changeset e8108d6fab9f (bug 1766377)
Backed out changeset 80d16d55c490 (bug 1766377)
Backed out changeset 1a6583d6e52e (bug 1766377)
2022-04-29 07:35:11 +03:00
Mike Hommey 9cd056be1e Bug 1766377 - Fix remaining sign-compare warnings in Windows builds. r=rkraesig,gsvelto,media-playback-reviewers,gfx-reviewers,bryce,sotaro
browser/components/shell/WindowsUserChoice.cpp(233,23): error: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long long') [-Werror,-Wsign-compare]
    for (int j = 0; j < DWORDS_PER_BLOCK; ++j) {
                    ~ ^ ~~~~~~~~~~~~~~~~
browser/components/shell/WindowsUserChoice.cpp(388,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(exts); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~
browser/components/shell/nsWindowsShellService.cpp(1225,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(shortcutCSIDLs); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
browser/components/shell/nsWindowsShellService.cpp(1492,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(folders); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~
dom/media/platforms/wmf/MFTDecoder.cpp(85,23): error: comparison of integers of different signs: 'int' and 'UINT32' (aka 'unsigned int') [-Werror,-Wsign-compare]
    for (int i = 1; i < actsNum; i++) {
                    ~ ^ ~~~~~~~
gfx/2d/Factory.cpp(1276,21): error: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Werror,-Wsign-compare]
  for (int y = 0; y < height; y++) {
                  ~ ^ ~~~~~~
gfx/layers/d3d11/CompositorD3D11.cpp(1096,36): error: comparison of integers of different signs: 'UINT' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare]
        swapDesc.BufferDesc.Height == mSize.height) ||
        ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~
gfx/layers/d3d11/CompositorD3D11.cpp(1095,35): error: comparison of integers of different signs: 'UINT' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare]
  if (((swapDesc.BufferDesc.Width == mSize.width &&
        ~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
gfx/layers/d3d11/TextureD3D11.cpp(1278,30): error: comparison of integers of different signs: 'UINT' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare]
          currentDesc.Height != mSize.height ||
          ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~
gfx/layers/d3d11/TextureD3D11.cpp(1277,29): error: comparison of integers of different signs: 'UINT' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare]
      if (currentDesc.Width != mSize.width ||
          ~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
gfx/layers/ipc/ContentCompositorBridgeParent.cpp(248,19): error: comparison of integers of different signs: 'const uint32_t' (aka 'const unsigned int') and 'int32_t' (aka 'int') [-Werror,-Wsign-compare]
  if (sequenceNum == status.sequenceNumber() && !dm->HasDeviceReset()) {
      ~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~
gfx/thebes/D3D11Checks.cpp(129,21): error: comparison of integers of different signs: 'int' and 'unsigned int' [-Werror,-Wsign-compare]
    if (resultColor != 0xffffff00) {
        ~~~~~~~~~~~ ^  ~~~~~~~~~~
gfx/thebes/D3D11Checks.cpp(154,23): error: comparison of integers of different signs: 'int' and 'unsigned long long' [-Werror,-Wsign-compare]
    for (int i = 0; i < PR_ARRAY_SIZE(checkModules); i += 1) {
                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
gfx/thebes/D3D11Checks.cpp(409,14): error: comparison of integers of different signs: 'int32_t' (aka 'int') and 'UINT' (aka 'unsigned int') [-Werror,-Wsign-compare]
  if (vendor != desc.VendorId) {
      ~~~~~~ ^  ~~~~~~~~~~~~~
gfx/thebes/gfxDWriteFontList.cpp(1248,39): error: comparison of integers of different signs: 'unsigned int' and 'int' [-Werror,-Wsign-compare]
        addFamily(names[index], index != sysLocIndex);
                                ~~~~~ ^  ~~~~~~~~~~~
intl/lwbrk/nsUniscribeBreaker.cpp(121,21): error: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Werror,-Wsign-compare]
  for (int i = 0; i < aLength; ++i) {
                  ~ ^ ~~~~~~~
intl/lwbrk/nsUniscribeBreaker.cpp(132,23): error: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Werror,-Wsign-compare]
    for (int i = 0; i < aLength; ++i) {
                    ~ ^ ~~~~~~~
intl/lwbrk/nsUniscribeBreaker.cpp(138,23): error: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Werror,-Wsign-compare]
    for (int i = 0; i < aLength; ++i) {
                    ~ ^ ~~~~~~~
mozglue/misc/PreXULSkeletonUI.cpp(319,26): error: comparison of integers of different signs: 'std::basic_string<char>::size_type' (aka 'unsigned long long') and 'int' [-Werror,-Wsign-compare]
    while (line.length() > whitespace &&
           ~~~~~~~~~~~~~ ^ ~~~~~~~~~~
mozglue/misc/PreXULSkeletonUI.cpp(1003,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 1; i < noPlaceholderSpans.length(); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
mozglue/misc/PreXULSkeletonUI.cpp(1708,21): error: comparison of integers of different signs: 'int' and 'unsigned long long' [-Werror,-Wsign-compare]
  for (int i = 0; i < dataLen / (2 * sizeof(double)); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
security/sandbox/chromium-shim/sandbox/win/permissionsService.cpp(40,16): error: comparison of integers of different signs: 'int' and 'const std::basic_string<wchar_t>::size_type' (aka 'const unsigned long long') [-Werror,-Wsign-compare]
  if (slashIdx != std::wstring::npos) {
      ~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~
toolkit/components/aboutthirdparty/tests/gtest/TestAboutThirdParty.cpp(107,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(kDirectoriesUnsorted); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/crashreporter/breakpad-client/windows/crash_generation/crash_generation_server.cc(957,23): error: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long long') [-Werror,-Wsign-compare]
    for (int i = 0; i < kExceptionAppMemoryRegions; i++) {
                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/crashreporter/client/crashreporter_win.cpp(373,21): error: comparison of integers of different signs: 'int' and 'unsigned long long' [-Werror,-Wsign-compare]
  for (int i = 0; i < sizeof(kDefaultAttachedBottom) / sizeof(UINT); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/crashreporter/client/crashreporter_win.cpp(671,21): error: comparison of integers of different signs: 'int' and 'unsigned long long' [-Werror,-Wsign-compare]
  for (int i = 0; i < sizeof(controls) / sizeof(controls[0]); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/crashreporter/client/crashreporter_win.cpp(1048,21): error: comparison of integers of different signs: 'int' and 'unsigned long long' [-Werror,-Wsign-compare]
  for (int i = 0; i < sizeof(kDefaultAttachedBottom) / sizeof(UINT); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/mozapps/defaultagent/SetDefaultBrowser.cpp(248,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < mozilla::ArrayLength(associations); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/system/windowsproxy/ProxyUtils.cpp(27,36): error: comparison of integers of different signs: 'const int' and 'nsTArray_base::size_type' (aka 'unsigned long long') [-Werror,-Wsign-compare]
                             if (i < addr.Length()) {
                                 ~ ^ ~~~~~~~~~~~~~
toolkit/xre/dllservices/mozglue/interceptor/Arm64.h(178,28): error: comparison of integers of different signs: 'int32_t' (aka 'int') and 'unsigned int' [-Werror,-Wsign-compare]
  if (signbits && signbits != 0xFE000000) {
                  ~~~~~~~~ ^  ~~~~~~~~~~
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned int, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp(35,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned int, int, nullptr>' requested here
    EXPECT_EQ(mCounters.Count(), N);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp(210,28): note: in instantiation of function template specialization 'ModuleLoadCounter::Remains<1>' requested here
    EXPECT_TRUE(waitForOne.Remains({kTestModules[0]}, {0}));
                           ^
toolkit/xre/test/gtest/TestAssembleCommandLineWin.cpp(139,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(kExpectedArgsW); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/xre/test/gtest/TestAssembleCommandLineWin.cpp(151,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(kExpectedArgsW); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
toolkit/xre/test/gtest/TestAssembleCommandLineWin.cpp(164,21): error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Werror,-Wsign-compare]
  for (int i = 0; i < ArrayLength(kExpectedArgsW); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const int' and 'const unsigned long long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<int, unsigned long long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/xre/test/gtest/TestAssembleCommandLineWin.cpp(138,3): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<int, unsigned long long, nullptr>' requested here
  EXPECT_EQ(len, ArrayLength(kExpectedArgsW));
  ^
widget/windows/TSFTextStore.cpp(3455,28): error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'long' [-Werror,-Wsign-compare]
          range.mEndOffset == end - mComposition->StartOffset() &&
          ~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
widget/windows/TSFTextStore.cpp(3454,30): error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'long' [-Werror,-Wsign-compare]
      if (range.mStartOffset == start - mComposition->StartOffset() &&
          ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xpfe/appshell/AppWindow.cpp(1900,21): error: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Werror,-Wsign-compare]
  for (int i = 0; i < toolbarSprings->Length(); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~

Differential Revision: https://phabricator.services.mozilla.com/D144695
2022-04-29 00:43:32 +00:00
Mike Hommey 98d32b03bf Bug 1766377 - Fix sign-compare warnings related to constants in gtests. r=nika,mossop
obj-build/dist/include/gtest/gtest.h(1440,28): error: comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Werror,-Wsign-compare]
GTEST_IMPL_CMP_HELPER_(GT, >)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
obj-build/dist/include/gtest/gtest.h(1422,14): note: expanded from macro 'GTEST_IMPL_CMP_HELPER_'
    if (val1 op val2) {                                                    \
        ~~~~ ^  ~~~~
toolkit/system/windowsPackageManager/tests/gtest/TestWindowsPackageManager.cpp(22,3): note: in instantiation of function template specialization 'testing::internal::CmpHelperGT<unsigned long long, int>' requested here
  ASSERT_GT(packages.Length(), 0);
  ^
obj-build/dist/include/gtest/gtest.h(1891,31): note: expanded from macro 'ASSERT_GT'
                              ^
obj-build/dist/include/gtest/gtest.h(1865,44): note: expanded from macro 'GTEST_ASSERT_GT'
  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
                                           ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long long, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/system/windowsPackageManager/tests/gtest/TestWindowsPackageManager.cpp(33,3): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long long, int, nullptr>' requested here
  ASSERT_EQ(packages.Length(), 0);
  ^
obj-build/dist/include/gtest/gtest.h(1871,31): note: expanded from macro 'ASSERT_EQ'
                              ^
obj-build/dist/include/gtest/gtest.h(1855,54): note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const int' and 'const unsigned int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<int, unsigned int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/system/windowsDHCPClient/tests/gtest/TestDHCPUtils.cpp(232,3): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<int, unsigned int, nullptr>' requested here
  ASSERT_EQ(0, size);
  ^
obj-build/dist/include/gtest/gtest.h(1871,31): note: expanded from macro 'ASSERT_EQ'
                              ^
obj-build/dist/include/gtest/gtest.h(1855,54): note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned int, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/mozapps/defaultagent/tests/gtest/CacheTest.cpp(67,3): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned int, int, nullptr>' requested here
  ASSERT_EQ(Cache::kDefaultCapacity, 2);
  ^
obj-build/dist/include/gtest/gtest.h(1871,31): note: expanded from macro 'ASSERT_EQ'
                              ^
obj-build/dist/include/gtest/gtest.h(1855,54): note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1440,28): error: comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Werror,-Wsign-compare]
GTEST_IMPL_CMP_HELPER_(GT, >)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
obj-build/dist/include/gtest/gtest.h(1422,14): note: expanded from macro 'GTEST_IMPL_CMP_HELPER_'
    if (val1 op val2) {                                                    \
        ~~~~ ^  ~~~~
toolkit/xre/dllservices/tests/gtest/TestDLLBlocklist.cpp(123,5): note: in instantiation of function template specialization 'testing::internal::CmpHelperGT<unsigned long long, int>' requested here
    EXPECT_GT(strlen(pEntry->mName), 3);
    ^
obj-build/dist/include/gtest/gtest.h(1852,44): note: expanded from macro 'EXPECT_GT'
  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
                                           ^
In file included from Unified_cpp_xpcom_tests_gtest0.cpp:2:
In file included from xpcom/tests/gtest/Helpers.cpp:12:
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long long, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
xpcom/tests/gtest/TestAvailableMemoryWatcherWin.cpp(483,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long long, int, nullptr>' requested here
    EXPECT_EQ(tokens.Length(), 3);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long long, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp(211,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long long, int, nullptr>' requested here
    EXPECT_EQ(collector.Data().length(), 1);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned int, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp(310,7): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned int, int, nullptr>' requested here
      EXPECT_EQ(evt.mLoadStatus, 0);
      ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1440,28): error: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Werror,-Wsign-compare]
GTEST_IMPL_CMP_HELPER_(GT, >)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
obj-build/dist/include/gtest/gtest.h(1422,14): note: expanded from macro 'GTEST_IMPL_CMP_HELPER_'
    if (val1 op val2) {                                                    \
        ~~~~ ^  ~~~~
toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp(332,3): note: in instantiation of function template specialization 'testing::internal::CmpHelperGT<unsigned int, int>' requested here
  EXPECT_GT(aData.mNumEvents, 0);
  ^
obj-build/dist/include/gtest/gtest.h(1852,44): note: expanded from macro 'EXPECT_GT'
  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
                                           ^

Differential Revision: https://phabricator.services.mozilla.com/D144694
2022-04-29 00:43:32 +00:00
Ben Hearsum 51f16b54cd Bug 1756209: add support for pulling campaignid out of builds installed through the Microsoft Store r=mhowell
This is working well for installs done when signed into the Microsoft Store (as long as the signed in account has never installed Firefox before).

The other path -- which is supposed to handle cases where the user is not signed in, does not appear to work, nor does Microsoft's sample code that this is modeled after. It's possible that I'm somehow testing in an invalid way, but it's hard to be certain. At this point I think the best path forward is to go with the code that is _supposed_ to work, and make sure we can distinguish between attributions from a signed in user and a not signed in user - and see if it ends up working in the wild.

Differential Revision: https://phabricator.services.mozilla.com/D141987
2022-04-26 15:55:33 +00:00
Simon McVittie 7353eb0053 Bug 1494436 - Unset MOZ_APP_LAUNCHER for external MIME handlers. r=emilio
If Thunderbird sets this in its startup script (as it does in Debian
and Fedora), Firefox does not set this in its startup script (it doesn't
in Debian), and Firefox is the handler for clicking a link in
Thunderbird, then Firefox will think it is part of Thunderbird and offer
to make Thunderbird (not Firefox!) the default browser. If the user
accepts this, it will break the ability to open normal HTTP links and
HTML files from other applications.

The same would be true for any other pair of Mozilla-based applications.
To avoid this, unset MOZ_APP_LAUNCHER for the Firefox child process.

MANUAL PUSH: Patch submitted via Splinter.

Co-Authored-By: Emilio Cobos Álvarez <emilio@crisal.io>
Bug-Debian: https://bugs.debian.org/948691
2022-04-18 17:33:49 +02:00
Emilio Cobos Álvarez 5e3a231f28 Bug 1762708 - Use async dbus for revealing files in nsGIOService. r=stransky
This at least doesn't block the UI, even though the file could take a while to
show up.

Depends on D143606

Differential Revision: https://phabricator.services.mozilla.com/D143607
2022-04-15 23:28:08 +00:00
Emilio Cobos Álvarez 9ddc42292b Bug 1760839 - Use more automatic memory management in GTK code. r=stransky
This fixes a couple potential leaks (e.g., see the UPowerClient changes,
we weren't freeing all the devices properly).

Differential Revision: https://phabricator.services.mozilla.com/D141775
2022-03-23 16:14:34 +00:00
Emilio Cobos Álvarez 4a56eb47cb Bug 1669282 - Make flatpak/snap avoid handling uri schemes that look like loopback hosts. r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D141314
2022-03-17 12:17:15 +00:00
smolnar 81c52abeec Merge autoland to mozilla-central. a=merge 2022-02-10 23:30:17 +02:00
Emilio Cobos Álvarez 8edbf17a70 Bug 1754275 - Add a 1s timeout to DBUS call to reveal files. r=stransky
This should be much more acceptable than e.g. 25 seconds to open the
file manager.

Differential Revision: https://phabricator.services.mozilla.com/D138288
2022-02-10 12:19:59 +00:00
Emilio Cobos Álvarez 969e514b9a Bug 1754275 - Port nsGIOService::OrgFreedesktopFileManager1ShowItems to use GDBusProxy. r=stransky
GDBusProxy is not deprecated, and allows having time outs.

Differential Revision: https://phabricator.services.mozilla.com/D138287
2022-02-10 12:19:59 +00:00
Ben Hearsum 9f9964ccd4 Bug 1743465: Add support for retrieving InstalledDate of current package r=mhowell
This allows us to keep `app.installation.timestamp` values for MSIX profiles inline with non-MSIX ones. (This is technically unnecessary for this bug -- we could use any value we want and get the same functionality -- but this seems relatively cheap to do, keeps things inline with non-MSIX, and may be useful for other things later.)

Differential Revision: https://phabricator.services.mozilla.com/D135245
2022-01-20 23:34:51 +00:00
Ben Hearsum 9547c13573 Bug 1743465: add XPCOM component for interacting with Windows PackageManager r=mhowell
What's implemented here is ultimately a thin wrapper around `FindPackagesByUserSecurityId` to support the needs of this bug, but it provides a base for future usage of the Windows PackageManager.

Differential Revision: https://phabricator.services.mozilla.com/D133747
2022-01-20 23:34:51 +00:00
Kershaw Chang c8a363cffe Bug 1749501 - Revert bug 1392272, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D135702
2022-01-13 01:24:49 +00:00
Emilio Cobos Álvarez 4079907232 Bug 1746559 - Split flatpak portal prefs. r=jhorak
This allows to test and enable the different portals separately. Make
the print portal work only when actually running under flatpak by
default, given it needs more work as per the regressing bug.

And while at it fix a minor leak and some typos in that code.

Differential Revision: https://phabricator.services.mozilla.com/D135120
2022-01-05 14:55:56 +00:00
Emilio Cobos Álvarez 6d97f61bd1 Bug 1746559 - Simplify widget portal code. r=jhorak
There's no reason for that function to live in the GIOService interface.

Differential Revision: https://phabricator.services.mozilla.com/D135121
2022-01-05 14:55:56 +00:00
Mike Hommey fce6eb7d83 Bug 1747165 - Replace TK_FLAGS/TK_LIBS with MOZ_GTK3_FLAGS/MOZ_GTK3_LIBS. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D134464
2021-12-23 20:29:07 +00:00
Cristian Tuns e1e31e01f2 Backed out 2 changesets (bug 1747165) for causing nightly blockers(bustages) a=backout
Backed out changeset 4b1ab0915c94 (bug 1747165)
Backed out changeset 96043d814772 (bug 1747165)
2021-12-23 08:00:54 -05:00
Mike Hommey b55194a16f Bug 1747165 - Replace TK_FLAGS/TK_LIBS with MOZ_GTK3_FLAGS/MOZ_GTK3_LIBS. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D134464
2021-12-22 23:56:24 +00:00
Narcis Beleuzu 49a0fd6177 Merge autoland to Mozilla-central. a=merge 2021-11-08 18:37:47 +02:00
Kershaw Chang 95e3591091 Bug 1392272 - P2: [osx] Monitor system proxy changes, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D127725
2021-11-08 09:00:26 +00:00
Kershaw Chang 1b01ccfacd Bug 1392272 - P1: [windows] Monitor system proxy changes, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D127724
2021-11-08 09:00:26 +00:00
Andi-Bogdan Postelnicu 2508edc4c5 Bug 1519636 - Reformat recent changes to the Google coding style. r=necko-reviewers,geckoview-reviewers,agi
Updated with clang-format version 11.0.1 (taskcluster-GI8pmG3eQ_OSXfjFfr2yFw)

\# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D113294
2021-04-26 15:52:25 +00:00
Emilio Cobos Álvarez 2677f1390e Bug 1706299 - Remove nsIImageToPixBuf. r=stransky
It's just useless indirection.

Differential Revision: https://phabricator.services.mozilla.com/D112705
2021-04-21 09:29:51 +00:00
Agi Sferro f8a731e34e Bug 1696145 - Support Notification.silent and .vibrate on Android. r=smaug,droeh,aklotz
Differential Revision: https://phabricator.services.mozilla.com/D111924
2021-04-20 18:35:36 +00:00