Bug 1330496 - Part 3: Remove other ipc checks for Windows Vista or 7+. r?aklotz draft
authorChris Peterson <cpeterson@mozilla.com>
Mon, 09 Jan 2017 21:03:57 -0800
changeset 459517 7b616e49fc65d8689018d851b469bbe1ca16067d
parent 459516 5de185791d7cd032b6359d4a82205fcfeb7c21f8
child 541919 af5e8fd54bc55de6ea114a4ca366d28cd98344fe
push id41249
push usercpeterson@mozilla.com
push dateThu, 12 Jan 2017 03:26:13 +0000
reviewersaklotz
bugs1330496
milestone53.0a1
Bug 1330496 - Part 3: Remove other ipc checks for Windows Vista or 7+. r?aklotz MozReview-Commit-ID: 9z5LKw71Veg
ipc/glue/WindowsMessageLoop.cpp
ipc/mscom/MainThreadRuntime.cpp
--- a/ipc/glue/WindowsMessageLoop.cpp
+++ b/ipc/glue/WindowsMessageLoop.cpp
@@ -14,17 +14,16 @@
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 #include "nsIXULAppInfo.h"
 #include "WinUtils.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/ipc/ProtocolUtils.h"
 #include "mozilla/PaintTracker.h"
-#include "mozilla/WindowsVersion.h"
 
 using namespace mozilla;
 using namespace mozilla::ipc;
 using namespace mozilla::ipc::windows;
 
 /**
  * The Windows-only code below exists to solve a general problem with deadlocks
  * that we experience when sending synchronous IPC messages to processes that
@@ -1017,17 +1016,17 @@ MessageChannel::WaitForSyncNotifyWithA11
 bool
 MessageChannel::WaitForSyncNotify(bool aHandleWindowsMessages)
 {
   mMonitor->AssertCurrentThreadOwns();
 
   MOZ_ASSERT(gUIThreadId, "InitUIThread was not called!");
 
 #if defined(ACCESSIBILITY)
-  if (IsVistaOrLater() && (mFlags & REQUIRE_A11Y_REENTRY)) {
+  if ((mFlags & REQUIRE_A11Y_REENTRY)) {
     MOZ_ASSERT(!(mFlags & REQUIRE_DEFERRED_MESSAGE_PROTECTION));
     return WaitForSyncNotifyWithA11yReentry();
   }
 #endif
 
   // Use a blocking wait if this channel does not require
   // Windows message deferral behavior.
   if (!(mFlags & REQUIRE_DEFERRED_MESSAGE_PROTECTION) || !aHandleWindowsMessages) {
--- a/ipc/mscom/MainThreadRuntime.cpp
+++ b/ipc/mscom/MainThreadRuntime.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/mscom/MainThreadRuntime.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/UniquePtr.h"
-#include "mozilla/WindowsVersion.h"
 #include "nsDebug.h"
 #include "nsWindowsHelpers.h"
 
 #include <accctrl.h>
 #include <aclapi.h>
 #include <objbase.h>
 #include <objidl.h>
 
@@ -39,45 +38,34 @@ MainThreadRuntime::MainThreadRuntime()
 {
   // We must be the outermost COM initialization on this thread. The COM runtime
   // cannot be configured once we start manipulating objects
   MOZ_ASSERT(mStaRegion.IsValidOutermost());
   if (NS_WARN_IF(!mStaRegion.IsValidOutermost())) {
     return;
   }
 
-  // Windows XP doesn't support setting of the COM exception policy, so we'll
-  // just stop here in that case.
-  if (!IsVistaOrLater()) {
-    mInitResult = S_OK;
-    return;
-  }
-
   // We are required to initialize security in order to configure global options.
   mInitResult = InitializeSecurity();
   MOZ_ASSERT(SUCCEEDED(mInitResult));
   if (FAILED(mInitResult)) {
     return;
   }
 
   RefPtr<IGlobalOptions> globalOpts;
   mInitResult = ::CoCreateInstance(CLSID_GlobalOptions, nullptr,
                                    CLSCTX_INPROC_SERVER, IID_IGlobalOptions,
                                    (void**)getter_AddRefs(globalOpts));
   MOZ_ASSERT(SUCCEEDED(mInitResult));
   if (FAILED(mInitResult)) {
     return;
   }
 
-  // Windows 7 has a policy that is even more strict. We should use that one
-  // whenever possible.
-  ULONG_PTR exceptionSetting = IsWin7OrLater() ?
-                               COMGLB_EXCEPTION_DONOT_HANDLE_ANY :
-                               COMGLB_EXCEPTION_DONOT_HANDLE;
-  mInitResult = globalOpts->Set(COMGLB_EXCEPTION_HANDLING, exceptionSetting);
+  mInitResult = globalOpts->Set(COMGLB_EXCEPTION_HANDLING,
+                                COMGLB_EXCEPTION_DONOT_HANDLE_ANY);
   MOZ_ASSERT(SUCCEEDED(mInitResult));
 }
 
 HRESULT
 MainThreadRuntime::InitializeSecurity()
 {
   HANDLE rawToken = nullptr;
   BOOL ok = ::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &rawToken);
@@ -172,9 +160,8 @@ MainThreadRuntime::InitializeSecurity()
   return ::CoInitializeSecurity(&sd, -1, nullptr, nullptr,
                                 RPC_C_AUTHN_LEVEL_DEFAULT,
                                 RPC_C_IMP_LEVEL_IDENTIFY, nullptr, EOAC_NONE,
                                 nullptr);
 }
 
 } // namespace mscom
 } // namespace mozilla
-