Bug 520837 - Address Ts regression from aero landing. r=robarnold.
authorJim Mathies <jmathies@mozilla.com>
Fri, 09 Oct 2009 15:55:11 -0500
changeset 33722 fe12a3c05c39
parent 33721 f02075968efe
child 33723 1147fd5b3d82
push id9649
push userjmathies@mozilla.com
push date2009-10-09 20:56 +0000
treeherdermozilla-central@fe12a3c05c39 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrobarnold
bugs520837
milestone1.9.3a1pre
Bug 520837 - Address Ts regression from aero landing. r=robarnold.
widget/src/windows/WinTaskbar.cpp
--- a/widget/src/windows/WinTaskbar.cpp
+++ b/widget/src/windows/WinTaskbar.cpp
@@ -173,16 +173,21 @@ namespace widget {
 #define MOZ_TASKBAR_ID MOZTBID(MOZ_COMPANY, MOZ_BUILD_APP, MOZILLA_VERSION_U)
 #endif
 const wchar_t *gMozillaJumpListIDGeneric = MOZ_TASKBAR_ID;
 
 NS_IMPL_ISUPPORTS1(WinTaskbar, nsIWinTaskbar)
 
 WinTaskbar::WinTaskbar() 
   : mTaskbar(nsnull) {
+  // Perf regression fix: slow registry lookups for non-existent com interfaces
+  // on freshly rebooted, memory starved machines (like talos). (bug 520837)
+  if (nsWindow::GetWindowsVersion() < WIN7_VERSION)
+    return;
+
   ::CoInitialize(NULL);
   HRESULT hr = ::CoCreateInstance(CLSID_TaskbarList,
                                   NULL,
                                   CLSCTX_INPROC_SERVER,
                                   IID_ITaskbarList4,
                                   (void**)&mTaskbar);
   if (FAILED(hr))
     return;
@@ -197,16 +202,19 @@ WinTaskbar::WinTaskbar()
 WinTaskbar::~WinTaskbar() {
   NS_IF_RELEASE(mTaskbar);
   ::CoUninitialize();
 }
 
 // (static) Called from AppShell
 PRBool WinTaskbar::SetAppUserModelID()
 {
+  if (nsWindow::GetWindowsVersion() < WIN7_VERSION)
+    return PR_FALSE;
+
   SetCurrentProcessExplicitAppUserModelIDPtr funcAppUserModelID = nsnull;
   PRBool retVal = PR_FALSE;
 
   // #define MOZ_TASKBAR_ID L""
   if (*gMozillaJumpListIDGeneric == nsnull)
     return PR_FALSE;
 
   HMODULE hDLL = ::LoadLibraryW(kShellLibraryName);