diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index a507dea841..0f7f2b756e 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -678,6 +678,18 @@ Navigator::CpuHasSSE2() return mozilla::supports_sse2(); } +bool +Navigator::CpuHasAVX() +{ + return mozilla::supports_avx(); +} + +bool +Navigator::CpuHasAVX2() +{ + return mozilla::supports_avx2(); +} + void Navigator::RefreshMIMEArray() { diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h index 69626d1a7c..10f9573ee9 100644 --- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h @@ -173,6 +173,8 @@ public: bool JavaEnabled(ErrorResult& aRv); uint64_t HardwareConcurrency(); bool CpuHasSSE2(); + bool CpuHasAVX(); + bool CpuHasAVX2(); bool TaintEnabled() { return false; diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index ce025a42f5..6fba48e48b 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -3550,6 +3550,8 @@ nsGlobalWindow::GetEventTargetParent(EventChainPreVisitor& aVisitor) aVisitor.mCanHandle = true; // Middle/right click shouldn't dispatch click event, use auxclick to instead. + // Note: mDoc should always exist here, but check just in case someone yanked + // it out from under us. if (mDoc && mDoc->IsXULDocument()) { aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119 } diff --git a/dom/webidl/Navigator.webidl b/dom/webidl/Navigator.webidl index 60ed84d535..f2212de392 100644 --- a/dom/webidl/Navigator.webidl +++ b/dom/webidl/Navigator.webidl @@ -211,6 +211,10 @@ partial interface Navigator { */ [ChromeOnly] readonly attribute boolean cpuHasSSE2; + [ChromeOnly] + readonly attribute boolean cpuHasAVX; + [ChromeOnly] + readonly attribute boolean cpuHasAVX2; }; // nsIDOMNavigatorDesktopNotification diff --git a/gfx/thebes/D3D11Checks.cpp b/gfx/thebes/D3D11Checks.cpp index b5be58ff53..9619884472 100644 --- a/gfx/thebes/D3D11Checks.cpp +++ b/gfx/thebes/D3D11Checks.cpp @@ -246,7 +246,11 @@ DoesTextureSharingWorkInternal(ID3D11Device *device, DXGI_FORMAT format, UINT bi } RefPtr sourceSharedMutex; - texture->QueryInterface(__uuidof(IDXGIKeyedMutex), (void**)getter_AddRefs(sourceSharedMutex)); + HRESULT hr = texture->QueryInterface(__uuidof(IDXGIKeyedMutex), (void**)getter_AddRefs(sourceSharedMutex)); + if (FAILED(hr) || !sourceSharedMutex) { + gfxCriticalNote << "Failed to acquire IDXGIKeyedMutex; texture sharing disabled."; + return false; + } if (FAILED(sourceSharedMutex->AcquireSync(0, 30*1000))) { gfxCriticalError() << "DoesD3D11TextureSharingWork_SourceMutexTimeout"; // only wait for 30 seconds @@ -306,9 +310,12 @@ DoesTextureSharingWorkInternal(ID3D11Device *device, DXGI_FORMAT format, UINT bi } RefPtr sharedMutex; - sharedResource->QueryInterface(__uuidof(IDXGIKeyedMutex), (void**)getter_AddRefs(sharedMutex)); - { - HRESULT hr; + hr = sharedResource->QueryInterface(__uuidof(IDXGIKeyedMutex), (void**)getter_AddRefs(sharedMutex)); + if (FAILED(hr) || !sharedMutex) { + gfxCriticalNote << "Failed to acquire IDXGIKeyedMutex; texture sharing disabled."; + return false; + } + { // Scope for mutex lock. AutoTextureLock lock(sharedMutex, hr, 30*1000); if (FAILED(hr)) { gfxCriticalError() << "DoesD3D11TextureSharingWork_AcquireSyncTimeout"; diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index 9f4ee08a2e..b14bcba63f 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -39,6 +39,10 @@ var snapshotFormatters = { $("application-box").textContent = data.name; $("useragent-box").textContent = data.userAgent; $("os-box").textContent = data.osVersion; + let cpucaps = navigator.cpuHasSSE2?"SSE2 ":""; + cpucaps += navigator.cpuHasAVX?"AVX ":""; + cpucaps += navigator.cpuHasAVX2?"AVX2 ":""; + $("cpucap-box").textContent = cpucaps; $("binary-box").textContent = Services.dirsvc.get("XREExeF", Ci.nsIFile).path; $("supportLink").href = data.supportURL; let version = Services.appinfo.version; diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml index 9a2425e2bf..839ee8eb55 100644 --- a/toolkit/content/aboutSupport.xhtml +++ b/toolkit/content/aboutSupport.xhtml @@ -142,6 +142,15 @@ + + + &aboutSupport.appBasicsCPUCaps; + + + + + + &aboutSupport.appBasicsBinary; diff --git a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd index f827268b43..96d9deef0d 100644 --- a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd +++ b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd @@ -47,6 +47,7 @@ Windows/Mac use the term "Folder" instead of "Directory" --> + diff --git a/toolkit/modules/UpdateUtils.jsm b/toolkit/modules/UpdateUtils.jsm index 5acf395d3d..31a9e933e0 100644 --- a/toolkit/modules/UpdateUtils.jsm +++ b/toolkit/modules/UpdateUtils.jsm @@ -66,6 +66,7 @@ this.UpdateUtils = { let custom = prefBranch.getCharPref(PREF_APP_UPDATE_CUSTOM, ""); let distribution = prefBranch.getCharPref(PREF_APP_DISTRIBUTION, "default"); let distributionVersion = prefBranch.getCharPref(PREF_APP_DISTRIBUTION_VERSION, "default"); + let navigator = Services.appShell.hiddenDOMWindow.navigator; let substs = [ [/%ID%/g, Services.appinfo.ID], @@ -81,7 +82,10 @@ this.UpdateUtils = { [/%PLATFORM_VERSION%/g, Services.appinfo.platformVersion], [/%DISTRIBUTION%/g, distribution], [/%DISTRIBUTION_VERSION%/g, distributionVersion], - [/%LOCALE%/g, this.Locale] + [/%LOCALE%/g, this.Locale], + [/%CPU_SSE2%/g, navigator.cpuHasSSE2], + [/%CPU_AVX%/g, navigator.cpuHasAVX], + [/%CPU_AVX2%/g, navigator.cpuHasAVX2] ]; substs.forEach(([_subst, _value]) => aUpdateURL = aUpdateURL.replace(_subst, _value));