Backed out changeset 35bae18d7d67 (bug 1499899) for build bustages on updater.cpp.
authorCosmin Sabou <csabou@mozilla.com>
Wed, 24 Oct 2018 03:42:05 +0300
changeset 501924 f22b804a7c08da4f006f5c61c676d28663989edc
parent 501923 35bae18d7d671b179bcc547319b246576ccc044d
child 501925 ced500b7f25f599c36f6f62a25cce8204e3ec651
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1499899
milestone65.0a1
backs out35bae18d7d671b179bcc547319b246576ccc044d
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 35bae18d7d67 (bug 1499899) for build bustages on updater.cpp.
CLOBBER
accessible/windows/msaa/IUnknownImpl.h
security/sandbox/win/SandboxInitialization.cpp
toolkit/mozapps/update/updater/updater.cpp
tools/profiler/core/shared-libraries-win32.cc
widget/windows/nsWindow.cpp
widget/windows/nsWindowGfx.cpp
xpcom/windbgdlg/windbgdlg.cpp
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,9 +17,10 @@
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
 # Are you updating CLOBBER because you think it's needed for your WebIDL
 # changes to stick? As of bug 928195, this shouldn't be necessary! Please
 # don't change CLOBBER for WebIDL changes any more.
 
-Bug 1499899 - Fix some win64 clang-cl -Wunused-* warnings. (change to IUnknownImpl)
+
+Merge day clobber
\ No newline at end of file
--- a/accessible/windows/msaa/IUnknownImpl.h
+++ b/accessible/windows/msaa/IUnknownImpl.h
@@ -15,16 +15,22 @@
 // Avoid warning C4509 like "nonstandard extension used:
 // 'AccessibleWrap::[acc_getName]' uses SEH and 'name' has destructor.
 // At this point we're catching a crash which is of much greater
 // importance than the missing dereference for the nsCOMPtr<>
 #ifdef _MSC_VER
 #pragma warning( disable : 4509 )
 #endif
 
+#ifdef __GNUC__
+#define ATTRIBUTE_UNUSED __attribute__((unused))
+#else
+#define ATTRIBUTE_UNUSED
+#endif
+
 namespace mozilla {
 namespace a11y {
 
 class AutoRefCnt
 {
 public:
   AutoRefCnt() : mValue(0) {}
 
@@ -72,18 +78,17 @@ virtual HRESULT STDMETHODCALLTYPE QueryI
 #define IMPL_IUNKNOWN_QUERY_HEAD(Class)                                        \
 STDMETHODIMP                                                                   \
 Class::QueryInterface(REFIID aIID, void** aInstancePtr)                        \
 {                                                                              \
   if (!aInstancePtr)                                                           \
     return E_INVALIDARG;                                                       \
   *aInstancePtr = nullptr;                                                     \
                                                                                \
-  HRESULT hr = E_NOINTERFACE;                                                  \
-  (void)hr;
+  HRESULT hr ATTRIBUTE_UNUSED = E_NOINTERFACE;
 
 #define IMPL_IUNKNOWN_QUERY_TAIL                                               \
   return hr;                                                                   \
 }
 
 #define IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(Member)                            \
   return Member->QueryInterface(aIID, aInstancePtr);                           \
 }
--- a/security/sandbox/win/SandboxInitialization.cpp
+++ b/security/sandbox/win/SandboxInitialization.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SandboxInitialization.h"
 
 #include "base/memory/ref_counted.h"
 #include "nsWindowsDllInterceptor.h"
 #include "sandbox/win/src/sandbox_factory.h"
 #include "mozilla/sandboxing/permissionsService.h"
-#include "mozilla/Unused.h"
 
 namespace mozilla {
 namespace sandboxing {
 
 typedef BOOL(WINAPI* CloseHandle_func) (HANDLE hObject);
 static WindowsDllInterceptor::FuncHookType<CloseHandle_func> stub_CloseHandle;
 
 typedef BOOL(WINAPI* DuplicateHandle_func)(HANDLE hSourceProcessHandle,
@@ -154,17 +153,17 @@ InitializeBrokerServices()
 
   // Comment below copied from Chromium code.
   // Precreate the desktop and window station used by the renderers.
   // IMPORTANT: This piece of code needs to run as early as possible in the
   // process because it will initialize the sandbox broker, which requires
   // the process to swap its window station. During this time all the UI
   // will be broken. This has to run before threads and windows are created.
   scoped_refptr<sandbox::TargetPolicy> policy = brokerServices->CreatePolicy();
-  Unused << policy->CreateAlternateDesktop(true);
+  sandbox::ResultCode result = policy->CreateAlternateDesktop(true);
 
   return brokerServices;
 }
 
 sandbox::BrokerServices*
 GetInitializedBrokerServices()
 {
   static sandbox::BrokerServices* sInitializedBrokerServices =
--- a/toolkit/mozapps/update/updater/updater.cpp
+++ b/toolkit/mozapps/update/updater/updater.cpp
@@ -410,17 +410,16 @@ get_full_path(const NS_tchar *relpath)
 /**
  * Converts a full update path into a relative path; reverses get_full_path.
  *
  * @param  fullpath
  *         The absolute path to convert into a relative path.
  * return pointer to the location within fullpath where the relative path starts
  *        or fullpath itself if it already looks relative.
  */
-/* Unused.
 static const NS_tchar*
 get_relative_path(const NS_tchar *fullpath)
 {
   // If the path isn't absolute, just return it as-is.
 #ifdef XP_WIN
   if (fullpath[1] != ':' && fullpath[2] != '\\') {
 #else
   if (fullpath[0] != '/') {
@@ -432,17 +431,16 @@ get_relative_path(const NS_tchar *fullpa
 
   // If the path isn't long enough to be absolute, return it as-is.
   if (NS_tstrlen(fullpath) <= NS_tstrlen(prefix)) {
     return fullpath;
   }
 
   return fullpath + NS_tstrlen(prefix) + 1;
 }
-*/
 
 /**
  * Gets the platform specific path and performs simple checks to the path. If
  * the path checks don't pass nullptr will be returned.
  *
  * @param  line
  *         The line from the manifest that contains the path.
  * @param  isdir
--- a/tools/profiler/core/shared-libraries-win32.cc
+++ b/tools/profiler/core/shared-libraries-win32.cc
@@ -71,16 +71,21 @@ static bool GetPdbInfo(uintptr_t aStart,
 
   // The PDB file name could be different from module filename, so report both
   // e.g. The PDB for C:\Windows\SysWOW64\ntdll.dll is wntdll.pdb
   *aPdbName = debugInfo->pdbFileName;
 
   return true;
 }
 
+static bool IsDashOrBraces(char c)
+{
+  return c == '-' || c == '{' || c == '}';
+}
+
 static nsCString
 GetVersion(WCHAR* dllPath)
 {
   DWORD infoSize = GetFileVersionInfoSizeW(dllPath, nullptr);
   if (infoSize == 0) {
     return EmptyCString();
   }
 
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -59,17 +59,16 @@
 #include "gfxPlatform.h"
 #include "gfxPrefs.h"
 #include "mozilla/AutoRestore.h"
 #include "mozilla/Logging.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/MiscEvents.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/TouchEvents.h"
-#include "mozilla/Unused.h"
 
 #include "mozilla/ipc/MessageChannel.h"
 #include <algorithm>
 #include <limits>
 
 #include "nsWindow.h"
 #include "nsAppRunner.h"
 
@@ -5221,17 +5220,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA
         sCanQuit = abortQuit ? TRI_FALSE : TRI_TRUE;
       }
       *aRetValue = sCanQuit ? TRUE : FALSE;
       result = true;
       break;
 
     case MOZ_WM_STARTA11Y:
 #if defined(ACCESSIBILITY)
-      Unused << GetAccessible();
+      (void*)GetAccessible();
       result = true;
 #else
       result = false;
 #endif
       break;
 
     case WM_ENDSESSION:
     case MOZ_WM_APP_QUIT:
--- a/widget/windows/nsWindowGfx.cpp
+++ b/widget/windows/nsWindowGfx.cpp
@@ -119,16 +119,39 @@ nsWindow::GetRegionToPaint(bool aForceFu
     }
     LayoutDeviceIntRegion rgn(WinUtils::ConvertHRGNToRegion(paintRgn));
     ::DeleteObject(paintRgn);
     return rgn;
   }
   return LayoutDeviceIntRegion(WinUtils::ToIntRect(ps.rcPaint));
 }
 
+#define WORDSSIZE(x) ((x).width * (x).height)
+static bool
+EnsureSharedSurfaceSize(IntSize size)
+{
+  IntSize screenSize;
+  screenSize.height = GetSystemMetrics(SM_CYSCREEN);
+  screenSize.width = GetSystemMetrics(SM_CXSCREEN);
+
+  if (WORDSSIZE(screenSize) > WORDSSIZE(size))
+    size = screenSize;
+
+  if (WORDSSIZE(screenSize) < WORDSSIZE(size))
+    NS_WARNING("Trying to create a shared surface larger than the screen");
+
+  if (!sSharedSurfaceData || (WORDSSIZE(size) > WORDSSIZE(sSharedSurfaceSize))) {
+    sSharedSurfaceSize = size;
+    sSharedSurfaceData =
+      MakeUniqueFallible<uint8_t[]>(WORDSSIZE(sSharedSurfaceSize) * 4);
+  }
+
+  return !sSharedSurfaceData;
+}
+
 nsIWidgetListener* nsWindow::GetPaintListener()
 {
   if (mDestroyCalled)
     return nullptr;
   return mAttachedWidgetListener ? mAttachedWidgetListener : mWidgetListener;
 }
 
 void nsWindow::ForcePresent()
--- a/xpcom/windbgdlg/windbgdlg.cpp
+++ b/xpcom/windbgdlg/windbgdlg.cpp
@@ -80,16 +80,17 @@ wWinMain(HINSTANCE  hInstance, HINSTANCE
    * set a "word" to 0x3 to abort (die).
    */
   DWORD regType;
   DWORD regValue = -1;
   DWORD regLength = sizeof regValue;
   HKEY hkeyCU, hkeyLM;
   RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\mozilla.org\\windbgdlg", 0, KEY_READ, &hkeyCU);
   RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\mozilla.org\\windbgdlg", 0, KEY_READ, &hkeyLM);
+  int argc =0;
   for (int i = __argc - 1; regValue == (DWORD)-1 && i; --i) {
     bool ok = false;
     if (hkeyCU)
       ok = RegQueryValueExW(hkeyCU, __wargv[i], 0, &regType, (LPBYTE)&regValue, &regLength) == ERROR_SUCCESS;
     if (!ok && hkeyLM)
       ok = RegQueryValueExW(hkeyLM, __wargv[i], 0, &regType, (LPBYTE)&regValue, &regLength) == ERROR_SUCCESS;
     if (!ok)
       regValue = -1;