Backed out 6 changesets (bug 1674902) for build bustage on a CLOSED TREE

Backed out changeset e4f63ba14348 (bug 1674902)
Backed out changeset 9f6e1866a7c3 (bug 1674902)
Backed out changeset a71e810d79d0 (bug 1674902)
Backed out changeset 071d1d593deb (bug 1674902)
Backed out changeset e88b258d7013 (bug 1674902)
Backed out changeset d1f72c3f70a0 (bug 1674902)
This commit is contained in:
Cristina Coroiu 2020-11-03 17:47:35 +02:00
parent 58f2daf6b8
commit ae74e57f04
6 changed files with 29 additions and 42 deletions

View File

@ -23,15 +23,10 @@ namespace mscom {
class ActivationContext final {
public:
// This is the default resource ID that the Windows dynamic linker searches
// for when seeking a manifest while loading a DLL.
static constexpr WORD kDllManifestDefaultResourceId = 2;
ActivationContext() : mActCtx(INVALID_HANDLE_VALUE) {}
explicit ActivationContext(WORD aResourceId);
explicit ActivationContext(HMODULE aLoadFromModule,
WORD aResourceId = kDllManifestDefaultResourceId);
explicit ActivationContext(HMODULE aLoadFromModule, WORD aResourceId = 2);
ActivationContext(ActivationContext&& aOther);
ActivationContext& operator=(ActivationContext&& aOther);

View File

@ -15,14 +15,14 @@
namespace mozilla {
namespace mscom {
class MOZ_NON_TEMPORARY_CLASS ApartmentRegion final {
class MOZ_NON_TEMPORARY_CLASS ApartmentRegion {
public:
/**
* This constructor is to be used when we want to instantiate the object but
* we do not yet know which type of apartment we want. Call Init() to
* complete initialization.
*/
constexpr ApartmentRegion() : mInitResult(CO_E_NOTINITIALIZED) {}
ApartmentRegion() : mInitResult(CO_E_NOTINITIALIZED) {}
explicit ApartmentRegion(COINIT aAptType)
: mInitResult(::CoInitializeEx(nullptr, aAptType)) {
@ -62,7 +62,7 @@ class MOZ_NON_TEMPORARY_CLASS ApartmentRegion final {
};
template <COINIT T>
class MOZ_NON_TEMPORARY_CLASS ApartmentRegionT final {
class MOZ_NON_TEMPORARY_CLASS ApartmentRegionT {
public:
ApartmentRegionT() : mAptRgn(T) {}

View File

@ -262,7 +262,8 @@ bool StripHandlerFromOBJREF(NotNull<IStream*> aStream, const uint64_t aStartPos,
// The difference between a OBJREF_STANDARD and an OBJREF_HANDLER is
// sizeof(CLSID), so we'll zero out the remaining bytes.
hr = aStream->Write(&CLSID_NULL, sizeof(CLSID), &bytesWritten);
CLSID zeroClsid = {0};
hr = aStream->Write(&zeroClsid, sizeof(CLSID), &bytesWritten);
if (FAILED(hr) || bytesWritten != sizeof(CLSID)) {
return false;
}

View File

@ -37,7 +37,6 @@ struct MainThreadRelease {
if (!aPtr) {
return;
}
if (NS_IsMainThread()) {
aPtr->Release();
return;
@ -57,8 +56,7 @@ struct MTADelete {
return;
}
EnsureMTA::AsyncOperation(
[ptr = std::move(aPtr)]() -> void { delete ptr; });
EnsureMTA::AsyncOperation([aPtr]() -> void { delete aPtr; });
}
};
@ -69,8 +67,11 @@ struct MTARelease {
return;
}
// Static analysis doesn't recognize that, even though aPtr escapes the
// current scope, we are in effect moving our strong ref into the lambda.
void* ptr = aPtr;
EnsureMTA::AsyncOperation(
[ptr = std::move(aPtr)]() -> void { ptr->Release(); });
[ptr]() -> void { reinterpret_cast<T*>(ptr)->Release(); });
}
};
@ -87,8 +88,11 @@ struct MTAReleaseInChildProcess {
return;
}
// Static analysis doesn't recognize that, even though aPtr escapes the
// current scope, we are in effect moving our strong ref into the lambda.
void* ptr = aPtr;
EnsureMTA::AsyncOperation(
[ptr = std::move(aPtr)]() -> void { ptr->Release(); });
[ptr]() -> void { reinterpret_cast<T*>(ptr)->Release(); });
}
};
@ -104,10 +108,14 @@ struct PreservedStreamDeleter {
return;
}
auto cleanup = [ptr = std::move(aPtr)]() -> void {
DebugOnly<HRESULT> hr = ::CoReleaseMarshalData(ptr);
// Static analysis doesn't recognize that, even though aPtr escapes the
// current scope, we are in effect moving our strong ref into the lambda.
void* ptr = aPtr;
auto cleanup = [ptr]() -> void {
DebugOnly<HRESULT> hr =
::CoReleaseMarshalData(reinterpret_cast<LPSTREAM>(ptr));
MOZ_ASSERT(SUCCEEDED(hr));
ptr->Release();
reinterpret_cast<LPSTREAM>(ptr)->Release();
};
if (XRE_IsParentProcess()) {
@ -116,7 +124,7 @@ struct PreservedStreamDeleter {
return;
}
EnsureMTA::AsyncOperation(std::move(cleanup));
EnsureMTA::AsyncOperation(cleanup);
}
};
@ -184,7 +192,6 @@ inline STAUniquePtr<T> ToSTAUniquePtr(T* aRawPtr) {
if (aRawPtr) {
aRawPtr->AddRef();
}
return STAUniquePtr<T>(aRawPtr);
}
@ -212,7 +219,6 @@ inline MTAUniquePtr<T> ToMTAUniquePtr(T* aRawPtr) {
if (aRawPtr) {
aRawPtr->AddRef();
}
return MTAUniquePtr<T>(aRawPtr);
}
@ -239,7 +245,6 @@ inline ProxyUniquePtr<T> ToProxyUniquePtr(T* aRawPtr) {
if (aRawPtr) {
aRawPtr->AddRef();
}
return ProxyUniquePtr<T>(aRawPtr);
}

View File

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#if defined(MOZILLA_INTERNAL_API)
# include "MainThreadUtils.h"
# include "mozilla/dom/ContentChild.h"
#endif
@ -75,16 +74,6 @@ bool IsCurrentThreadImplicitMTA() {
aptTypeQualifier == APTTYPEQUALIFIER_IMPLICIT_MTA;
}
#if defined(MOZILLA_INTERNAL_API)
bool IsCurrentThreadNonMainMTA() {
if (NS_IsMainThread()) {
return false;
}
return IsCurrentThreadMTA();
}
#endif // defined(MOZILLA_INTERNAL_API)
bool IsProxy(IUnknown* aUnknown) {
if (!aUnknown) {
return false;
@ -139,8 +128,8 @@ uintptr_t GetContainingModuleHandle() {
return reinterpret_cast<uintptr_t>(thisModule);
}
long CreateStream(const uint8_t* aInitBuf, const uint32_t aInitBufSize,
IStream** aOutStream) {
uint32_t CreateStream(const uint8_t* aInitBuf, const uint32_t aInitBufSize,
IStream** aOutStream) {
if (!aInitBufSize || !aOutStream) {
return E_INVALIDARG;
}
@ -219,7 +208,7 @@ long CreateStream(const uint8_t* aInitBuf, const uint32_t aInitBufSize,
return S_OK;
}
long CopySerializedProxy(IStream* aInStream, IStream** aOutStream) {
uint32_t CopySerializedProxy(IStream* aInStream, IStream** aOutStream) {
if (!aInStream || !aOutStream) {
return E_INVALIDARG;
}

View File

@ -24,9 +24,6 @@ bool IsCOMInitializedOnCurrentThread();
bool IsCurrentThreadMTA();
bool IsCurrentThreadExplicitMTA();
bool IsCurrentThreadImplicitMTA();
#if defined(MOZILLA_INTERNAL_API)
bool IsCurrentThreadNonMainMTA();
#endif // defined(MOZILLA_INTERNAL_API)
bool IsProxy(IUnknown* aUnknown);
bool IsValidGUID(REFGUID aCheckGuid);
uintptr_t GetContainingModuleHandle();
@ -41,8 +38,8 @@ uintptr_t GetContainingModuleHandle();
* @param aOutStream Outparam to receive the newly created stream.
* @return HRESULT error code.
*/
long CreateStream(const uint8_t* aBuf, const uint32_t aBufLen,
IStream** aOutStream);
uint32_t CreateStream(const uint8_t* aBuf, const uint32_t aBufLen,
IStream** aOutStream);
/**
* Creates a deep copy of a proxy contained in a stream.
@ -51,7 +48,7 @@ long CreateStream(const uint8_t* aBuf, const uint32_t aBufLen,
* @param aOutStream Outparam to receive the newly created stream.
* @return HRESULT error code.
*/
long CopySerializedProxy(IStream* aInStream, IStream** aOutStream);
uint32_t CopySerializedProxy(IStream* aInStream, IStream** aOutStream);
#if defined(MOZILLA_INTERNAL_API)
/**