From cefd926755157bbaffd52643fccf2dec91786b1a Mon Sep 17 00:00:00 2001 From: Stanca Serban Date: Mon, 17 Apr 2023 13:52:39 +0300 Subject: [PATCH] Backed out 9 changesets (bug 1826760, bug 1826758, bug 1826752, bug 1826756, bug 1826759, bug 1826761, bug 1826757, bug 1826753, bug 1826754) for causing bp-hybrid bustages in ClearKeyDecryptionManager.cpp. CLOSED TREE Backed out changeset 210012222277 (bug 1826761) Backed out changeset e364bb149efa (bug 1826760) Backed out changeset e456e2f9966c (bug 1826759) Backed out changeset 2b6ff545f4a3 (bug 1826758) Backed out changeset 95fe1de8ba00 (bug 1826757) Backed out changeset f8af52d7f2a1 (bug 1826756) Backed out changeset 2646e773f098 (bug 1826754) Backed out changeset 58d5d74b1835 (bug 1826753) Backed out changeset 8567e6595acc (bug 1826752) --- dom/media/platforms/wmf/DXVA2Manager.cpp | 10 +-- dom/media/platforms/wmf/MFCDMProxy.h | 1 - .../wmf/MFContentProtectionManager.cpp | 1 - .../wmf/MFMediaEngineAudioStream.cpp | 5 -- .../wmf/MFMediaEngineDecoderModule.cpp | 2 - .../platforms/wmf/MFMediaEngineExtension.cpp | 4 -- .../platforms/wmf/MFMediaEngineStream.cpp | 2 - .../wmf/MFMediaEngineVideoStream.cpp | 1 - dom/media/platforms/wmf/MFTEncoder.cpp | 2 - dom/media/platforms/wmf/WMFMediaDataEncoder.h | 1 - dom/media/platforms/wmf/moz.build | 2 + dom/webauthn/WinWebAuthnManager.cpp | 2 - dom/webauthn/moz.build | 1 + js/xpconnect/src/Sandbox.cpp | 1 - js/xpconnect/src/XPCComponents.cpp | 2 - js/xpconnect/src/XPCConvert.cpp | 1 + js/xpconnect/src/XPCJSContext.cpp | 1 - js/xpconnect/src/XPCJSRuntime.cpp | 5 -- js/xpconnect/src/XPCLocale.cpp | 5 -- js/xpconnect/src/XPCMaps.cpp | 1 - js/xpconnect/src/XPCSelfHostedShmem.cpp | 1 - js/xpconnect/src/XPCWrappedNative.cpp | 1 - js/xpconnect/src/XPCWrappedNativeInfo.cpp | 1 - js/xpconnect/src/XPCWrappedNativeProto.cpp | 1 - js/xpconnect/src/XPCWrappedNativeScope.cpp | 1 - js/xpconnect/src/moz.build | 2 + js/xpconnect/src/nsXPConnect.cpp | 6 +- media/gmp-clearkey/0.1/ClearKeyUtils.cpp | 4 ++ media/gmp-clearkey/0.1/VideoDecoder.cpp | 7 +-- media/gmp-clearkey/0.1/WMFUtils.h | 9 +-- media/gmp-clearkey/0.1/moz.build | 2 + mfbt/tests/gtest/TestSpan.cpp | 1 - mfbt/tests/gtest/TestTainting.cpp | 1 - mfbt/tests/gtest/moz.build | 2 + toolkit/components/places/Helpers.h | 2 +- toolkit/components/places/History.cpp | 1 - .../places/PageIconProtocolHandler.cpp | 2 - toolkit/components/places/PlaceInfo.h | 3 +- toolkit/components/places/SQLFunctions.cpp | 4 +- toolkit/components/places/Shutdown.cpp | 5 -- toolkit/components/places/VisitInfo.h | 1 - toolkit/components/places/moz.build | 2 + .../components/places/nsFaviconService.cpp | 1 - toolkit/components/places/nsNavBookmarks.cpp | 4 -- toolkit/components/places/nsNavHistory.cpp | 1 - .../components/places/nsNavHistoryQuery.cpp | 1 - .../components/places/nsNavHistoryResult.cpp | 6 -- .../crashreporter/client/crashreporter.cpp | 63 +++++++++---------- toolkit/crashreporter/client/crashreporter.h | 3 - .../client/crashreporter_gtk_common.cpp | 2 +- .../client/crashreporter_gtk_common.h | 1 - .../client/crashreporter_linux.cpp | 4 +- .../client/crashreporter_unix_common.cpp | 1 - toolkit/crashreporter/client/moz.build | 2 + toolkit/crashreporter/client/ping.cpp | 10 ++- .../crashreporter/minidump-analyzer/moz.build | 2 + toolkit/crashreporter/moz.build | 2 + toolkit/xre/dllservices/ModuleEvaluator.cpp | 2 + .../xre/dllservices/UntrustedModulesData.cpp | 1 - toolkit/xre/dllservices/moz.build | 2 + 60 files changed, 79 insertions(+), 138 deletions(-) diff --git a/dom/media/platforms/wmf/DXVA2Manager.cpp b/dom/media/platforms/wmf/DXVA2Manager.cpp index f080a16779a6..55b1364101a5 100644 --- a/dom/media/platforms/wmf/DXVA2Manager.cpp +++ b/dom/media/platforms/wmf/DXVA2Manager.cpp @@ -35,6 +35,12 @@ #include "nsPrintfCString.h" #include "nsThreadUtils.h" +const CLSID CLSID_VideoProcessorMFT = { + 0x88753b26, + 0x5b24, + 0x49bd, + {0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82}}; + const GUID MF_XVP_PLAYBACK_MODE = { 0x3c5d293f, 0xad67, @@ -616,10 +622,6 @@ already_AddRefed D3D9DXVA2Manager::CreateDecoder( hr = mDecoderService->CreateVideoDecoder(mDecoderGUID, &aDesc, &configs[i], &surfaces, 1, decoder.StartAssignment()); - if (FAILED(hr)) { - continue; - } - CoTaskMemFree(configs); return decoder.forget(); } diff --git a/dom/media/platforms/wmf/MFCDMProxy.h b/dom/media/platforms/wmf/MFCDMProxy.h index 605755705c1e..14e0c2a81e48 100644 --- a/dom/media/platforms/wmf/MFCDMProxy.h +++ b/dom/media/platforms/wmf/MFCDMProxy.h @@ -5,7 +5,6 @@ #ifndef DOM_MEDIA_PLATFORM_WMF_MFCDMPROXY_H #define DOM_MEDIA_PLATFORM_WMF_MFCDMPROXY_H -#include #include #include #include diff --git a/dom/media/platforms/wmf/MFContentProtectionManager.cpp b/dom/media/platforms/wmf/MFContentProtectionManager.cpp index 79189d59b3b7..83e48226148d 100644 --- a/dom/media/platforms/wmf/MFContentProtectionManager.cpp +++ b/dom/media/platforms/wmf/MFContentProtectionManager.cpp @@ -8,7 +8,6 @@ #include #include "MFMediaEngineUtils.h" -#include "WMF.h" namespace mozilla { diff --git a/dom/media/platforms/wmf/MFMediaEngineAudioStream.cpp b/dom/media/platforms/wmf/MFMediaEngineAudioStream.cpp index 3da8ca62e7b5..0502acaedbb1 100644 --- a/dom/media/platforms/wmf/MFMediaEngineAudioStream.cpp +++ b/dom/media/platforms/wmf/MFMediaEngineAudioStream.cpp @@ -4,12 +4,7 @@ #include "MFMediaEngineAudioStream.h" -#include -#include - #include "MFMediaEngineUtils.h" -#include "WMFUtils.h" -#include "mozilla/StaticPrefs_media.h" namespace mozilla { diff --git a/dom/media/platforms/wmf/MFMediaEngineDecoderModule.cpp b/dom/media/platforms/wmf/MFMediaEngineDecoderModule.cpp index 13be162af5ca..07afdcd1a417 100644 --- a/dom/media/platforms/wmf/MFMediaEngineDecoderModule.cpp +++ b/dom/media/platforms/wmf/MFMediaEngineDecoderModule.cpp @@ -4,13 +4,11 @@ #include "MFMediaEngineDecoderModule.h" -#include "MFTDecoder.h" #include "VideoUtils.h" #include "mozilla/MFMediaEngineParent.h" #include "mozilla/MFMediaEngineUtils.h" #include "mozilla/StaticPrefs_media.h" #include "mozilla/WindowsVersion.h" -#include "mozilla/mscom/EnsureMTA.h" namespace mozilla { diff --git a/dom/media/platforms/wmf/MFMediaEngineExtension.cpp b/dom/media/platforms/wmf/MFMediaEngineExtension.cpp index eb761da3648b..8e7b0c2bdd42 100644 --- a/dom/media/platforms/wmf/MFMediaEngineExtension.cpp +++ b/dom/media/platforms/wmf/MFMediaEngineExtension.cpp @@ -4,12 +4,8 @@ #include "MFMediaEngineExtension.h" -#include -#include - #include "MFMediaSource.h" #include "MFMediaEngineUtils.h" -#include "WMF.h" namespace mozilla { diff --git a/dom/media/platforms/wmf/MFMediaEngineStream.cpp b/dom/media/platforms/wmf/MFMediaEngineStream.cpp index fd28ad1b4d5a..3a584378d2b3 100644 --- a/dom/media/platforms/wmf/MFMediaEngineStream.cpp +++ b/dom/media/platforms/wmf/MFMediaEngineStream.cpp @@ -11,8 +11,6 @@ #include "TimeUnits.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/ProfilerMarkerTypes.h" -#include "WMF.h" -#include "WMFUtils.h" namespace mozilla { diff --git a/dom/media/platforms/wmf/MFMediaEngineVideoStream.cpp b/dom/media/platforms/wmf/MFMediaEngineVideoStream.cpp index b78c8427460c..3e08cf091b22 100644 --- a/dom/media/platforms/wmf/MFMediaEngineVideoStream.cpp +++ b/dom/media/platforms/wmf/MFMediaEngineVideoStream.cpp @@ -6,7 +6,6 @@ #include "mozilla/layers/DcompSurfaceImage.h" #include "MFMediaEngineUtils.h" -#include "mozilla/StaticPrefs_media.h" namespace mozilla { diff --git a/dom/media/platforms/wmf/MFTEncoder.cpp b/dom/media/platforms/wmf/MFTEncoder.cpp index 8ba2a3761aaf..724a8165ac60 100644 --- a/dom/media/platforms/wmf/MFTEncoder.cpp +++ b/dom/media/platforms/wmf/MFTEncoder.cpp @@ -7,9 +7,7 @@ #include "MFTEncoder.h" #include "mozilla/Logging.h" #include "mozilla/WindowsProcessMitigations.h" -#include "mozilla/StaticPrefs_media.h" #include "mozilla/mscom/Utils.h" -#include "WMFUtils.h" // Missing from MinGW. #ifndef CODECAPI_AVEncAdaptiveMode diff --git a/dom/media/platforms/wmf/WMFMediaDataEncoder.h b/dom/media/platforms/wmf/WMFMediaDataEncoder.h index fd1036eb992d..8cd8f419e2a4 100644 --- a/dom/media/platforms/wmf/WMFMediaDataEncoder.h +++ b/dom/media/platforms/wmf/WMFMediaDataEncoder.h @@ -12,7 +12,6 @@ #include "PlatformEncoderModule.h" #include "TimeUnits.h" #include "WMFDataEncoderUtils.h" -#include "WMFUtils.h" namespace mozilla { diff --git a/dom/media/platforms/wmf/moz.build b/dom/media/platforms/wmf/moz.build index 9e0f3aa94a5d..fd315af39b4f 100644 --- a/dom/media/platforms/wmf/moz.build +++ b/dom/media/platforms/wmf/moz.build @@ -83,3 +83,5 @@ FINAL_LIBRARY = "xul" # Add libFuzzer configuration directives include("/tools/fuzzing/libfuzzer-config.mozbuild") + +REQUIRES_UNIFIED_BUILD = True diff --git a/dom/webauthn/WinWebAuthnManager.cpp b/dom/webauthn/WinWebAuthnManager.cpp index 8303f9db343b..80f0fb2694e8 100644 --- a/dom/webauthn/WinWebAuthnManager.cpp +++ b/dom/webauthn/WinWebAuthnManager.cpp @@ -5,11 +5,9 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/dom/PWebAuthnTransactionParent.h" -#include "mozilla/dom/WebAuthnCBORUtil.h" #include "mozilla/MozPromise.h" #include "mozilla/ipc/BackgroundParent.h" #include "mozilla/ClearOnShutdown.h" -#include "mozilla/dom/CryptoBuffer.h" #include "mozilla/Unused.h" #include "nsTextFormatter.h" #include "nsWindowsHelpers.h" diff --git a/dom/webauthn/moz.build b/dom/webauthn/moz.build index 20cef460481a..838d8923e63b 100644 --- a/dom/webauthn/moz.build +++ b/dom/webauthn/moz.build @@ -85,6 +85,7 @@ if CONFIG["OS_ARCH"] == "WINNT": ] if CONFIG["OS_TARGET"] == "WINNT": + REQUIRES_UNIFIED_BUILD = True EXPORTS.mozilla.dom += [ "WinWebAuthnManager.h", ] diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp index f164bb802907..0cd1b008778b 100644 --- a/js/xpconnect/src/Sandbox.cpp +++ b/js/xpconnect/src/Sandbox.cpp @@ -102,7 +102,6 @@ #include "mozilla/StaticPrefs_extensions.h" using namespace mozilla; -using namespace mozilla::dom; using namespace JS; using namespace JS::loader; using namespace xpc; diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 77df85b5f802..f67f3ae3e42e 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -10,7 +10,6 @@ #include "xpc_make_class.h" #include "JSServices.h" #include "XPCJSWeakReference.h" -#include "AccessCheck.h" #include "WrapperFactory.h" #include "nsJSUtils.h" #include "mozJSModuleLoader.h" @@ -37,7 +36,6 @@ #include "mozilla/URLPreloader.h" #include "mozilla/dom/DOMException.h" #include "mozilla/dom/DOMExceptionBinding.h" -#include "mozilla/dom/Exceptions.h" #include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/RemoteObjectProxy.h" #include "mozilla/dom/StructuredCloneTags.h" diff --git a/js/xpconnect/src/XPCConvert.cpp b/js/xpconnect/src/XPCConvert.cpp index 4cfc84faa74b..ef7cf0d83f58 100644 --- a/js/xpconnect/src/XPCConvert.cpp +++ b/js/xpconnect/src/XPCConvert.cpp @@ -392,6 +392,7 @@ bool XPCConvert::NativeData2JS(JSContext* cx, MutableHandleValue d, NS_ERROR("bad type"); return false; } + return true; } /***************************************************************************/ diff --git a/js/xpconnect/src/XPCJSContext.cpp b/js/xpconnect/src/XPCJSContext.cpp index 1145915db61a..83b7dc77362b 100644 --- a/js/xpconnect/src/XPCJSContext.cpp +++ b/js/xpconnect/src/XPCJSContext.cpp @@ -84,7 +84,6 @@ #endif using namespace mozilla; -using namespace mozilla::dom; using namespace xpc; using namespace JS; diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index 2424cf9dda45..1a8c1bc2655f 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -77,21 +77,16 @@ #include "nsAboutProtocolUtils.h" #include "NodeUbiReporting.h" -#include "ExpandedPrincipal.h" #include "nsIInputStream.h" #include "nsJSPrincipals.h" -#include "nsJSEnvironment.h" -#include "XPCInlines.h" #ifdef XP_WIN # include #endif using namespace mozilla; -using namespace mozilla::dom; using namespace xpc; using namespace JS; -using namespace js; using mozilla::dom::PerThreadAtomCache; /***************************************************************************/ diff --git a/js/xpconnect/src/XPCLocale.cpp b/js/xpconnect/src/XPCLocale.cpp index c61a25e17e78..610a32f0d88e 100644 --- a/js/xpconnect/src/XPCLocale.cpp +++ b/js/xpconnect/src/XPCLocale.cpp @@ -9,18 +9,13 @@ #include "js/LocaleSensitive.h" #include "nsIObserver.h" -#include "nsIObserverService.h" #include "nsComponentManagerUtils.h" -#include "nsIPrefService.h" #include "nsServiceManagerUtils.h" -#include "mozilla/Services.h" -#include "mozilla/CycleCollectedJSRuntime.h" #include "mozilla/CycleCollectedJSContext.h" #include "mozilla/intl/LocaleService.h" #include "mozilla/Preferences.h" #include "xpcpublic.h" -#include "xpcprivate.h" using namespace mozilla; using mozilla::intl::LocaleService; diff --git a/js/xpconnect/src/XPCMaps.cpp b/js/xpconnect/src/XPCMaps.cpp index e2d2857a8252..b4c3f1cd986c 100644 --- a/js/xpconnect/src/XPCMaps.cpp +++ b/js/xpconnect/src/XPCMaps.cpp @@ -9,7 +9,6 @@ #include "mozilla/MathAlgorithms.h" #include "mozilla/MemoryReporting.h" #include "xpcprivate.h" -#include "XPCMaps.h" #include "js/HashTable.h" diff --git a/js/xpconnect/src/XPCSelfHostedShmem.cpp b/js/xpconnect/src/XPCSelfHostedShmem.cpp index e5c8578ccdec..6464746ea366 100644 --- a/js/xpconnect/src/XPCSelfHostedShmem.cpp +++ b/js/xpconnect/src/XPCSelfHostedShmem.cpp @@ -5,7 +5,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "XPCSelfHostedShmem.h" -#include "xpcprivate.h" // static mozilla::StaticRefPtr diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrappedNative.cpp index 21f5c3e003ea..70a740774e9f 100644 --- a/js/xpconnect/src/XPCWrappedNative.cpp +++ b/js/xpconnect/src/XPCWrappedNative.cpp @@ -7,7 +7,6 @@ /* Wrapper object for reflecting native xpcom objects into JavaScript. */ #include "xpcprivate.h" -#include "XPCMaps.h" #include "nsWrapperCacheInlines.h" #include "XPCLog.h" #include "js/Array.h" // JS::GetArrayLength, JS::IsArrayObject diff --git a/js/xpconnect/src/XPCWrappedNativeInfo.cpp b/js/xpconnect/src/XPCWrappedNativeInfo.cpp index ec20145cade4..fbd65735e51c 100644 --- a/js/xpconnect/src/XPCWrappedNativeInfo.cpp +++ b/js/xpconnect/src/XPCWrappedNativeInfo.cpp @@ -7,7 +7,6 @@ /* Manage the shared info about interfaces for use by wrappedNatives. */ #include "xpcprivate.h" -#include "XPCMaps.h" #include "js/Wrapper.h" #include "mozilla/MemoryReporting.h" diff --git a/js/xpconnect/src/XPCWrappedNativeProto.cpp b/js/xpconnect/src/XPCWrappedNativeProto.cpp index 4b492bfa9ed3..7196d74d4690 100644 --- a/js/xpconnect/src/XPCWrappedNativeProto.cpp +++ b/js/xpconnect/src/XPCWrappedNativeProto.cpp @@ -9,7 +9,6 @@ #include "xpcprivate.h" #include "js/Object.h" // JS::SetReservedSlot #include "pratom.h" -#include "XPCMaps.h" using namespace mozilla; diff --git a/js/xpconnect/src/XPCWrappedNativeScope.cpp b/js/xpconnect/src/XPCWrappedNativeScope.cpp index c6007605441f..b5c6ee1153f6 100644 --- a/js/xpconnect/src/XPCWrappedNativeScope.cpp +++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp @@ -15,7 +15,6 @@ #include "mozilla/BasePrincipal.h" #include "mozilla/MemoryReporting.h" #include "mozilla/Preferences.h" -#include "XPCMaps.h" #include "mozilla/Unused.h" #include "js/Object.h" // JS::GetCompartment #include "js/PropertyAndElement.h" // JS_DefineProperty, JS_DefinePropertyById diff --git a/js/xpconnect/src/moz.build b/js/xpconnect/src/moz.build index 39d4baececcc..f88f33f88451 100644 --- a/js/xpconnect/src/moz.build +++ b/js/xpconnect/src/moz.build @@ -77,3 +77,5 @@ LOCAL_INCLUDES += [ if CONFIG["CC_TYPE"] in ("clang", "gcc"): CXXFLAGS += ["-Werror=format"] + +REQUIRES_UNIFIED_BUILD = True diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index 4b23e9e67027..e91311f7c0fe 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -49,11 +49,7 @@ #include "nsJSUtils.h" #include "prsystem.h" -#include "xpcprivate.h" - -#ifdef XP_WIN -# include "mozilla/WinHeaderOnlyUtils.h" -#else +#ifndef XP_WIN # include #endif diff --git a/media/gmp-clearkey/0.1/ClearKeyUtils.cpp b/media/gmp-clearkey/0.1/ClearKeyUtils.cpp index 1b1a7b420009..086283fb2e68 100644 --- a/media/gmp-clearkey/0.1/ClearKeyUtils.cpp +++ b/media/gmp-clearkey/0.1/ClearKeyUtils.cpp @@ -353,6 +353,8 @@ static bool SkipObject(ParserContext& aCtx) { } EXPECT_SYMBOL(aCtx, ','); } + + return false; } /** @@ -407,6 +409,8 @@ static bool SkipToken(ParserContext& aCtx) { CK_LOGD("JWK parser skipping literal"); return SkipLiteral(aCtx); } + + return false; } static bool GetNextLabel(ParserContext& aCtx, string& aOutLabel) { diff --git a/media/gmp-clearkey/0.1/VideoDecoder.cpp b/media/gmp-clearkey/0.1/VideoDecoder.cpp index 6417defdafdb..570eb99357e3 100644 --- a/media/gmp-clearkey/0.1/VideoDecoder.cpp +++ b/media/gmp-clearkey/0.1/VideoDecoder.cpp @@ -22,7 +22,6 @@ #include "ClearKeyUtils.h" #include "ClearKeyDecryptionManager.h" #include "VideoDecoder.h" -#include "content_decryption_module.h" #include "mozilla/CheckedInt.h" using namespace wmf; @@ -86,7 +85,7 @@ cdm::Status VideoDecoder::Decode(const cdm::InputBuffer_2& aInputBuffer, std::vector& buffer = data->mBuffer; if (data->mCrypto.IsValid()) { - cdm::Status rv = + Status rv = ClearKeyDecryptionManager::Get()->Decrypt(buffer, data->mCrypto); if (STATUS_FAILED(rv)) { @@ -184,7 +183,7 @@ VideoDecoder::SampleToVideoFrame(IMFSample* aSample, int32_t aPictureWidth, HRESULT hr; CComPtr mediaBuffer; - aVideoFrame->SetFormat(cdm::kI420); + aVideoFrame->SetFormat(kI420); // Must convert to contiguous mediaBuffer to use IMD2DBuffer interface. hr = aSample->ConvertToContiguousBuffer(&mediaBuffer); @@ -304,7 +303,7 @@ cdm::Status VideoDecoder::Drain(cdm::VideoFrame* aVideoFrame) { if (!mDecoder) { CK_LOGD("Drain failed! Decoder was not initialized"); - return cdm::Status::kDecodeError; + return Status::kDecodeError; } mDecoder->Drain(); diff --git a/media/gmp-clearkey/0.1/WMFUtils.h b/media/gmp-clearkey/0.1/WMFUtils.h index 0c2819e25cf7..2b4754c7b06e 100644 --- a/media/gmp-clearkey/0.1/WMFUtils.h +++ b/media/gmp-clearkey/0.1/WMFUtils.h @@ -28,7 +28,6 @@ #include #include "VideoLimits.h" -#include "content_decryption_module.h" #include "gmp-platform.h" #include "mozilla/Attributes.h" @@ -125,12 +124,8 @@ typedef int64_t Microseconds; } \ } -inline bool STATUS_SUCCEEDED(cdm::Status status) { - return status == cdm::Status::kSuccess; -} -inline bool STATUS_FAILED(cdm::Status status) { - return !STATUS_SUCCEEDED(status); -} +#define STATUS_SUCCEEDED(x) ((x) == Status::kSuccess) +#define STATUS_FAILED(x) ((x) != Status::kSuccess) #define MFPLAT_FUNC(_func, _dllname) extern decltype(::_func)* _func; #include "WMFSymbols.h" diff --git a/media/gmp-clearkey/0.1/moz.build b/media/gmp-clearkey/0.1/moz.build index 4db6281a907f..928abd6cfb1f 100644 --- a/media/gmp-clearkey/0.1/moz.build +++ b/media/gmp-clearkey/0.1/moz.build @@ -75,3 +75,5 @@ elif CONFIG["CC_TYPE"] == "clang-cl": "-FI", "stdio.h", # for sprintf() prototype ] + +REQUIRES_UNIFIED_BUILD = True diff --git a/mfbt/tests/gtest/TestSpan.cpp b/mfbt/tests/gtest/TestSpan.cpp index fb7db0d158c1..c5f04db0ddbd 100644 --- a/mfbt/tests/gtest/TestSpan.cpp +++ b/mfbt/tests/gtest/TestSpan.cpp @@ -19,7 +19,6 @@ #include "gtest/gtest.h" -#include "mozilla/Array.h" #include "mozilla/Span.h" #include "nsString.h" diff --git a/mfbt/tests/gtest/TestTainting.cpp b/mfbt/tests/gtest/TestTainting.cpp index 0025819c0622..ed9ba1e1600d 100644 --- a/mfbt/tests/gtest/TestTainting.cpp +++ b/mfbt/tests/gtest/TestTainting.cpp @@ -7,7 +7,6 @@ #include "gtest/gtest.h" #include -#include "mozilla/Array.h" #include "mozilla/Assertions.h" #include "mozilla/Range.h" #include "mozilla/Tainting.h" diff --git a/mfbt/tests/gtest/moz.build b/mfbt/tests/gtest/moz.build index 0af8d1ea75fc..5ded0f4391a1 100644 --- a/mfbt/tests/gtest/moz.build +++ b/mfbt/tests/gtest/moz.build @@ -30,3 +30,5 @@ if not CONFIG["MOZILLA_OFFICIAL"]: # ] FINAL_LIBRARY = "xul-gtest" + +REQUIRES_UNIFIED_BUILD = True diff --git a/toolkit/components/places/Helpers.h b/toolkit/components/places/Helpers.h index fe7ed82b91aa..9b1ff8236cfe 100644 --- a/toolkit/components/places/Helpers.h +++ b/toolkit/components/places/Helpers.h @@ -165,7 +165,7 @@ PRTime RoundToMilliseconds(PRTime aTime); */ PRTime RoundedPRNow(); -nsresult HashURL(const nsACString& aSpec, const nsACString& aMode, +nsresult HashURL(const nsAString& aSpec, const nsACString& aMode, uint64_t* _hash); class QueryKeyValuePair final { diff --git a/toolkit/components/places/History.cpp b/toolkit/components/places/History.cpp index 019e072a05a3..eeb11402b9c7 100644 --- a/toolkit/components/places/History.cpp +++ b/toolkit/components/places/History.cpp @@ -26,7 +26,6 @@ #include "mozilla/dom/Link.h" #include "nsDocShellCID.h" #include "mozilla/Components.h" -#include "nsAppDirectoryServiceDefs.h" #include "nsThreadUtils.h" #include "nsNetUtil.h" #include "nsIWidget.h" diff --git a/toolkit/components/places/PageIconProtocolHandler.cpp b/toolkit/components/places/PageIconProtocolHandler.cpp index ae8553271828..a294cb2a9c62 100644 --- a/toolkit/components/places/PageIconProtocolHandler.cpp +++ b/toolkit/components/places/PageIconProtocolHandler.cpp @@ -8,8 +8,6 @@ #include "mozilla/ScopeExit.h" #include "mozilla/Components.h" #include "nsFaviconService.h" -#include "nsStringStream.h" -#include "nsStreamUtils.h" #include "nsIChannel.h" #include "nsIFaviconService.h" #include "nsIIOService.h" diff --git a/toolkit/components/places/PlaceInfo.h b/toolkit/components/places/PlaceInfo.h index 6363ae138696..a530c3588039 100644 --- a/toolkit/components/places/PlaceInfo.h +++ b/toolkit/components/places/PlaceInfo.h @@ -6,12 +6,11 @@ #define mozilla_places_PlaceInfo_h__ #include "mozIAsyncHistory.h" -#include "nsCOMPtr.h" -#include "nsIURI.h" #include "nsString.h" #include "nsTArray.h" #include "mozilla/Attributes.h" +class nsIURI; class mozIVisitInfo; namespace mozilla { diff --git a/toolkit/components/places/SQLFunctions.cpp b/toolkit/components/places/SQLFunctions.cpp index 99eea2e0aadd..74d48e6af6ee 100644 --- a/toolkit/components/places/SQLFunctions.cpp +++ b/toolkit/components/places/SQLFunctions.cpp @@ -5,8 +5,6 @@ #include "mozilla/storage.h" #include "nsString.h" -#include "nsFaviconService.h" -#include "nsNavBookmarks.h" #include "nsUnicharUtils.h" #include "nsWhitespaceTokenizer.h" #include "nsEscape.h" @@ -1015,7 +1013,7 @@ HashFunction::OnFunctionCall(mozIStorageValueArray* aArguments, RefPtr result = new nsVariant(); uint64_t hash; - rv = mozilla::places::HashURL(str, mode, &hash); + rv = HashURL(str, mode, &hash); NS_ENSURE_SUCCESS(rv, rv); rv = result->SetAsInt64((int64_t)hash); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/components/places/Shutdown.cpp b/toolkit/components/places/Shutdown.cpp index 8327784b8654..43767840339c 100644 --- a/toolkit/components/places/Shutdown.cpp +++ b/toolkit/components/places/Shutdown.cpp @@ -4,14 +4,9 @@ #include "Shutdown.h" #include "mozilla/Unused.h" -#include "mozilla/Services.h" #include "mozilla/SimpleEnumerator.h" -#include "nsComponentManagerUtils.h" #include "nsIProperty.h" -#include "nsIObserverService.h" #include "nsIWritablePropertyBag.h" -#include "nsVariant.h" -#include "Database.h" namespace mozilla { namespace places { diff --git a/toolkit/components/places/VisitInfo.h b/toolkit/components/places/VisitInfo.h index 7b99cd46a61a..d9e26697eb9a 100644 --- a/toolkit/components/places/VisitInfo.h +++ b/toolkit/components/places/VisitInfo.h @@ -7,7 +7,6 @@ #include "mozIAsyncHistory.h" #include "mozilla/Attributes.h" -#include "nsCOMPtr.h" class nsIURI; diff --git a/toolkit/components/places/moz.build b/toolkit/components/places/moz.build index 80a0845cd410..19b6d7a2533a 100644 --- a/toolkit/components/places/moz.build +++ b/toolkit/components/places/moz.build @@ -86,3 +86,5 @@ include("/ipc/chromium/chromium-config.mozbuild") with Files("**"): BUG_COMPONENT = ("Toolkit", "Places") + +REQUIRES_UNIFIED_BUILD = True diff --git a/toolkit/components/places/nsFaviconService.cpp b/toolkit/components/places/nsFaviconService.cpp index cf708f136a8a..66b69febc573 100644 --- a/toolkit/components/places/nsFaviconService.cpp +++ b/toolkit/components/places/nsFaviconService.cpp @@ -30,7 +30,6 @@ #include "mozilla/Preferences.h" #include "nsILoadInfo.h" #include "nsIContentPolicy.h" -#include "nsIProtocolHandler.h" #include "nsIScriptError.h" #include "nsContentUtils.h" #include "imgICache.h" diff --git a/toolkit/components/places/nsNavBookmarks.cpp b/toolkit/components/places/nsNavBookmarks.cpp index 5dcb0c1b4498..de8733540f3a 100644 --- a/toolkit/components/places/nsNavBookmarks.cpp +++ b/toolkit/components/places/nsNavBookmarks.cpp @@ -12,12 +12,9 @@ #include "nsAppDirectoryServiceDefs.h" #include "nsITaggingService.h" #include "nsNetUtil.h" -#include "nsIProtocolHandler.h" -#include "nsIObserverService.h" #include "nsUnicharUtils.h" #include "nsPrintfCString.h" #include "nsQueryObject.h" -#include "mozIStorageValueArray.h" #include "mozilla/Preferences.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/storage.h" @@ -38,7 +35,6 @@ const int32_t nsNavBookmarks::kGetChildrenIndex_Type = 20; const int32_t nsNavBookmarks::kGetChildrenIndex_PlaceID = 21; const int32_t nsNavBookmarks::kGetChildrenIndex_SyncStatus = 22; -using namespace mozilla::dom; using namespace mozilla::places; extern "C" { diff --git a/toolkit/components/places/nsNavHistory.cpp b/toolkit/components/places/nsNavHistory.cpp index 1ed59853c01a..e09e5db28e07 100644 --- a/toolkit/components/places/nsNavHistory.cpp +++ b/toolkit/components/places/nsNavHistory.cpp @@ -23,7 +23,6 @@ #include "Helpers.h" #include "NotifyRankingChanged.h" -#include "mozIStorageValueArray.h" #include "nsTArray.h" #include "nsNetUtil.h" #include "nsPrintfCString.h" diff --git a/toolkit/components/places/nsNavHistoryQuery.cpp b/toolkit/components/places/nsNavHistoryQuery.cpp index 7118e86b2866..f6c85a9f03c9 100644 --- a/toolkit/components/places/nsNavHistoryQuery.cpp +++ b/toolkit/components/places/nsNavHistoryQuery.cpp @@ -17,7 +17,6 @@ #include "nsCOMArray.h" #include "nsNetUtil.h" #include "nsTArray.h" -#include "nsQueryObject.h" #include "prprf.h" #include "nsVariant.h" diff --git a/toolkit/components/places/nsNavHistoryResult.cpp b/toolkit/components/places/nsNavHistoryResult.cpp index e3e9e48ec314..b5c7a670e649 100644 --- a/toolkit/components/places/nsNavHistoryResult.cpp +++ b/toolkit/components/places/nsNavHistoryResult.cpp @@ -16,22 +16,17 @@ #include "nsReadableUtils.h" #include "nsUnicharUtils.h" #include "prtime.h" -#include "mozIStorageRow.h" -#include "mozIStorageResultSet.h" #include "nsQueryObject.h" #include "mozilla/dom/PlacesObservers.h" #include "mozilla/dom/PlacesVisit.h" #include "mozilla/dom/PlacesVisitRemoved.h" #include "mozilla/dom/PlacesVisitTitle.h" -#include "mozilla/dom/PlacesBookmarkAddition.h" -#include "mozilla/dom/PlacesBookmarkRemoved.h" #include "mozilla/dom/PlacesBookmarkMoved.h" #include "mozilla/dom/PlacesBookmarkKeyword.h" #include "mozilla/dom/PlacesBookmarkTags.h" #include "mozilla/dom/PlacesBookmarkTime.h" #include "mozilla/dom/PlacesBookmarkTitle.h" #include "mozilla/dom/PlacesBookmarkUrl.h" -#include "mozilla/dom/PlacesFavicon.h" #include "nsCycleCollectionParticipant.h" @@ -76,7 +71,6 @@ #define MAX_PAGE_REMOVES_BEFORE_REFRESH 10 using namespace mozilla; -using namespace mozilla::dom; using namespace mozilla::places; namespace { diff --git a/toolkit/crashreporter/client/crashreporter.cpp b/toolkit/crashreporter/client/crashreporter.cpp index 4426e6446c45..01161af6fd27 100644 --- a/toolkit/crashreporter/client/crashreporter.cpp +++ b/toolkit/crashreporter/client/crashreporter.cpp @@ -149,6 +149,15 @@ static string Basename(const string& file) { return file; } +static string GetDumpLocalID() { + string localId = Basename(gReporterDumpFile); + string::size_type dot = localId.rfind('.'); + + if (dot == string::npos) return ""; + + return localId.substr(0, dot); +} + static bool ReadEventFile(const string& aPath, string& aEventVersion, string& aTime, string& aUuid, Json::Value& aData) { bool res = false; @@ -198,7 +207,7 @@ static void UpdateEventFile(const Json::Value& aExtraData, const string& aHash, return; } - string localId = CrashReporter::GetDumpLocalID(); + string localId = GetDumpLocalID(); string path = gEventsPath + UI_DIR_SEPARATOR + localId; string eventVersion; string crashTime; @@ -231,7 +240,7 @@ static void WriteSubmissionEvent(SubmissionResult result, return; } - string localId = CrashReporter::GetDumpLocalID(); + string localId = GetDumpLocalID(); string fpath = gEventsPath + UI_DIR_SEPARATOR + localId + "-submission"; ofstream* f = UIOpenWrite(fpath, ios::binary); time_t tm; @@ -523,34 +532,6 @@ static string ComputeDumpHash() { return ""; // If we encountered an error, return an empty hash } -string GetDumpLocalID() { - string localId = Basename(gReporterDumpFile); - string::size_type dot = localId.rfind('.'); - - if (dot == string::npos) return ""; - - return localId.substr(0, dot); -} - -string GetProgramPath(const string& exename) { - string path = gArgv[0]; - size_t pos = path.rfind(UI_CRASH_REPORTER_FILENAME BIN_SUFFIX); - path.erase(pos); -#ifdef XP_MACOSX - // On macOS the crash reporter client is shipped as an application bundle - // contained within Firefox' main application bundle. So when it's invoked - // its current working directory looks like: - // Firefox.app/Contents/MacOS/crashreporter.app/Contents/MacOS/ - // The other applications we ship with Firefox are stored in the main bundle - // (Firefox.app/Contents/MacOS/) so we we need to go back three directories - // to reach them. - path.append("../../../"); -#endif // XP_MACOSX - path.append(exename + BIN_SUFFIX); - - return path; -} - } // namespace CrashReporter using namespace CrashReporter; @@ -612,6 +593,25 @@ bool CheckEndOfLifed(const Json::Value& aVersion) { return UIFileExists(reportPath); } +static string GetProgramPath(const string& exename) { + string path = gArgv[0]; + size_t pos = path.rfind(UI_CRASH_REPORTER_FILENAME BIN_SUFFIX); + path.erase(pos); +#ifdef XP_MACOSX + // On macOS the crash reporter client is shipped as an application bundle + // contained within Firefox' main application bundle. So when it's invoked + // its current working directory looks like: + // Firefox.app/Contents/MacOS/crashreporter.app/Contents/MacOS/ + // The other applications we ship with Firefox are stored in the main bundle + // (Firefox.app/Contents/MacOS/) so we we need to go back three directories + // to reach them. + path.append("../../../"); +#endif // XP_MACOSX + path.append(exename + BIN_SUFFIX); + + return path; +} + int main(int argc, char** argv) { gArgc = argc; gArgv = argv; @@ -645,8 +645,7 @@ int main(int argc, char** argv) { if (!dumpAllThreadsEnv.empty()) { args.insert(args.begin(), "--full"); } - UIRunProgram(CrashReporter::GetProgramPath(UI_MINIDUMP_ANALYZER_FILENAME), - args, + UIRunProgram(GetProgramPath(UI_MINIDUMP_ANALYZER_FILENAME), args, /* wait */ true); // go ahead with the crash reporter diff --git a/toolkit/crashreporter/client/crashreporter.h b/toolkit/crashreporter/client/crashreporter.h index d0ac7a862646..1fdfd91d179b 100644 --- a/toolkit/crashreporter/client/crashreporter.h +++ b/toolkit/crashreporter/client/crashreporter.h @@ -100,9 +100,6 @@ bool ReadStringsFromFile(const std::string& path, StringTable& strings, void LogMessage(const std::string& message); void DeleteDump(); -std::string GetDumpLocalID(); -std::string GetProgramPath(const std::string& exename); - // Telemetry ping bool SendCrashPing(Json::Value& extra, const std::string& hash, std::string& pingUuid, const std::string& pingDir); diff --git a/toolkit/crashreporter/client/crashreporter_gtk_common.cpp b/toolkit/crashreporter/client/crashreporter_gtk_common.cpp index d4bed0209c07..3d72e37503d7 100644 --- a/toolkit/crashreporter/client/crashreporter_gtk_common.cpp +++ b/toolkit/crashreporter/client/crashreporter_gtk_common.cpp @@ -89,7 +89,7 @@ static bool RestartApplication() { } // Quit the app, used as a timeout callback -gboolean CloseApp(gpointer data) { +static gboolean CloseApp(gpointer data) { if (!gAutoSubmit) { gtk_main_quit(); } diff --git a/toolkit/crashreporter/client/crashreporter_gtk_common.h b/toolkit/crashreporter/client/crashreporter_gtk_common.h index 208c7ba6b0b7..5540d68e022d 100644 --- a/toolkit/crashreporter/client/crashreporter_gtk_common.h +++ b/toolkit/crashreporter/client/crashreporter_gtk_common.h @@ -37,7 +37,6 @@ extern std::string gSendURL; extern std::string gURLParameter; void LoadProxyinfo(); -gboolean CloseApp(gpointer data); gpointer SendThread(gpointer args); gboolean WindowDeleted(GtkWidget* window, GdkEvent* event, gpointer userData); gboolean check_escape(GtkWidget* window, GdkEventKey* event, gpointer data); diff --git a/toolkit/crashreporter/client/crashreporter_linux.cpp b/toolkit/crashreporter/client/crashreporter_linux.cpp index d11f10a47233..6b905e8b7af8 100644 --- a/toolkit/crashreporter/client/crashreporter_linux.cpp +++ b/toolkit/crashreporter/client/crashreporter_linux.cpp @@ -76,7 +76,7 @@ static string Escape(const string& str) { return ret; } -static bool WriteStrings(std::ostream& out, const string& header, +static bool WriteStrings(ostream& out, const string& header, StringTable& strings, bool escape) { out << "[" << header << "]" << std::endl; for (const auto& iter : strings) { @@ -95,7 +95,7 @@ static bool WriteStrings(std::ostream& out, const string& header, static bool WriteStringsToFile(const string& path, const string& header, StringTable& strings, bool escape) { - std::ofstream* f = UIOpenWrite(path, ios::trunc); + ofstream* f = UIOpenWrite(path, ios::trunc); bool success = false; if (f->is_open()) { success = WriteStrings(*f, header, strings, escape); diff --git a/toolkit/crashreporter/client/crashreporter_unix_common.cpp b/toolkit/crashreporter/client/crashreporter_unix_common.cpp index 0cecc6262aee..ed8cf3dc132b 100644 --- a/toolkit/crashreporter/client/crashreporter_unix_common.cpp +++ b/toolkit/crashreporter/client/crashreporter_unix_common.cpp @@ -5,7 +5,6 @@ #include "crashreporter.h" #include -#include #include #include diff --git a/toolkit/crashreporter/client/moz.build b/toolkit/crashreporter/client/moz.build index f678ca1cd652..2fa70c6e3e89 100644 --- a/toolkit/crashreporter/client/moz.build +++ b/toolkit/crashreporter/client/moz.build @@ -94,3 +94,5 @@ RCINCLUDE = "crashreporter.rc" DisableStlWrapping() include("/toolkit/crashreporter/crashreporter.mozbuild") + +REQUIRES_UNIFIED_BUILD = True diff --git a/toolkit/crashreporter/client/ping.cpp b/toolkit/crashreporter/client/ping.cpp index 72dc163de25c..2187509ae02b 100644 --- a/toolkit/crashreporter/client/ping.cpp +++ b/toolkit/crashreporter/client/ping.cpp @@ -6,7 +6,6 @@ #include "crashreporter.h" #include -#include #include #if defined(XP_LINUX) @@ -144,7 +143,7 @@ static Json::Value CreatePayloadNode(const Json::Value& aExtra, payload["crashDate"] = CurrentDate(kISO8601Date); payload["crashTime"] = CurrentDate(kISO8601DateHours); payload["hasCrashEnvironment"] = true; - payload["crashId"] = CrashReporter::GetDumpLocalID(); + payload["crashId"] = GetDumpLocalID(); payload["minidumpSha256Hash"] = aHash; payload["processType"] = "main"; // This is always a main crash if (aExtra.isMember("StackTraces")) { @@ -246,7 +245,7 @@ string GenerateSubmissionUrl(const string& aUrl, const string& aId, // // Returns true if the ping was written out successfully, false otherwise. static bool WritePing(const string& aPath, const string& aPing) { - std::ofstream* f = UIOpenWrite(aPath, std::ios::trunc); + ofstream* f = UIOpenWrite(aPath, ios::trunc); bool success = false; if (f->is_open()) { @@ -311,9 +310,8 @@ bool SendCrashPing(Json::Value& aExtra, const string& aHash, string& aPingUuid, } // Hand over the ping to the sender - std::vector args = {url, pingPath}; - if (UIRunProgram(CrashReporter::GetProgramPath(UI_PING_SENDER_FILENAME), - args)) { + vector args = {url, pingPath}; + if (UIRunProgram(GetProgramPath(UI_PING_SENDER_FILENAME), args)) { aPingUuid = uuid; return true; } else { diff --git a/toolkit/crashreporter/minidump-analyzer/moz.build b/toolkit/crashreporter/minidump-analyzer/moz.build index b6b3cebfeae6..841476e3a44c 100644 --- a/toolkit/crashreporter/minidump-analyzer/moz.build +++ b/toolkit/crashreporter/minidump-analyzer/moz.build @@ -41,3 +41,5 @@ if CONFIG["OS_TARGET"] != "WINNT": DisableStlWrapping() include("/toolkit/crashreporter/crashreporter.mozbuild") + +REQUIRES_UNIFIED_BUILD = True diff --git a/toolkit/crashreporter/moz.build b/toolkit/crashreporter/moz.build index c78344d9d81d..091cb712c7cb 100644 --- a/toolkit/crashreporter/moz.build +++ b/toolkit/crashreporter/moz.build @@ -138,3 +138,5 @@ GeneratedFile( with Files("**"): BUG_COMPONENT = ("Toolkit", "Crash Reporting") + +REQUIRES_UNIFIED_BUILD = True diff --git a/toolkit/xre/dllservices/ModuleEvaluator.cpp b/toolkit/xre/dllservices/ModuleEvaluator.cpp index 6e8a3c34936c..58814e34a55e 100644 --- a/toolkit/xre/dllservices/ModuleEvaluator.cpp +++ b/toolkit/xre/dllservices/ModuleEvaluator.cpp @@ -59,6 +59,8 @@ static Vector GetKeyboardLayoutDlls() { Unused << result.emplaceBack(std::move(ws)); } } + + return result; } /* static */ diff --git a/toolkit/xre/dllservices/UntrustedModulesData.cpp b/toolkit/xre/dllservices/UntrustedModulesData.cpp index 297dbac5541f..26e5a04104cb 100644 --- a/toolkit/xre/dllservices/UntrustedModulesData.cpp +++ b/toolkit/xre/dllservices/UntrustedModulesData.cpp @@ -17,7 +17,6 @@ #include "mozilla/Unused.h" #include "mozilla/WinDllServices.h" #include "ModuleEvaluator.h" -#include "ModuleVersionInfo.h" #include "nsCOMPtr.h" #include "nsDebug.h" #include "nsXULAppAPI.h" diff --git a/toolkit/xre/dllservices/moz.build b/toolkit/xre/dllservices/moz.build index 9fb82f6c2339..bb23f5fb5352 100644 --- a/toolkit/xre/dllservices/moz.build +++ b/toolkit/xre/dllservices/moz.build @@ -41,3 +41,5 @@ TEST_DIRS += [ ] include("/ipc/chromium/chromium-config.mozbuild") + +REQUIRES_UNIFIED_BUILD = True