Bug 946195 - Remove dummyvccorlib, cruft from component extension work we never made use of. r=bbondy, sr=glandium
authorJim Mathies <jmathies@mozilla.com>
Thu, 05 Dec 2013 07:05:58 -0600
changeset 174592 4a61d432db433c9ccc98333b8ec22f6a72be00aa
parent 174591 ea36b327a1ee18c08613d1fe36cc6b8d18c8e47f
child 174593 0ae343996d36c19a159c9713332a2fc1058b9723
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbondy, glandium
bugs946195
milestone28.0a1
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
Bug 946195 - Remove dummyvccorlib, cruft from component extension work we never made use of. r=bbondy, sr=glandium
browser/installer/package-manifest.in
toolkit/library/moz.build
toolkit/library/nsDllMain.cpp
toolkit/library/winvccorlib/dummyvccorlib.cpp
toolkit/library/winvccorlib/moz.build
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -785,17 +785,16 @@ bin/libfreebl_32int64_3.so
 #endif
 
 #ifdef MOZ_METRO
 @BINPATH@/components/MetroUIUtils.js
 @BINPATH@/components/MetroUIUtils.manifest
 [metro]
 ; gre resources
 @BINPATH@/CommandExecuteHandler@BIN_SUFFIX@
-@BINPATH@/dummyvccorlib.dll
 @BINPATH@/resources.pri
 @BINPATH@/VisualElementsManifest.xml
 @BINPATH@/tileresources
 ; app dir resources
 @BINPATH@/metro/chrome.manifest
 @BINPATH@/metro/searchplugins
 @BINPATH@/metro/metroapp.ini
 @BINPATH@/metro/chrome/browser@JAREXT@
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -1,17 +1,14 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-if CONFIG['MOZ_METRO'] and CONFIG['OS_ARCH'] == 'WINNT':
-    DIRS += ['winvccorlib']
-
 LIBRARY_NAME = 'xul'
 
 SOURCES += [
     'nsStaticXULComponents.cpp',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
--- a/toolkit/library/nsDllMain.cpp
+++ b/toolkit/library/nsDllMain.cpp
@@ -1,26 +1,18 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  
 #include <windows.h>
-#if defined(_WIN32_WINNT_WIN8) && defined(_MSC_VER) && _MSC_VER < 1700
-// The Windows 8 SDK defines FACILITY_VISUALCPP in winerror.h, and MSVC
-// defines it in delayimp.h previous to VS2012.
-#undef FACILITY_VISUALCPP
-#endif
-#include <delayimp.h>
 #include "nsToolkit.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/WindowsVersion.h"
 
-using mozilla::IsWin8OrLater;
-
 #if defined(__GNUC__)
 // If DllMain gets name mangled, it won't be seen.
 extern "C" {
 #endif
 
 BOOL APIENTRY DllMain(  
                       HINSTANCE hModule, 
                       DWORD reason, 
@@ -41,88 +33,11 @@ BOOL APIENTRY DllMain(
             nsToolkit::Shutdown();
             break;
 
     }
 
     return TRUE;
 }
 
-#if defined(MOZ_METRO)
-/*
- * DelayDllLoadHook - the crt calls here anytime a delay load dll is about to
- * load. There are a number of events, we listen for dliNotePreLoadLibrary.
- * 
- * On Win8, we enable Windows Runtime Component Extension support. When enabled
- * the compiler bakes auto-generated code into our binary, including a c init-
- * ializer which inits the winrt library through a call into the winrt standard
- * lib 'vccorlib'. Vccorlib in turn has system dll dependencies which are only
- * available on Win8 (currently API-MS-WIN-CORE-WINRT and
- * API-MS-WIN-CORE-WINRT-STRING), which prevent xul.dll from loading on os <=
- * Win7. To get around this we generate a dummy vccore lib with the three entry
- * points the initializer needs and load it in place of the real vccorlib. We
- * also have to add vccorlib and the system dlls to the delay load list.
- *
- * In addition to setting up dummyvccorlib, we also have additional checks for
- * for unexpected behavior, specifically:
- * - trap attempts to load entry points in dummyvccorlib. This is not expected
- *   to happen in release code. It can happen during development if winrt apis
- *   are accessed when running on the desktop, or when winrt objects are
- *   accidentially placed in the global scope.
- * - trap and handle calls to vccorlib's __abi_FailFast in a breakpad compatible
- *   way. __abi_FailFast is called by exception handling code generated by the
- *   compiler for delegate events.
- */
-
-const char* kvccorlib = "vccorlib";
-const char* kwinrtprelim = "api-ms-win-core-winrt";
-const char* kfailfast = "?__abi_FailFast";
-
-static bool IsWinRTDLLNotPresent(PDelayLoadInfo pdli, const char* aLibToken)
-{
-  return (!IsWin8OrLater() && pdli->szDll &&
-          !strnicmp(pdli->szDll, aLibToken, strlen(aLibToken)));
-}
-
-static bool IsWinRTDLLPresent(PDelayLoadInfo pdli, const char* aLibToken)
-{
-  return (IsWin8OrLater() && pdli->szDll &&
-          !strnicmp(pdli->szDll, aLibToken, strlen(aLibToken)));
-}
-
-void __stdcall __abi_MozFailFast()
-{
-  MOZ_CRASH();
-}
-
-FARPROC WINAPI DelayDllLoadHook(unsigned dliNotify, PDelayLoadInfo pdli)
-{
-  if (dliNotify == dliNotePreLoadLibrary) {
-    if (IsWinRTDLLNotPresent(pdli, kvccorlib)) {
-      return (FARPROC)LoadLibraryA("dummyvccorlib.dll");
-    }
-    NS_ASSERTION(!IsWinRTDLLNotPresent(pdli, kwinrtprelim),
-      "Attempting to load winrt libs in non-metro environment. "
-      "(Winrt variable type placed in global scope?)");
-  }
-  if (dliNotify == dliFailGetProc && IsWinRTDLLNotPresent(pdli, kvccorlib)) {
-    NS_WARNING("Attempting to access winrt vccorlib entry point in non-metro environment.");
-    NS_WARNING(pdli->szDll);
-    NS_WARNING(pdli->dlp.szProcName);
-    NS_ABORT();
-  }
-  if (dliNotify == dliNotePreGetProcAddress &&
-      IsWinRTDLLPresent(pdli, kvccorlib) &&
-      pdli->dlp.szProcName &&
-      !strnicmp(pdli->dlp.szProcName, kfailfast, strlen(kfailfast))) {
-    return (FARPROC)__abi_MozFailFast;
-  }
-  return nullptr;
-}
-
-ExternC PfnDliHook __pfnDliNotifyHook2 = DelayDllLoadHook;
-ExternC PfnDliHook __pfnDliFailureHook2 = DelayDllLoadHook;
-
-#endif // MOZ_METRO
-
 #if defined(__GNUC__)
 } // extern "C"
 #endif
deleted file mode 100644
--- a/toolkit/library/winvccorlib/dummyvccorlib.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <windows.h>
-
-// A dummy vccorlib.dll for shunting winrt initialization calls when we are not
-// using the winrt library. For a longer explanantion see nsDllMain.cpp.
-
-extern "C" {
-__declspec(dllexport) long __stdcall __InitializeWinRTRuntime(unsigned long data) { return S_OK; }
-}
-
-namespace Platform {
-namespace Details {
-__declspec(dllexport) HRESULT InitializeData(int __threading_model) { return S_OK; }
-__declspec(dllexport) void UninitializeData(int __threading_model) { }
-}
-}
deleted file mode 100644
--- a/toolkit/library/winvccorlib/moz.build
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# When we're linking GTest we recurse into this directory but don't need
-# to generate this library
-if not CONFIG['LINK_GTEST']:
-    LIBRARY_NAME = 'dummyvccorlib'
-
-    FORCE_SHARED_LIB = True
-
-SOURCES += [
-    'dummyvccorlib.cpp',
-]
-