author | Andi-Bogdan Postelnicu <andi@mozilla.com> |
Mon, 10 May 2021 07:15:07 +0000 | |
changeset 579221 | fc1023cb15a328dba196b783a8701640138bfbba |
parent 579220 | 3dbe9bfce447de0cf034be4deac0925027659f79 |
child 579222 | eaeaa4460a8db1330aa8f2cf89015660c85a3594 |
push id | 142842 |
push user | bpostelnicu@mozilla.com |
push date | Mon, 10 May 2021 07:17:36 +0000 |
treeherder | autoland@eaeaa4460a8d [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | sylvestre |
bugs | 1519636 |
milestone | 90.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
|
--- a/browser/app/winlauncher/LauncherProcessWin.cpp +++ b/browser/app/winlauncher/LauncherProcessWin.cpp @@ -245,18 +245,18 @@ Maybe<int> LauncherMain(int& argc, wchar mozilla::HandleLauncherError(commitResult); } #endif // defined(MOZ_LAUNCHER_PROCESS) return Nothing(); } // Make sure that the launcher process itself has image load policies set if (IsWin10AnniversaryUpdateOrLater()) { - static const StaticDynamicallyLinkedFunctionPtr<decltype( - &SetProcessMitigationPolicy)> + static const StaticDynamicallyLinkedFunctionPtr< + decltype(&SetProcessMitigationPolicy)> pSetProcessMitigationPolicy(L"kernel32.dll", "SetProcessMitigationPolicy"); if (pSetProcessMitigationPolicy) { PROCESS_MITIGATION_IMAGE_LOAD_POLICY imgLoadPol = {}; imgLoadPol.PreferSystem32Images = 1; DebugOnly<BOOL> setOk = pSetProcessMitigationPolicy( ProcessImageLoadPolicy, &imgLoadPol, sizeof(imgLoadPol));
--- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -446,24 +446,25 @@ struct FullObjectStoreMetadata { private: ~FullObjectStoreMetadata() = default; }; typedef nsTHashMap<nsUint64HashKey, SafeRefPtr<FullObjectStoreMetadata>> ObjectStoreTable; static_assert( + std::is_same_v<IndexOrObjectStoreId, + std::remove_cv_t<std::remove_reference_t< + decltype(std::declval<const ObjectStoreGetParams&>() + .objectStoreId())>>>); +static_assert( std::is_same_v< IndexOrObjectStoreId, - std::remove_cv_t<std::remove_reference_t<decltype( - std::declval<const ObjectStoreGetParams&>().objectStoreId())>>>); -static_assert(std::is_same_v< - IndexOrObjectStoreId, - std::remove_cv_t<std::remove_reference_t<decltype( - std::declval<const IndexGetParams&>().objectStoreId())>>>); + std::remove_cv_t<std::remove_reference_t< + decltype(std::declval<const IndexGetParams&>().objectStoreId())>>>); struct FullDatabaseMetadata final : AtomicSafeRefCounted<FullDatabaseMetadata> { DatabaseMetadata mCommonMetadata; nsCString mDatabaseId; nsString mFilePath; ObjectStoreTable mObjectStores; IndexOrObjectStoreId mNextObjectStoreId = 0; @@ -20686,18 +20687,18 @@ CursorOpBaseHelperBase<CursorType>::Popu // CAUTION: It is important that only the part of the function above this // comment may fail, and modifications to the data structure (in particular // mResponse and mFiles) may only be made below. This is necessary to allow to // discard entries that were attempted to be preloaded without causing an // inconsistent state. if (aInitializeResponse) { - mOp.mResponse = std::remove_reference_t<decltype( - populateResponseHelper.GetTypedResponse(&mOp.mResponse))>(); + mOp.mResponse = std::remove_reference_t< + decltype(populateResponseHelper.GetTypedResponse(&mOp.mResponse))>(); } auto& responses = populateResponseHelper.GetTypedResponse(&mOp.mResponse); auto& response = *responses.AppendElement(); populateResponseHelper.FillKeys(response); if constexpr (!CursorTypeTraits<CursorType>::IsKeyOnlyCursor) { populateResponseHelper.MaybeFillCloneInfo(response, &mOp.mFiles);
--- a/dom/media/MediaBlockCacheBase.h +++ b/dom/media/MediaBlockCacheBase.h @@ -32,20 +32,22 @@ namespace mozilla { // whereas reads can be done with byte granularity. // // Note it's also recommended not to read from the media cache from the main // thread to prevent jank. class MediaBlockCacheBase { public: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaBlockCacheBase) - static_assert(MediaCacheStream::BLOCK_SIZE < - static_cast<std::remove_const<decltype( - MediaCacheStream::BLOCK_SIZE)>::type>(INT32_MAX), - "MediaCacheStream::BLOCK_SIZE should fit in 31 bits"); + static_assert( + MediaCacheStream::BLOCK_SIZE < + static_cast< + std::remove_const<decltype(MediaCacheStream::BLOCK_SIZE)>::type>( + INT32_MAX), + "MediaCacheStream::BLOCK_SIZE should fit in 31 bits"); static const int32_t BLOCK_SIZE = MediaCacheStream::BLOCK_SIZE; protected: virtual ~MediaBlockCacheBase() = default; public: // Initialize this cache. virtual nsresult Init() = 0;
--- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp @@ -107,23 +107,23 @@ FFmpegLibWrapper::LinkResult FFmpegLibWr #define AV_FUNC_OPTION_SILENT(func, ver) \ if ((ver)&version) { \ if (!(func = (decltype(func))PR_FindSymbol( \ ((ver)&AV_FUNC_AVUTIL_MASK) ? mAVUtilLib : mAVCodecLib, \ #func))) { \ } \ } else { \ - func = (decltype(func)) nullptr; \ + func = (decltype(func))nullptr; \ } -#define AV_FUNC_OPTION(func, ver) \ - AV_FUNC_OPTION_SILENT(func, ver) \ - if ((ver)&version && (func) == (decltype(func)) nullptr) { \ - FFMPEG_LOG("Couldn't load function " #func); \ +#define AV_FUNC_OPTION(func, ver) \ + AV_FUNC_OPTION_SILENT(func, ver) \ + if ((ver)&version && (func) == (decltype(func))nullptr) { \ + FFMPEG_LOG("Couldn't load function " #func); \ } #define AV_FUNC(func, ver) \ AV_FUNC_OPTION(func, ver) \ if ((ver)&version && !func) { \ Unlink(); \ return isFFMpeg ? LinkResult::MissingFFMpegFunction \ : LinkResult::MissingLibAVFunction; \ @@ -174,17 +174,17 @@ FFmpegLibWrapper::LinkResult FFmpegLibWr AV_FUNC_OPTION_SILENT(av_dict_free, AV_FUNC_58) #endif #undef AV_FUNC #undef AV_FUNC_OPTION #ifdef MOZ_WAYLAND # define VA_FUNC_OPTION_SILENT(func) \ if (!(func = (decltype(func))PR_FindSymbol(mVALib, #func))) { \ - func = (decltype(func)) nullptr; \ + func = (decltype(func))nullptr; \ } // mVALib is optional and may not be present. if (mVALib) { VA_FUNC_OPTION_SILENT(vaExportSurfaceHandle) VA_FUNC_OPTION_SILENT(vaSyncSurface) VA_FUNC_OPTION_SILENT(vaInitialize) VA_FUNC_OPTION_SILENT(vaTerminate)
--- a/dom/quota/CheckedUnsafePtr.h +++ b/dom/quota/CheckedUnsafePtr.h @@ -80,20 +80,20 @@ class CheckedUnsafePtrBaseAccess { aBase.mIsDangling = true; } }; template <typename T, CheckingSupport = T::SupportsChecking::value> class CheckedUnsafePtrBase; template <typename T, typename U, typename S = std::nullptr_t> -using EnableIfCompatible = - std::enable_if_t<std::is_base_of<T, std::remove_reference_t<decltype( - *std::declval<U>())>>::value, - S>; +using EnableIfCompatible = std::enable_if_t< + std::is_base_of< + T, std::remove_reference_t<decltype(*std::declval<U>())>>::value, + S>; template <typename T> class CheckedUnsafePtrBase<T, CheckingSupport::Enabled> : detail::CheckedUnsafePtrBaseCheckingEnabled { public: MOZ_IMPLICIT constexpr CheckedUnsafePtrBase(const std::nullptr_t = nullptr) : mRawPtr(nullptr) {}
--- a/dom/webauthn/WinWebAuthnManager.cpp +++ b/dom/webauthn/WinWebAuthnManager.cpp @@ -19,29 +19,27 @@ namespace dom { namespace { static mozilla::LazyLogModule gWinWebAuthnManagerLog("winwebauthnkeymanager"); StaticAutoPtr<WinWebAuthnManager> gWinWebAuthnManager; static HMODULE gWinWebAuthnModule = 0; static decltype(WebAuthNIsUserVerifyingPlatformAuthenticatorAvailable)* gWinWebauthnIsUVPAA = nullptr; -static decltype( - WebAuthNAuthenticatorMakeCredential)* gWinWebauthnMakeCredential = nullptr; -static decltype( - WebAuthNFreeCredentialAttestation)* gWinWebauthnFreeCredentialAttestation = - nullptr; +static decltype(WebAuthNAuthenticatorMakeCredential)* + gWinWebauthnMakeCredential = nullptr; +static decltype(WebAuthNFreeCredentialAttestation)* + gWinWebauthnFreeCredentialAttestation = nullptr; static decltype(WebAuthNAuthenticatorGetAssertion)* gWinWebauthnGetAssertion = nullptr; static decltype(WebAuthNFreeAssertion)* gWinWebauthnFreeAssertion = nullptr; static decltype(WebAuthNGetCancellationId)* gWinWebauthnGetCancellationId = nullptr; -static decltype( - WebAuthNCancelCurrentOperation)* gWinWebauthnCancelCurrentOperation = - nullptr; +static decltype(WebAuthNCancelCurrentOperation)* + gWinWebauthnCancelCurrentOperation = nullptr; static decltype(WebAuthNGetErrorName)* gWinWebauthnGetErrorName = nullptr; static decltype(WebAuthNGetApiVersionNumber)* gWinWebauthnGetApiVersionNumber = nullptr; } // namespace /*********************************************************************** * WinWebAuthnManager Implementation @@ -52,18 +50,18 @@ constexpr uint32_t kMinWinWebAuthNApiVer WinWebAuthnManager::WinWebAuthnManager() { // Create on the main thread to make sure ClearOnShutdown() works. MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(!gWinWebAuthnModule); gWinWebAuthnModule = LoadLibrarySystem32(L"webauthn.dll"); if (gWinWebAuthnModule) { - gWinWebauthnIsUVPAA = reinterpret_cast<decltype( - WebAuthNIsUserVerifyingPlatformAuthenticatorAvailable)*>( + gWinWebauthnIsUVPAA = reinterpret_cast< + decltype(WebAuthNIsUserVerifyingPlatformAuthenticatorAvailable)*>( GetProcAddress( gWinWebAuthnModule, "WebAuthNIsUserVerifyingPlatformAuthenticatorAvailable")); gWinWebauthnMakeCredential = reinterpret_cast<decltype(WebAuthNAuthenticatorMakeCredential)*>( GetProcAddress(gWinWebAuthnModule, "WebAuthNAuthenticatorMakeCredential")); gWinWebauthnFreeCredentialAttestation =
--- a/dom/workers/WorkerScope.cpp +++ b/dom/workers/WorkerScope.cpp @@ -988,18 +988,19 @@ already_AddRefed<Promise> ServiceWorkerG MOZ_ASSERT(mWorkerPrivate->IsServiceWorker()); RefPtr<Promise> promise = Promise::Create(this, aRv); if (NS_WARN_IF(aRv.Failed())) { return nullptr; } if (ServiceWorkerParentInterceptEnabled()) { - using MozPromiseType = decltype( - mWorkerPrivate->SetServiceWorkerSkipWaitingFlag())::element_type; + using MozPromiseType = + decltype(mWorkerPrivate + ->SetServiceWorkerSkipWaitingFlag())::element_type; auto holder = MakeRefPtr<DOMMozPromiseRequestHolder<MozPromiseType>>(this); mWorkerPrivate->SetServiceWorkerSkipWaitingFlag() ->Then(GetCurrentSerialEventTarget(), __func__, [holder, promise](const MozPromiseType::ResolveOrRejectValue&) { holder->Complete(); promise->MaybeResolveWithUndefined(); })
--- a/gfx/vr/service/OSVRSession.cpp +++ b/gfx/vr/service/OSVRSession.cpp @@ -347,23 +347,25 @@ void OSVRSession::InitializeDisplay() { } bool OSVRSession::InitState(mozilla::gfx::VRSystemState& aSystemState) { VRDisplayState& state = aSystemState.displayState; strncpy(state.displayName, "OSVR HMD", kVRDisplayNameMaxLen); state.eightCC = GFX_VR_EIGHTCC('O', 'S', 'V', 'R', ' ', ' ', ' ', ' '); state.isConnected = true; state.isMounted = false; - state.capabilityFlags = (VRDisplayCapabilityFlags)( - (int)VRDisplayCapabilityFlags::Cap_None | - (int)VRDisplayCapabilityFlags::Cap_Orientation | - (int)VRDisplayCapabilityFlags::Cap_Position | - (int)VRDisplayCapabilityFlags::Cap_External | - (int)VRDisplayCapabilityFlags::Cap_Present | - (int)VRDisplayCapabilityFlags::Cap_ImmersiveVR); + state.capabilityFlags = + (VRDisplayCapabilityFlags)((int)VRDisplayCapabilityFlags::Cap_None | + (int) + VRDisplayCapabilityFlags::Cap_Orientation | + (int)VRDisplayCapabilityFlags::Cap_Position | + (int)VRDisplayCapabilityFlags::Cap_External | + (int)VRDisplayCapabilityFlags::Cap_Present | + (int) + VRDisplayCapabilityFlags::Cap_ImmersiveVR); state.blendMode = VRDisplayBlendMode::Opaque; state.reportsDroppedFrames = false; // XXX OSVR display topology allows for more than one viewer // will assume only one viewer for now (most likely stay that way) OSVR_EyeCount numEyes; osvr_ClientGetNumEyesForViewer(m_display, 0, &numEyes); @@ -407,19 +409,20 @@ bool OSVRSession::InitState(mozilla::gfx pose.PreTranslate(eyePose.translation.data[0], eyePose.translation.data[1], eyePose.translation.data[2]); pose.Invert(); mHeadToEye[eye] = pose; } // default to an identity quaternion VRHMDSensorState& sensorState = aSystemState.sensorState; - sensorState.flags = (VRDisplayCapabilityFlags)( - (int)VRDisplayCapabilityFlags::Cap_Orientation | - (int)VRDisplayCapabilityFlags::Cap_Position); + sensorState.flags = + (VRDisplayCapabilityFlags)((int) + VRDisplayCapabilityFlags::Cap_Orientation | + (int)VRDisplayCapabilityFlags::Cap_Position); sensorState.pose.orientation[3] = 1.0f; // Default to an identity quaternion return true; } void OSVRSession::Shutdown() { if (!mRuntimeLoaded) { return;
--- a/gfx/vr/service/OculusSession.cpp +++ b/gfx/vr/service/OculusSession.cpp @@ -1059,19 +1059,20 @@ bool OculusSession::InitState(VRSystemSt // default to an identity quaternion aSystemState.sensorState.pose.orientation[3] = 1.0f; UpdateStageParameters(state); UpdateEyeParameters(aSystemState); VRHMDSensorState& sensorState = aSystemState.sensorState; - sensorState.flags = (VRDisplayCapabilityFlags)( - (int)VRDisplayCapabilityFlags::Cap_Orientation | - (int)VRDisplayCapabilityFlags::Cap_Position); + sensorState.flags = + (VRDisplayCapabilityFlags)((int) + VRDisplayCapabilityFlags::Cap_Orientation | + (int)VRDisplayCapabilityFlags::Cap_Position); sensorState.pose.orientation[3] = 1.0f; // Default to an identity quaternion return true; } void OculusSession::UpdateStageParameters(VRDisplayState& aState) { ovrVector3f playArea; ovrResult res =
--- a/gfx/vr/service/OpenVRSession.cpp +++ b/gfx/vr/service/OpenVRSession.cpp @@ -708,53 +708,58 @@ void OpenVRSession::Shutdown() { bool OpenVRSession::InitState(VRSystemState& aSystemState) { VRDisplayState& state = aSystemState.displayState; strncpy(state.displayName, "OpenVR HMD", kVRDisplayNameMaxLen); state.eightCC = GFX_VR_EIGHTCC('O', 'p', 'e', 'n', 'V', 'R', ' ', ' '); state.isConnected = mVRSystem->IsTrackedDeviceConnected(::vr::k_unTrackedDeviceIndex_Hmd); state.isMounted = false; - state.capabilityFlags = (VRDisplayCapabilityFlags)( - (int)VRDisplayCapabilityFlags::Cap_None | - (int)VRDisplayCapabilityFlags::Cap_Orientation | - (int)VRDisplayCapabilityFlags::Cap_Position | - (int)VRDisplayCapabilityFlags::Cap_External | - (int)VRDisplayCapabilityFlags::Cap_Present | - (int)VRDisplayCapabilityFlags::Cap_StageParameters | - (int)VRDisplayCapabilityFlags::Cap_ImmersiveVR); + state.capabilityFlags = + (VRDisplayCapabilityFlags)((int)VRDisplayCapabilityFlags::Cap_None | + (int) + VRDisplayCapabilityFlags::Cap_Orientation | + (int)VRDisplayCapabilityFlags::Cap_Position | + (int)VRDisplayCapabilityFlags::Cap_External | + (int)VRDisplayCapabilityFlags::Cap_Present | + (int)VRDisplayCapabilityFlags:: + Cap_StageParameters | + (int) + VRDisplayCapabilityFlags::Cap_ImmersiveVR); state.blendMode = VRDisplayBlendMode::Opaque; state.reportsDroppedFrames = true; ::vr::ETrackedPropertyError err; bool bHasProximitySensor = mVRSystem->GetBoolTrackedDeviceProperty( ::vr::k_unTrackedDeviceIndex_Hmd, ::vr::Prop_ContainsProximitySensor_Bool, &err); if (err == ::vr::TrackedProp_Success && bHasProximitySensor) { - state.capabilityFlags = (VRDisplayCapabilityFlags)( - (int)state.capabilityFlags | - (int)VRDisplayCapabilityFlags::Cap_MountDetection); + state.capabilityFlags = + (VRDisplayCapabilityFlags)((int)state.capabilityFlags | + (int)VRDisplayCapabilityFlags:: + Cap_MountDetection); } uint32_t w, h; mVRSystem->GetRecommendedRenderTargetSize(&w, &h); state.eyeResolution.width = w; state.eyeResolution.height = h; state.nativeFramebufferScaleFactor = 1.0f; // default to an identity quaternion aSystemState.sensorState.pose.orientation[3] = 1.0f; UpdateStageParameters(state); UpdateEyeParameters(aSystemState); VRHMDSensorState& sensorState = aSystemState.sensorState; - sensorState.flags = (VRDisplayCapabilityFlags)( - (int)VRDisplayCapabilityFlags::Cap_Orientation | - (int)VRDisplayCapabilityFlags::Cap_Position); + sensorState.flags = + (VRDisplayCapabilityFlags)((int) + VRDisplayCapabilityFlags::Cap_Orientation | + (int)VRDisplayCapabilityFlags::Cap_Position); sensorState.pose.orientation[3] = 1.0f; // Default to an identity quaternion return true; } void OpenVRSession::UpdateStageParameters(VRDisplayState& aState) { float sizeX = 0.0f; float sizeZ = 0.0f; @@ -873,19 +878,20 @@ void OpenVRSession::UpdateHeadsetPose(VR // pull out a Quaternion. memcpy(&m._11, &pose.mDeviceToAbsoluteTracking, sizeof(pose.mDeviceToAbsoluteTracking)); m.Transpose(); gfx::Quaternion rot; rot.SetFromRotationMatrix(m); - aState.sensorState.flags = (VRDisplayCapabilityFlags)( - (int)aState.sensorState.flags | - (int)VRDisplayCapabilityFlags::Cap_Orientation); + aState.sensorState.flags = + (VRDisplayCapabilityFlags)((int)aState.sensorState.flags | + (int)VRDisplayCapabilityFlags:: + Cap_Orientation); aState.sensorState.pose.orientation[0] = rot.x; aState.sensorState.pose.orientation[1] = rot.y; aState.sensorState.pose.orientation[2] = rot.z; aState.sensorState.pose.orientation[3] = rot.w; aState.sensorState.pose.angularVelocity[0] = pose.vAngularVelocity.v[0]; aState.sensorState.pose.angularVelocity[1] = pose.vAngularVelocity.v[1]; aState.sensorState.pose.angularVelocity[2] = pose.vAngularVelocity.v[2];
--- a/ipc/mscom/AgileReference.cpp +++ b/ipc/mscom/AgileReference.cpp @@ -130,18 +130,18 @@ void AgileReference::AssignInternal(IUnk MOZ_ASSERT(mIid != zeroIid); /* * There are two possible techniques for creating agile references. Starting * with Windows 8.1, we may use the RoGetAgileReference API, which is faster. * If that API is not available, we fall back to using the Global Interface * Table. */ - static const StaticDynamicallyLinkedFunctionPtr<decltype( - &::RoGetAgileReference)> + static const StaticDynamicallyLinkedFunctionPtr< + decltype(&::RoGetAgileReference)> pRoGetAgileReference(L"ole32.dll", "RoGetAgileReference"); MOZ_ASSERT(aObject); if (pRoGetAgileReference && SUCCEEDED(mHResult = pRoGetAgileReference(AGILEREFERENCE_DEFAULT, mIid, aObject, getter_AddRefs(mAgileRef)))) {
--- a/js/src/frontend/EitherParser.h +++ b/js/src/frontend/EitherParser.h @@ -28,18 +28,18 @@ namespace js { namespace detail { template <template <class Parser> class GetThis, template <class This> class MemberFunction, typename... Args> struct InvokeMemberFunction { mozilla::Tuple<std::decay_t<Args>...> args; template <class This, size_t... Indices> - auto matchInternal(This* obj, std::index_sequence<Indices...>) -> decltype( - ((*obj).*(MemberFunction<This>::get()))(mozilla::Get<Indices>(args)...)) { + auto matchInternal(This* obj, std::index_sequence<Indices...>) -> decltype(( + (*obj).*(MemberFunction<This>::get()))(mozilla::Get<Indices>(args)...)) { return ((*obj).* (MemberFunction<This>::get()))(mozilla::Get<Indices>(args)...); } public: template <typename... ActualArgs> explicit InvokeMemberFunction(ActualArgs&&... actualArgs) : args{std::forward<ActualArgs>(actualArgs)...} {}
--- a/layout/style/ComputedStyle.cpp +++ b/layout/style/ComputedStyle.cpp @@ -318,18 +318,19 @@ static nscolor ExtractColor(const Comput return aPaintServer.kind.IsColor() ? ExtractColor(aStyle, aPaintServer.kind.AsColor()) : NS_RGBA(0, 0, 0, 0); } #define STYLE_FIELD(struct_, field_) aField == &struct_::field_ || #define STYLE_STRUCT(name_, fields_) \ template <> \ - nscolor ComputedStyle::GetVisitedDependentColor(decltype( \ - nsStyle##name_::MOZ_ARG_1 fields_) nsStyle##name_::*aField) const { \ + nscolor ComputedStyle::GetVisitedDependentColor( \ + decltype(nsStyle##name_::MOZ_ARG_1 fields_) nsStyle##name_::*aField) \ + const { \ MOZ_ASSERT(MOZ_FOR_EACH(STYLE_FIELD, (nsStyle##name_, ), fields_) false, \ "Getting visited-dependent color for a field in nsStyle" #name_ \ " which is not listed in nsCSSVisitedDependentPropList.h"); \ return GetVisitedDependentColorInternal( \ *this, [aField](const ComputedStyle& aStyle) { \ return ExtractColor(aStyle, aStyle.Style##name_()->*aField); \ }); \ }
--- a/mfbt/Attributes.h +++ b/mfbt/Attributes.h @@ -712,17 +712,17 @@ # define MOZ_CAN_RUN_SCRIPT_FOR_DEFINITION \ __attribute__((annotate("moz_can_run_script"))) # define MOZ_CAN_RUN_SCRIPT_BOUNDARY \ __attribute__((annotate("moz_can_run_script_boundary"))) # define MOZ_MUST_OVERRIDE __attribute__((annotate("moz_must_override"))) # define MOZ_STATIC_CLASS __attribute__((annotate("moz_global_class"))) # define MOZ_STATIC_LOCAL_CLASS \ __attribute__((annotate("moz_static_local_class"))) \ - __attribute__((annotate("moz_trivial_dtor"))) + __attribute__((annotate("moz_trivial_dtor"))) # define MOZ_STACK_CLASS __attribute__((annotate("moz_stack_class"))) # define MOZ_NONHEAP_CLASS __attribute__((annotate("moz_nonheap_class"))) # define MOZ_HEAP_CLASS __attribute__((annotate("moz_heap_class"))) # define MOZ_NON_TEMPORARY_CLASS \ __attribute__((annotate("moz_non_temporary_class"))) # define MOZ_TEMPORARY_CLASS __attribute__((annotate("moz_temporary_class"))) # define MOZ_TRIVIAL_CTOR_DTOR \ __attribute__((annotate("moz_trivial_ctor_dtor"))) @@ -752,18 +752,18 @@ # define MOZ_NON_MEMMOVABLE __attribute__((annotate("moz_non_memmovable"))) # define MOZ_NEEDS_MEMMOVABLE_TYPE \ __attribute__((annotate("moz_needs_memmovable_type"))) # define MOZ_NEEDS_MEMMOVABLE_MEMBERS \ __attribute__((annotate("moz_needs_memmovable_members"))) # define MOZ_NO_DANGLING_ON_TEMPORARIES \ __attribute__((annotate("moz_no_dangling_on_temporaries"))) # define MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS \ - __attribute__( \ - (annotate("moz_inherit_type_annotations_from_template_args"))) + __attribute__(( \ + annotate("moz_inherit_type_annotations_from_template_args"))) # define MOZ_NON_AUTOABLE __attribute__((annotate("moz_non_autoable"))) # define MOZ_INIT_OUTSIDE_CTOR # define MOZ_IS_CLASS_INIT # define MOZ_NON_PARAM __attribute__((annotate("moz_non_param"))) # define MOZ_REQUIRED_BASE_METHOD \ __attribute__((annotate("moz_required_base_method"))) # define MOZ_MUST_RETURN_FROM_CALLER_IF_THIS_IS_ARG \ __attribute__((annotate("moz_must_return_from_caller_if_this_is_arg"))) @@ -776,17 +776,17 @@ * It turns out that clang doesn't like void func() __attribute__ {} without a * warning, so use pragmas to disable the warning. */ # ifdef __clang__ # define MOZ_HEAP_ALLOCATOR \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ __attribute__((annotate("moz_heap_allocator"))) \ - _Pragma("clang diagnostic pop") + _Pragma("clang diagnostic pop") # else # define MOZ_HEAP_ALLOCATOR __attribute__((annotate("moz_heap_allocator"))) # endif # else # define MOZ_CAN_RUN_SCRIPT /* nothing */ # define MOZ_CAN_RUN_SCRIPT_FOR_DEFINITION /* nothing */ # define MOZ_CAN_RUN_SCRIPT_BOUNDARY /* nothing */ # define MOZ_MUST_OVERRIDE /* nothing */
--- a/mfbt/ResultExtensions.h +++ b/mfbt/ResultExtensions.h @@ -95,21 +95,22 @@ struct outparam_as_reference; template <typename T> struct outparam_as_reference<T*> { using type = T&; }; template <typename R, template <typename> typename RArg, typename Func, typename... Args> -using to_result_retval_t = decltype( - std::declval<Func&>()(std::declval<Args&&>()..., - std::declval<typename RArg<decltype( - ResultRefAsParam(std::declval<R&>()))>::type>()), - Result<R, nsresult>(Err(NS_ERROR_FAILURE))); +using to_result_retval_t = + decltype(std::declval<Func&>()( + std::declval<Args&&>()..., + std::declval<typename RArg<decltype(ResultRefAsParam( + std::declval<R&>()))>::type>()), + Result<R, nsresult>(Err(NS_ERROR_FAILURE))); // There are two ToResultInvokeSelector overloads, which cover the cases of a) a // pointer-typed output parameter, and b) a reference-typed output parameter, // using to_result_retval_t in connection with outparam_as_pointer and // outparam_as_reference type traits. These type traits may be specialized for // types other than raw pointers to allow calling functions with argument types // that implicitly convert/bind to a raw pointer/reference. The overload that is // used is selected by expression SFINAE: the decltype expression in
--- a/mfbt/Variant.h +++ b/mfbt/Variant.h @@ -251,19 +251,19 @@ struct VariantImplementation<Tag, N, T, return Next::equal(aLhs, aRhs); } } template <typename Matcher, typename ConcreteVariant> static decltype(auto) match(Matcher&& aMatcher, ConcreteVariant&& aV) { if (aV.template is<N>()) { if constexpr (std::is_invocable_v<Matcher, Tag, - decltype( - std::forward<ConcreteVariant>(aV) - .template as<N>())>) { + decltype(std::forward<ConcreteVariant>( + aV) + .template as<N>())>) { return std::forward<Matcher>(aMatcher)( Tag(N), std::forward<ConcreteVariant>(aV).template as<N>()); } else { return std::forward<Matcher>(aMatcher)( std::forward<ConcreteVariant>(aV).template as<N>()); } } else { // If you're seeing compilation errors here like "no matching @@ -279,19 +279,19 @@ struct VariantImplementation<Tag, N, T, std::forward<ConcreteVariant>(aV)); } } template <typename ConcreteVariant, typename Mi, typename... Ms> static decltype(auto) matchN(ConcreteVariant&& aV, Mi&& aMi, Ms&&... aMs) { if (aV.template is<N>()) { if constexpr (std::is_invocable_v<Mi, Tag, - decltype( - std::forward<ConcreteVariant>(aV) - .template as<N>())>) { + decltype(std::forward<ConcreteVariant>( + aV) + .template as<N>())>) { static_assert( std::is_same_v< decltype(std::forward<Mi>(aMi)( Tag(N), std::forward<ConcreteVariant>(aV).template as<N>())), decltype(Next::matchN(std::forward<ConcreteVariant>(aV), std::forward<Ms>(aMs)...))>, "all matchers must have the same return type");
--- a/mozglue/baseprofiler/public/BlocksRingBuffer.h +++ b/mozglue/baseprofiler/public/BlocksRingBuffer.h @@ -918,21 +918,20 @@ struct ProfileBufferEntryReader::Deseria ProfileBufferBlockIndex::CreateFromProfileBufferIndex(end); MOZ_ASSERT(end - start == len); // Copy bytes into the buffer. auto writer = aBuffer.mMaybeUnderlyingBuffer->mBuffer.EntryWriterFromTo(start, end); writer.WriteFromReader(aER, end - start); MOZ_ASSERT(writer.RemainingBytes() == 0); // Finally copy stats. - aBuffer.mMaybeUnderlyingBuffer->mPushedBlockCount = aER.ReadObject<decltype( - aBuffer.mMaybeUnderlyingBuffer->mPushedBlockCount)>(); - aBuffer.mMaybeUnderlyingBuffer->mClearedBlockCount = - aER.ReadObject<decltype( - aBuffer.mMaybeUnderlyingBuffer->mClearedBlockCount)>(); + aBuffer.mMaybeUnderlyingBuffer->mPushedBlockCount = aER.ReadObject< + decltype(aBuffer.mMaybeUnderlyingBuffer->mPushedBlockCount)>(); + aBuffer.mMaybeUnderlyingBuffer->mClearedBlockCount = aER.ReadObject< + decltype(aBuffer.mMaybeUnderlyingBuffer->mClearedBlockCount)>(); } // We cannot output a BlocksRingBuffer object (not copyable), use `ReadInto()` // or `aER.ReadObject<UniquePtr<BlocksRinbBuffer>>()` instead. static BlocksRingBuffer Read(ProfileBufferEntryReader& aER) = delete; }; // A BlocksRingBuffer is usually refererenced through a UniquePtr, for
--- a/mozglue/dllservices/Authenticode.cpp +++ b/mozglue/dllservices/Authenticode.cpp @@ -48,18 +48,18 @@ struct CertContextDeleter { void operator()(PCCERT_CONTEXT aCertContext) { ::CertFreeCertificateContext(aCertContext); } }; struct CATAdminContextDeleter { typedef HCATADMIN pointer; void operator()(pointer aCtx) { - static const mozilla::StaticDynamicallyLinkedFunctionPtr<decltype( - &::CryptCATAdminReleaseContext)> + static const mozilla::StaticDynamicallyLinkedFunctionPtr< + decltype(&::CryptCATAdminReleaseContext)> pCryptCATAdminReleaseContext(L"wintrust.dll", "CryptCATAdminReleaseContext"); MOZ_ASSERT(!!pCryptCATAdminReleaseContext); if (!pCryptCATAdminReleaseContext) { return; } @@ -202,36 +202,36 @@ bool SignedBinary::VerifySignature(const // We didn't find anything in the binary, so now try a catalog file. // First, we open a catalog admin context. HCATADMIN rawCatAdmin; // Windows 7 also exports the CryptCATAdminAcquireContext2 API, but it does // *not* sign its binaries with SHA-256, so we use the old API in that case. if (mozilla::IsWin8OrLater()) { - static const mozilla::StaticDynamicallyLinkedFunctionPtr<decltype( - &::CryptCATAdminAcquireContext2)> + static const mozilla::StaticDynamicallyLinkedFunctionPtr< + decltype(&::CryptCATAdminAcquireContext2)> pCryptCATAdminAcquireContext2(L"wintrust.dll", "CryptCATAdminAcquireContext2"); if (!pCryptCATAdminAcquireContext2) { return false; } CERT_STRONG_SIGN_PARA policy = {sizeof(policy)}; policy.dwInfoChoice = CERT_STRONG_SIGN_OID_INFO_CHOICE; policy.pszOID = const_cast<char*>( szOID_CERT_STRONG_SIGN_OS_CURRENT); // -Wwritable-strings if (!pCryptCATAdminAcquireContext2(&rawCatAdmin, nullptr, BCRYPT_SHA256_ALGORITHM, &policy, 0)) { return false; } } else { - static const mozilla::StaticDynamicallyLinkedFunctionPtr<decltype( - &::CryptCATAdminAcquireContext)> + static const mozilla::StaticDynamicallyLinkedFunctionPtr< + decltype(&::CryptCATAdminAcquireContext)> pCryptCATAdminAcquireContext(L"wintrust.dll", "CryptCATAdminAcquireContext"); if (!pCryptCATAdminAcquireContext || !pCryptCATAdminAcquireContext(&rawCatAdmin, nullptr, 0)) { return false; } } @@ -247,36 +247,36 @@ bool SignedBinary::VerifySignature(const if (rawFile == INVALID_HANDLE_VALUE) { return false; } nsAutoHandle file(rawFile); DWORD hashLen = 0; mozilla::UniquePtr<BYTE[]> hashBuf; - static const mozilla::StaticDynamicallyLinkedFunctionPtr<decltype( - &::CryptCATAdminCalcHashFromFileHandle2)> + static const mozilla::StaticDynamicallyLinkedFunctionPtr< + decltype(&::CryptCATAdminCalcHashFromFileHandle2)> pCryptCATAdminCalcHashFromFileHandle2( L"wintrust.dll", "CryptCATAdminCalcHashFromFileHandle2"); if (pCryptCATAdminCalcHashFromFileHandle2) { if (!pCryptCATAdminCalcHashFromFileHandle2(rawCatAdmin, rawFile, &hashLen, nullptr, 0) && ::GetLastError() != ERROR_INSUFFICIENT_BUFFER) { return false; } hashBuf = mozilla::MakeUnique<BYTE[]>(hashLen); if (!pCryptCATAdminCalcHashFromFileHandle2(rawCatAdmin, rawFile, &hashLen, hashBuf.get(), 0)) { return false; } } else { - static const mozilla::StaticDynamicallyLinkedFunctionPtr<decltype( - &::CryptCATAdminCalcHashFromFileHandle)> + static const mozilla::StaticDynamicallyLinkedFunctionPtr< + decltype(&::CryptCATAdminCalcHashFromFileHandle)> pCryptCATAdminCalcHashFromFileHandle( L"wintrust.dll", "CryptCATAdminCalcHashFromFileHandle"); if (!pCryptCATAdminCalcHashFromFileHandle) { return false; } if (!pCryptCATAdminCalcHashFromFileHandle(rawFile, &hashLen, nullptr, 0) && @@ -290,26 +290,26 @@ bool SignedBinary::VerifySignature(const 0)) { return false; } } // Now that we've hashed the file, query the catalog system to see if any // catalogs reference a binary with our hash. - static const mozilla::StaticDynamicallyLinkedFunctionPtr<decltype( - &::CryptCATAdminEnumCatalogFromHash)> + static const mozilla::StaticDynamicallyLinkedFunctionPtr< + decltype(&::CryptCATAdminEnumCatalogFromHash)> pCryptCATAdminEnumCatalogFromHash(L"wintrust.dll", "CryptCATAdminEnumCatalogFromHash"); if (!pCryptCATAdminEnumCatalogFromHash) { return false; } - static const mozilla::StaticDynamicallyLinkedFunctionPtr<decltype( - &::CryptCATAdminReleaseCatalogContext)> + static const mozilla::StaticDynamicallyLinkedFunctionPtr< + decltype(&::CryptCATAdminReleaseCatalogContext)> pCryptCATAdminReleaseCatalogContext(L"wintrust.dll", "CryptCATAdminReleaseCatalogContext"); if (!pCryptCATAdminReleaseCatalogContext) { return false; } HCATINFO catInfoHdl = pCryptCATAdminEnumCatalogFromHash( rawCatAdmin, hashBuf.get(), hashLen, 0, nullptr); @@ -321,18 +321,18 @@ bool SignedBinary::VerifySignature(const // parameters. auto cleanCatInfoHdl = mozilla::MakeScopeExit([rawCatAdmin, catInfoHdl]() -> void { pCryptCATAdminReleaseCatalogContext(rawCatAdmin, catInfoHdl, 0); }); // We found a catalog! Now query for the path to the catalog file. - static const mozilla::StaticDynamicallyLinkedFunctionPtr<decltype( - &::CryptCATCatalogInfoFromContext)> + static const mozilla::StaticDynamicallyLinkedFunctionPtr< + decltype(&::CryptCATCatalogInfoFromContext)> pCryptCATCatalogInfoFromContext(L"wintrust.dll", "CryptCATCatalogInfoFromContext"); if (!pCryptCATCatalogInfoFromContext) { return false; } CATALOG_INFO_ catInfo = {sizeof(catInfo)}; if (!pCryptCATCatalogInfoFromContext(catInfoHdl, &catInfo, 0)) {
--- a/mozglue/dllservices/WindowsDllBlocklist.cpp +++ b/mozglue/dllservices/WindowsDllBlocklist.cpp @@ -65,18 +65,18 @@ static WindowsDllInterceptor::FuncHookTy stub_BaseThreadInitThunk; typedef NTSTATUS(NTAPI* LdrLoadDll_func)(PWCHAR filePath, PULONG flags, PUNICODE_STRING moduleFileName, PHANDLE handle); static WindowsDllInterceptor::FuncHookType<LdrLoadDll_func> stub_LdrLoadDll; #ifdef _M_AMD64 -typedef decltype( - RtlInstallFunctionTableCallback)* RtlInstallFunctionTableCallback_func; +typedef decltype(RtlInstallFunctionTableCallback)* + RtlInstallFunctionTableCallback_func; static WindowsDllInterceptor::FuncHookType<RtlInstallFunctionTableCallback_func> stub_RtlInstallFunctionTableCallback; extern uint8_t* sMsMpegJitCodeRegionStart; extern size_t sMsMpegJitCodeRegionSize; BOOLEAN WINAPI patched_RtlInstallFunctionTableCallback( DWORD64 TableIdentifier, DWORD64 BaseAddress, DWORD Length,
--- a/mozglue/dllservices/WindowsFallbackLoaderAPI.cpp +++ b/mozglue/dllservices/WindowsFallbackLoaderAPI.cpp @@ -42,18 +42,18 @@ void FallbackLoaderAPI::NotifyEndDllLoad if (mLoaderObserver) { mLoaderObserver->OnEndDllLoad(aContext, aLoadNtStatus, std::move(aModuleLoadInfo)); } } nt::AllocatedUnicodeString FallbackLoaderAPI::GetSectionName( void* aSectionAddr) { - static const StaticDynamicallyLinkedFunctionPtr<decltype( - &::NtQueryVirtualMemory)> + static const StaticDynamicallyLinkedFunctionPtr< + decltype(&::NtQueryVirtualMemory)> pNtQueryVirtualMemory(L"ntdll.dll", "NtQueryVirtualMemory"); MOZ_ASSERT(pNtQueryVirtualMemory); if (!pNtQueryVirtualMemory) { return nt::AllocatedUnicodeString(); } nt::MemorySectionNameBuf buf;
--- a/mozglue/misc/WindowsMapRemoteView.cpp +++ b/mozglue/misc/WindowsMapRemoteView.cpp @@ -33,18 +33,18 @@ NTSTATUS NTAPI NtMapViewOfSection( HANDLE aSection, HANDLE aProcess, PVOID* aBaseAddress, ULONG_PTR aZeroBits, SIZE_T aCommitSize, PLARGE_INTEGER aSectionOffset, PSIZE_T aViewSize, SECTION_INHERIT aInheritDisposition, ULONG aAllocationType, ULONG aProtectionFlags); NTSTATUS NTAPI NtUnmapViewOfSection(HANDLE aProcess, PVOID aBaseAddress); static DWORD GetWin32ErrorCode(NTSTATUS aNtStatus) { - static const mozilla::StaticDynamicallyLinkedFunctionPtr<decltype( - &RtlNtStatusToDosError)> + static const mozilla::StaticDynamicallyLinkedFunctionPtr< + decltype(&RtlNtStatusToDosError)> pRtlNtStatusToDosError(L"ntdll.dll", "RtlNtStatusToDosError"); MOZ_ASSERT(!!pRtlNtStatusToDosError); if (!pRtlNtStatusToDosError) { return ERROR_GEN_FAILURE; } return pRtlNtStatusToDosError(aNtStatus); @@ -102,18 +102,18 @@ MFBT_API void* MapRemoteViewOfFile(HANDL MFBT_API bool UnmapRemoteViewOfFile(HANDLE aProcess, PVOID aBaseAddress) { static const StaticDynamicallyLinkedFunctionPtr<decltype(&UnmapViewOfFile2)> pUnmapViewOfFile2(L"kernel32.dll", "UnmapViewOfFile2"); if (!!pUnmapViewOfFile2) { return !!pUnmapViewOfFile2(aProcess, aBaseAddress, 0); } - static const StaticDynamicallyLinkedFunctionPtr<decltype( - &NtUnmapViewOfSection)> + static const StaticDynamicallyLinkedFunctionPtr< + decltype(&NtUnmapViewOfSection)> pNtUnmapViewOfSection(L"ntdll.dll", "NtUnmapViewOfSection"); MOZ_ASSERT(!!pNtUnmapViewOfSection); if (!pNtUnmapViewOfSection) { return false; } NTSTATUS ntStatus = pNtUnmapViewOfSection(aProcess, aBaseAddress);
--- a/mozglue/misc/WindowsProcessMitigations.cpp +++ b/mozglue/misc/WindowsProcessMitigations.cpp @@ -14,18 +14,18 @@ BOOL WINAPI GetProcessMitigationPolicy( HANDLE hProcess, PROCESS_MITIGATION_POLICY MitigationPolicy, PVOID lpBuffer, SIZE_T dwLength); #endif // (_WIN32_WINNT < 0x0602) namespace mozilla { static decltype(&::GetProcessMitigationPolicy) FetchGetProcessMitigationPolicyFunc() { - static const StaticDynamicallyLinkedFunctionPtr<decltype( - &::GetProcessMitigationPolicy)> + static const StaticDynamicallyLinkedFunctionPtr< + decltype(&::GetProcessMitigationPolicy)> pGetProcessMitigationPolicy(L"kernel32.dll", "GetProcessMitigationPolicy"); return pGetProcessMitigationPolicy; } MFBT_API bool IsWin32kLockedDown() { auto pGetProcessMitigationPolicy = FetchGetProcessMitigationPolicyFunc(); if (!pGetProcessMitigationPolicy) {
--- a/mozglue/misc/interceptor/MMPolicies.h +++ b/mozglue/misc/interceptor/MMPolicies.h @@ -538,18 +538,18 @@ class MOZ_TRIVIAL_CTOR_DTOR MMPolicyInPr auto reserveFn = [](HANDLE aProcess, PVOID aBase, uint32_t aSize) -> PVOID { return ::VirtualAlloc(aBase, aSize, MEM_RESERVE, PAGE_NOACCESS); }; auto reserveWithinRangeFn = [](HANDLE aProcess, uint32_t aSize, const uint8_t* aRangeMin, const uint8_t* aRangeMaxExcl) -> Maybe<PVOID> { - static const StaticDynamicallyLinkedFunctionPtr<decltype( - &::VirtualAlloc2)> + static const StaticDynamicallyLinkedFunctionPtr< + decltype(&::VirtualAlloc2)> pVirtualAlloc2(L"kernelbase.dll", "VirtualAlloc2"); if (!pVirtualAlloc2) { return Nothing(); } // NB: MEM_ADDRESS_REQUIREMENTS::HighestEndingAddress is *inclusive* MEM_ADDRESS_REQUIREMENTS memReq = { const_cast<uint8_t*>(aRangeMin), @@ -875,18 +875,18 @@ class MMPolicyOutOfProcess : public MMPo return mozilla::MapRemoteViewOfFile(mapping, aProcess, 0ULL, aBase, 0, 0, PAGE_EXECUTE_READ); }; auto reserveWithinRangeFn = [mapping = mMapping](HANDLE aProcess, uint32_t aSize, const uint8_t* aRangeMin, const uint8_t* aRangeMaxExcl) -> Maybe<PVOID> { - static const StaticDynamicallyLinkedFunctionPtr<decltype( - &::MapViewOfFile3)> + static const StaticDynamicallyLinkedFunctionPtr< + decltype(&::MapViewOfFile3)> pMapViewOfFile3(L"kernelbase.dll", "MapViewOfFile3"); if (!pMapViewOfFile3) { return Nothing(); } // NB: MEM_ADDRESS_REQUIREMENTS::HighestEndingAddress is *inclusive* MEM_ADDRESS_REQUIREMENTS memReq = { const_cast<uint8_t*>(aRangeMin),
--- a/mozglue/tests/interceptor/TestDllInterceptorCrossProcess.cpp +++ b/mozglue/tests/interceptor/TestDllInterceptorCrossProcess.cpp @@ -11,18 +11,18 @@ #include "nsWindowsHelpers.h" #include <string> using std::wstring; extern "C" __declspec(dllexport) int ReturnResult() { return 2; } -static mozilla::CrossProcessDllInterceptor::FuncHookType<decltype( - &ReturnResult)> +static mozilla::CrossProcessDllInterceptor::FuncHookType< + decltype(&ReturnResult)> gOrigReturnResult; static int ReturnResultHook() { if (gOrigReturnResult() != 2) { return 3; } return 0;
--- a/mozglue/tests/interceptor/TestIATPatcher.cpp +++ b/mozglue/tests/interceptor/TestIATPatcher.cpp @@ -64,18 +64,18 @@ extern "C" int wmain(int argc, wchar_t* return 1; } if (NormalImport() || !gGetSystemMetricsHookCalled) { PRINT_FAIL("GetSystemMetrics hook was not called"); return 1; } - static const mozilla::StaticDynamicallyLinkedFunctionPtr<decltype( - &::GetSystemMetrics)> + static const mozilla::StaticDynamicallyLinkedFunctionPtr< + decltype(&::GetSystemMetrics)> pRealGetSystemMetrics(L"user32.dll", "GetSystemMetrics"); if (!pRealGetSystemMetrics) { PRINT_FAIL("Failed resolving real GetSystemMetrics pointer"); return 1; } if (gGetSystemMetricsHook.GetStub() != pRealGetSystemMetrics) { PRINT_FAIL(
--- a/netwerk/wifi/win_wifiScanner.cpp +++ b/netwerk/wifi/win_wifiScanner.cpp @@ -95,30 +95,35 @@ nsresult WinWifiScanner::GetAccessPoints if (!interface_list->dwNumberOfItems) { return NS_OK; } InterfaceScanCallbackData cbData(interface_list->dwNumberOfItems); DWORD wlanNotifySource; - if (ERROR_SUCCESS != (*mWlanLibrary->GetWlanRegisterNotificationPtr())( - mWlanLibrary->GetWLANHandle(), - WLAN_NOTIFICATION_SOURCE_ACM, TRUE, - (WLAN_NOTIFICATION_CALLBACK)OnScanComplete, &cbData, - NULL, &wlanNotifySource)) { + if (ERROR_SUCCESS != + (*mWlanLibrary + ->GetWlanRegisterNotificationPtr())(mWlanLibrary->GetWLANHandle(), + WLAN_NOTIFICATION_SOURCE_ACM, + TRUE, + (WLAN_NOTIFICATION_CALLBACK) + OnScanComplete, + &cbData, NULL, + &wlanNotifySource)) { return NS_ERROR_FAILURE; } // Go through the list of interfaces and call `WlanScan` on each for (unsigned int i = 0; i < interface_list->dwNumberOfItems; ++i) { - if (ERROR_SUCCESS != (*mWlanLibrary->GetWlanScanPtr())( - mWlanLibrary->GetWLANHandle(), - &interface_list->InterfaceInfo[i].InterfaceGuid, - NULL, NULL, NULL)) { + if (ERROR_SUCCESS != + (*mWlanLibrary->GetWlanScanPtr())(mWlanLibrary->GetWLANHandle(), + &interface_list->InterfaceInfo[i] + .InterfaceGuid, + NULL, NULL, NULL)) { cbData.OnInterfaceScanComplete(); } } // From the MSDN documentation: // "Wireless network drivers that meet Windows logo requirements are // required to complete a WlanScan function request in 4 seconds" cbData.WaitForAllInterfacesToFinishScanning(5000); @@ -128,24 +133,27 @@ nsresult WinWifiScanner::GetAccessPoints // to complete. (*mWlanLibrary->GetWlanRegisterNotificationPtr())( mWlanLibrary->GetWLANHandle(), WLAN_NOTIFICATION_SOURCE_NONE, TRUE, NULL, NULL, NULL, &wlanNotifySource); // Go through the list of interfaces and get the data for each. for (uint32_t i = 0; i < interface_list->dwNumberOfItems; ++i) { WLAN_BSS_LIST* bss_list; - if (ERROR_SUCCESS != (*mWlanLibrary->GetWlanGetNetworkBssListPtr())( - mWlanLibrary->GetWLANHandle(), - &interface_list->InterfaceInfo[i].InterfaceGuid, - nullptr, // Use all SSIDs. - DOT11_BSS_TYPE_UNUSED, - false, // bSecurityEnabled - unused - nullptr, // reserved - &bss_list)) { + if (ERROR_SUCCESS != + (*mWlanLibrary + ->GetWlanGetNetworkBssListPtr())(mWlanLibrary->GetWLANHandle(), + &interface_list->InterfaceInfo[i] + .InterfaceGuid, + nullptr, // Use all SSIDs. + DOT11_BSS_TYPE_UNUSED, + false, // bSecurityEnabled - + // unused + nullptr, // reserved + &bss_list)) { continue; } // This ensures we call WlanFreeMemory on bss_list ScopedWLANObject scopedBssList(*mWlanLibrary, bss_list); // Store each discovered access point in our outparam for (int j = 0; j < static_cast<int>(bss_list->dwNumberOfItems); ++j) {
--- a/toolkit/components/places/nsNavHistoryQuery.cpp +++ b/toolkit/components/places/nsNavHistoryQuery.cpp @@ -51,18 +51,18 @@ static void SetQueryKeyBool(const nsCStr static void SetQueryKeyUint32(const nsCString& aValue, nsINavHistoryQuery* aQuery, Uint32QuerySetter setter); static void SetQueryKeyInt64(const nsCString& aValue, nsINavHistoryQuery* aQuery, Int64QuerySetter setter); // options setters -typedef decltype( - &nsINavHistoryQueryOptions::SetExpandQueries) BoolOptionsSetter; +typedef decltype(&nsINavHistoryQueryOptions::SetExpandQueries) + BoolOptionsSetter; typedef decltype(&nsINavHistoryQueryOptions::SetMaxResults) Uint32OptionsSetter; typedef decltype(&nsINavHistoryQueryOptions::SetResultType) Uint16OptionsSetter; static void SetOptionsKeyBool(const nsCString& aValue, nsINavHistoryQueryOptions* aOptions, BoolOptionsSetter setter); static void SetOptionsKeyUint16(const nsCString& aValue, nsINavHistoryQueryOptions* aOptions, Uint16OptionsSetter setter);
--- a/toolkit/crashreporter/LoadLibraryRemote.cpp +++ b/toolkit/crashreporter/LoadLibraryRemote.cpp @@ -243,18 +243,19 @@ static int BuildImportTable(PMEMORYMODUL int result = 1; unsigned char* codeBase = module->localCodeBase; PIMAGE_DATA_DIRECTORY directory = GET_HEADER_DICTIONARY(module, IMAGE_DIRECTORY_ENTRY_IMPORT); if (directory->Size > 0) { PIMAGE_IMPORT_DESCRIPTOR importDesc = (PIMAGE_IMPORT_DESCRIPTOR)(codeBase + directory->VirtualAddress); - PIMAGE_IMPORT_DESCRIPTOR importEnd = (PIMAGE_IMPORT_DESCRIPTOR)( - codeBase + directory->VirtualAddress + directory->Size); + PIMAGE_IMPORT_DESCRIPTOR importEnd = + (PIMAGE_IMPORT_DESCRIPTOR)(codeBase + directory->VirtualAddress + + directory->Size); for (; importDesc < importEnd && importDesc->Name; importDesc++) { POINTER_TYPE* thunkRef; FARPROC* funcRef; HMODULE handle = GetModuleHandleA((LPCSTR)(codeBase + importDesc->Name)); if (handle == nullptr) { #if DEBUG_OUTPUT OutputLastError("Can't load library");
--- a/toolkit/crashreporter/client/crashreporter_linux.cpp +++ b/toolkit/crashreporter/client/crashreporter_linux.cpp @@ -308,18 +308,18 @@ void TryInitGnome() { if (!gnomeLib) return; gnomeuiLib = dlopen("libgnomeui-2.so.0", RTLD_LAZY); if (!gnomeuiLib) return; _gnome_program_init_fn gnome_program_init = (_gnome_program_init_fn)(dlsym(gnomeLib, "gnome_program_init")); _libgnomeui_module_info_get_fn libgnomeui_module_info_get = - (_libgnomeui_module_info_get_fn)( - dlsym(gnomeuiLib, "libgnomeui_module_info_get")); + (_libgnomeui_module_info_get_fn)(dlsym(gnomeuiLib, + "libgnomeui_module_info_get")); if (gnome_program_init && libgnomeui_module_info_get) { gnome_program_init("crashreporter", "1.0", libgnomeui_module_info_get(), gArgc, gArgv, nullptr); } } /* === Crashreporter UI Functions === */
--- a/widget/windows/WinHeaderOnlyUtils.h +++ b/widget/windows/WinHeaderOnlyUtils.h @@ -53,18 +53,18 @@ typedef struct _FILE_ID_INFO { // Our data indicates a few users of Win7 x86 hit failure to load urlmon.dll // for unknown reasons. Since we don't always require urlmon.dll on Win7, // we delay-load it, which causes a crash if loading urlmon.dll fails. This // macro is to safely load and call urlmon's API graciously without crash. #if defined(_X86_) # define SAFECALL_URLMON_FUNC(FuncName, ...) \ do { \ - static const mozilla::StaticDynamicallyLinkedFunctionPtr<decltype( \ - &::FuncName)> \ + static const mozilla::StaticDynamicallyLinkedFunctionPtr< \ + decltype(&::FuncName)> \ func(L"urlmon.dll", #FuncName); \ hr = \ func ? func(__VA_ARGS__) : HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND); \ } while (0) #else # define SAFECALL_URLMON_FUNC(FuncName, ...) hr = ::FuncName(__VA_ARGS__) #endif @@ -181,18 +181,18 @@ class WindowsError final { return mHResult == aOther.mHResult; } constexpr bool operator!=(const WindowsError& aOther) const { return mHResult != aOther.mHResult; } static DWORD NtStatusToWin32Error(NTSTATUS aNtStatus) { - static const StaticDynamicallyLinkedFunctionPtr<decltype( - &RtlNtStatusToDosError)> + static const StaticDynamicallyLinkedFunctionPtr< + decltype(&RtlNtStatusToDosError)> pRtlNtStatusToDosError(L"ntdll.dll", "RtlNtStatusToDosError"); MOZ_ASSERT(!!pRtlNtStatusToDosError); if (!pRtlNtStatusToDosError) { return ERROR_UNIDENTIFIED_ERROR; } return pRtlNtStatusToDosError(aNtStatus);
--- a/widget/windows/nsColorPicker.cpp +++ b/widget/windows/nsColorPicker.cpp @@ -102,19 +102,20 @@ AsyncColorChooser::Run() { "Color pickers can only be opened from main thread currently"); // Allow only one color picker to be opened at a time, to workaround bug // 944737 if (!gColorChooser) { mozilla::AutoRestore<AsyncColorChooser*> restoreColorChooser(gColorChooser); gColorChooser = this; - AutoDestroyTmpWindow adtw((HWND)( - mParentWidget.get() ? mParentWidget->GetNativeData(NS_NATIVE_TMP_WINDOW) - : nullptr)); + AutoDestroyTmpWindow adtw( + (HWND)(mParentWidget.get() + ? mParentWidget->GetNativeData(NS_NATIVE_TMP_WINDOW) + : nullptr)); CHOOSECOLOR options; options.lStructSize = sizeof(options); options.hwndOwner = adtw.get(); options.Flags = CC_RGBINIT | CC_FULLOPEN | CC_ENABLEHOOK; options.rgbResult = mInitialColor; options.lpCustColors = sCustomColors; options.lpfnHook = HookProc;
--- a/widget/windows/nsFilePicker.cpp +++ b/widget/windows/nsFilePicker.cpp @@ -153,19 +153,20 @@ bool nsFilePicker::ShowFolderPicker(cons getter_AddRefs(folder)))) { hr = dialog->SetFolder(folder); if (FAILED(hr)) { return false; } } } - AutoDestroyTmpWindow adtw((HWND)( - mParentWidget.get() ? mParentWidget->GetNativeData(NS_NATIVE_TMP_WINDOW) - : nullptr)); + AutoDestroyTmpWindow adtw( + (HWND)(mParentWidget.get() + ? mParentWidget->GetNativeData(NS_NATIVE_TMP_WINDOW) + : nullptr)); // display mozilla::BackgroundHangMonitor().NotifyWait(); RefPtr<IShellItem> item; if (FAILED(dialog->Show(adtw.get())) || FAILED(dialog->GetResult(getter_AddRefs(item))) || !item) { return false; } @@ -315,19 +316,20 @@ bool nsFilePicker::ShowFilePicker(const if (FAILED(hr)) { return false; } } // display { - AutoDestroyTmpWindow adtw((HWND)( - mParentWidget.get() ? mParentWidget->GetNativeData(NS_NATIVE_TMP_WINDOW) - : nullptr)); + AutoDestroyTmpWindow adtw( + (HWND)(mParentWidget.get() + ? mParentWidget->GetNativeData(NS_NATIVE_TMP_WINDOW) + : nullptr)); AutoWidgetPickerState awps(mParentWidget); mozilla::BackgroundHangMonitor().NotifyWait(); if (FAILED(dialog->Show(adtw.get()))) { return false; } }
--- a/xpcom/base/nsSystemInfo.cpp +++ b/xpcom/base/nsSystemInfo.cpp @@ -954,18 +954,18 @@ nsresult nsSystemInfo::Init() { rv = SetPropertyAsAString(u"registeredFirewall"_ns, firewallInfo); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } } } # endif // __MINGW32__ - mozilla::DynamicallyLinkedFunctionPtr<decltype( - &IsUserCetAvailableInEnvironment)> + mozilla::DynamicallyLinkedFunctionPtr< + decltype(&IsUserCetAvailableInEnvironment)> isUserCetAvailable(L"api-ms-win-core-sysinfo-l1-2-6.dll", "IsUserCetAvailableInEnvironment"); bool hasUserCET = isUserCetAvailable && isUserCetAvailable(USER_CET_ENVIRONMENT_WIN32_PROCESS); rv = SetPropertyAsBool(u"hasUserCET"_ns, hasUserCET); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
--- a/xpcom/build/IOInterposer.cpp +++ b/xpcom/build/IOInterposer.cpp @@ -223,61 +223,74 @@ class MasterList { newLists = new ObserverLists(*mObserverLists); } else { newLists = new ObserverLists(); } if (aOp & mozilla::IOInterposeObserver::OpCreateOrOpen) { VectorRemove(newLists->mCreateObservers, aObserver); if (newLists->mCreateObservers.empty()) { - mObservedOperations = (mozilla::IOInterposeObserver::Operation)( - mObservedOperations & - ~mozilla::IOInterposeObserver::OpCreateOrOpen); + mObservedOperations = + (mozilla::IOInterposeObserver:: + Operation)(mObservedOperations & + ~mozilla::IOInterposeObserver::OpCreateOrOpen); } } if (aOp & mozilla::IOInterposeObserver::OpRead) { VectorRemove(newLists->mReadObservers, aObserver); if (newLists->mReadObservers.empty()) { - mObservedOperations = (mozilla::IOInterposeObserver::Operation)( - mObservedOperations & ~mozilla::IOInterposeObserver::OpRead); + mObservedOperations = + (mozilla::IOInterposeObserver:: + Operation)(mObservedOperations & + ~mozilla::IOInterposeObserver::OpRead); } } if (aOp & mozilla::IOInterposeObserver::OpWrite) { VectorRemove(newLists->mWriteObservers, aObserver); if (newLists->mWriteObservers.empty()) { - mObservedOperations = (mozilla::IOInterposeObserver::Operation)( - mObservedOperations & ~mozilla::IOInterposeObserver::OpWrite); + mObservedOperations = + (mozilla::IOInterposeObserver:: + Operation)(mObservedOperations & + ~mozilla::IOInterposeObserver::OpWrite); } } if (aOp & mozilla::IOInterposeObserver::OpFSync) { VectorRemove(newLists->mFSyncObservers, aObserver); if (newLists->mFSyncObservers.empty()) { - mObservedOperations = (mozilla::IOInterposeObserver::Operation)( - mObservedOperations & ~mozilla::IOInterposeObserver::OpFSync); + mObservedOperations = + (mozilla::IOInterposeObserver:: + Operation)(mObservedOperations & + ~mozilla::IOInterposeObserver::OpFSync); } } if (aOp & mozilla::IOInterposeObserver::OpStat) { VectorRemove(newLists->mStatObservers, aObserver); if (newLists->mStatObservers.empty()) { - mObservedOperations = (mozilla::IOInterposeObserver::Operation)( - mObservedOperations & ~mozilla::IOInterposeObserver::OpStat); + mObservedOperations = + (mozilla::IOInterposeObserver:: + Operation)(mObservedOperations & + ~mozilla::IOInterposeObserver::OpStat); } } if (aOp & mozilla::IOInterposeObserver::OpClose) { VectorRemove(newLists->mCloseObservers, aObserver); if (newLists->mCloseObservers.empty()) { - mObservedOperations = (mozilla::IOInterposeObserver::Operation)( - mObservedOperations & ~mozilla::IOInterposeObserver::OpClose); + mObservedOperations = + (mozilla::IOInterposeObserver:: + Operation)(mObservedOperations & + ~mozilla::IOInterposeObserver::OpClose); } } if (aOp & mozilla::IOInterposeObserver::OpNextStage) { VectorRemove(newLists->mStageObservers, aObserver); if (newLists->mStageObservers.empty()) { - mObservedOperations = (mozilla::IOInterposeObserver::Operation)( - mObservedOperations & ~mozilla::IOInterposeObserver::OpNextStage); + mObservedOperations = + (mozilla::IOInterposeObserver:: + Operation)(mObservedOperations & + ~mozilla::IOInterposeObserver::OpNextStage); } } mObserverLists = newLists; mCurrentGeneration++; } void Update(PerThreadData& aPtd) { if (mCurrentGeneration == aPtd.GetCurrentGeneration()) {
--- a/xpcom/tests/gtest/TestTArray.cpp +++ b/xpcom/tests/gtest/TestTArray.cpp @@ -865,21 +865,21 @@ TEST(TArray, RemoveLastElements_All) TEST(TArray, RemoveLastElements_One) { nsTArray<int> array{1, 2, 3, 4}; array.RemoveLastElements(1); ASSERT_EQ((nsTArray<int>{1, 2, 3}), array); } -static_assert(std::is_copy_assignable<decltype( - MakeBackInserter(std::declval<nsTArray<int>&>()))>::value, +static_assert(std::is_copy_assignable<decltype(MakeBackInserter( + std::declval<nsTArray<int>&>()))>::value, "output iteraror must be copy-assignable"); -static_assert(std::is_copy_constructible<decltype( - MakeBackInserter(std::declval<nsTArray<int>&>()))>::value, +static_assert(std::is_copy_constructible<decltype(MakeBackInserter( + std::declval<nsTArray<int>&>()))>::value, "output iterator must be copy-constructible"); TEST(TArray, MakeBackInserter) { const std::vector<int> src{1, 2, 3, 4}; nsTArray<int> dst; std::copy(src.begin(), src.end(), MakeBackInserter(dst));
--- a/xpcom/threads/MozPromise.h +++ b/xpcom/threads/MozPromise.h @@ -999,18 +999,18 @@ class MozPromise : public MozPromiseBase mThenValue->mCompletionPromise = p; // Note ThenInternal() might nullify mCompletionPromise before return. // So we need to return p instead of mCompletionPromise. mReceiver->ThenInternal(mThenValue.forget(), mCallSite); return p; } template <typename... Ts> - auto Then(Ts&&... aArgs) -> decltype( - std::declval<PromiseType>().Then(std::forward<Ts>(aArgs)...)) { + auto Then(Ts&&... aArgs) -> decltype(std::declval<PromiseType>().Then( + std::forward<Ts>(aArgs)...)) { return static_cast<RefPtr<PromiseType>>(*this)->Then( std::forward<Ts>(aArgs)...); } void Track(MozPromiseRequestHolder<MozPromise>& aRequestHolder) { aRequestHolder.Track(do_AddRef(mThenValue)); mReceiver->ThenInternal(mThenValue.forget(), mCallSite); }
--- a/xpcom/threads/nsThreadUtils.h +++ b/xpcom/threads/nsThreadUtils.h @@ -632,18 +632,19 @@ already_AddRefed<mozilla::Runnable> NS_N // Creates a new object implementing nsIRunnable and nsICancelableRunnable, // which runs a given function on Run and clears the stored function object on a // call to `Cancel` (and thus destroys all objects it holds). template <typename Function> already_AddRefed<mozilla::CancelableRunnable> NS_NewCancelableRunnableFunction( const char* aName, Function&& aFunc) { class FuncCancelableRunnable final : public mozilla::CancelableRunnable { public: - static_assert(std::is_void_v<decltype( - std::declval<std::remove_reference_t<Function>>()())>); + static_assert( + std::is_void_v< + decltype(std::declval<std::remove_reference_t<Function>>()())>); NS_INLINE_DECL_REFCOUNTING_INHERITED(FuncCancelableRunnable, CancelableRunnable) explicit FuncCancelableRunnable(const char* aName, Function&& aFunc) : CancelableRunnable{aName}, mFunc{mozilla::Some(std::forward<Function>(aFunc))} {} @@ -1106,18 +1107,19 @@ struct NonParameterStorageClass template <typename T> struct ParameterStorage : std::conditional<IsParameterStorageClass<T>::value, T, typename NonParameterStorageClass<T>::Type> { using Type = typename ParameterStorage::conditional::type; }; template <class T> -static auto HasSetDeadlineTest(int) -> SFINAE1True<decltype( - std::declval<T>().SetDeadline(std::declval<mozilla::TimeStamp>()))>; +static auto HasSetDeadlineTest(int) + -> SFINAE1True<decltype(std::declval<T>().SetDeadline( + std::declval<mozilla::TimeStamp>()))>; template <class T> static auto HasSetDeadlineTest(long) -> std::false_type; template <class T> struct HasSetDeadline : decltype(HasSetDeadlineTest<T>(0)) {}; template <class T>