Skip to content

Commit ae74e57

Browse files
committed
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)
1 parent 58f2daf commit ae74e57

File tree

6 files changed

+29
-42
lines changed

6 files changed

+29
-42
lines changed

ipc/mscom/ActivationContext.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,10 @@ namespace mscom {
2323

2424
class ActivationContext final {
2525
public:
26-
// This is the default resource ID that the Windows dynamic linker searches
27-
// for when seeking a manifest while loading a DLL.
28-
static constexpr WORD kDllManifestDefaultResourceId = 2;
29-
3026
ActivationContext() : mActCtx(INVALID_HANDLE_VALUE) {}
3127

3228
explicit ActivationContext(WORD aResourceId);
33-
explicit ActivationContext(HMODULE aLoadFromModule,
34-
WORD aResourceId = kDllManifestDefaultResourceId);
29+
explicit ActivationContext(HMODULE aLoadFromModule, WORD aResourceId = 2);
3530

3631
ActivationContext(ActivationContext&& aOther);
3732
ActivationContext& operator=(ActivationContext&& aOther);

ipc/mscom/ApartmentRegion.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
namespace mozilla {
1616
namespace mscom {
1717

18-
class MOZ_NON_TEMPORARY_CLASS ApartmentRegion final {
18+
class MOZ_NON_TEMPORARY_CLASS ApartmentRegion {
1919
public:
2020
/**
2121
* This constructor is to be used when we want to instantiate the object but
2222
* we do not yet know which type of apartment we want. Call Init() to
2323
* complete initialization.
2424
*/
25-
constexpr ApartmentRegion() : mInitResult(CO_E_NOTINITIALIZED) {}
25+
ApartmentRegion() : mInitResult(CO_E_NOTINITIALIZED) {}
2626

2727
explicit ApartmentRegion(COINIT aAptType)
2828
: mInitResult(::CoInitializeEx(nullptr, aAptType)) {
@@ -62,7 +62,7 @@ class MOZ_NON_TEMPORARY_CLASS ApartmentRegion final {
6262
};
6363

6464
template <COINIT T>
65-
class MOZ_NON_TEMPORARY_CLASS ApartmentRegionT final {
65+
class MOZ_NON_TEMPORARY_CLASS ApartmentRegionT {
6666
public:
6767
ApartmentRegionT() : mAptRgn(T) {}
6868

ipc/mscom/Objref.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ bool StripHandlerFromOBJREF(NotNull<IStream*> aStream, const uint64_t aStartPos,
262262

263263
// The difference between a OBJREF_STANDARD and an OBJREF_HANDLER is
264264
// sizeof(CLSID), so we'll zero out the remaining bytes.
265-
hr = aStream->Write(&CLSID_NULL, sizeof(CLSID), &bytesWritten);
265+
CLSID zeroClsid = {0};
266+
hr = aStream->Write(&zeroClsid, sizeof(CLSID), &bytesWritten);
266267
if (FAILED(hr) || bytesWritten != sizeof(CLSID)) {
267268
return false;
268269
}

ipc/mscom/Ptr.h

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ struct MainThreadRelease {
3737
if (!aPtr) {
3838
return;
3939
}
40-
4140
if (NS_IsMainThread()) {
4241
aPtr->Release();
4342
return;
@@ -57,8 +56,7 @@ struct MTADelete {
5756
return;
5857
}
5958

60-
EnsureMTA::AsyncOperation(
61-
[ptr = std::move(aPtr)]() -> void { delete ptr; });
59+
EnsureMTA::AsyncOperation([aPtr]() -> void { delete aPtr; });
6260
}
6361
};
6462

@@ -69,8 +67,11 @@ struct MTARelease {
6967
return;
7068
}
7169

70+
// Static analysis doesn't recognize that, even though aPtr escapes the
71+
// current scope, we are in effect moving our strong ref into the lambda.
72+
void* ptr = aPtr;
7273
EnsureMTA::AsyncOperation(
73-
[ptr = std::move(aPtr)]() -> void { ptr->Release(); });
74+
[ptr]() -> void { reinterpret_cast<T*>(ptr)->Release(); });
7475
}
7576
};
7677

@@ -87,8 +88,11 @@ struct MTAReleaseInChildProcess {
8788
return;
8889
}
8990

91+
// Static analysis doesn't recognize that, even though aPtr escapes the
92+
// current scope, we are in effect moving our strong ref into the lambda.
93+
void* ptr = aPtr;
9094
EnsureMTA::AsyncOperation(
91-
[ptr = std::move(aPtr)]() -> void { ptr->Release(); });
95+
[ptr]() -> void { reinterpret_cast<T*>(ptr)->Release(); });
9296
}
9397
};
9498

@@ -104,10 +108,14 @@ struct PreservedStreamDeleter {
104108
return;
105109
}
106110

107-
auto cleanup = [ptr = std::move(aPtr)]() -> void {
108-
DebugOnly<HRESULT> hr = ::CoReleaseMarshalData(ptr);
111+
// Static analysis doesn't recognize that, even though aPtr escapes the
112+
// current scope, we are in effect moving our strong ref into the lambda.
113+
void* ptr = aPtr;
114+
auto cleanup = [ptr]() -> void {
115+
DebugOnly<HRESULT> hr =
116+
::CoReleaseMarshalData(reinterpret_cast<LPSTREAM>(ptr));
109117
MOZ_ASSERT(SUCCEEDED(hr));
110-
ptr->Release();
118+
reinterpret_cast<LPSTREAM>(ptr)->Release();
111119
};
112120

113121
if (XRE_IsParentProcess()) {
@@ -116,7 +124,7 @@ struct PreservedStreamDeleter {
116124
return;
117125
}
118126

119-
EnsureMTA::AsyncOperation(std::move(cleanup));
127+
EnsureMTA::AsyncOperation(cleanup);
120128
}
121129
};
122130

@@ -184,7 +192,6 @@ inline STAUniquePtr<T> ToSTAUniquePtr(T* aRawPtr) {
184192
if (aRawPtr) {
185193
aRawPtr->AddRef();
186194
}
187-
188195
return STAUniquePtr<T>(aRawPtr);
189196
}
190197

@@ -212,7 +219,6 @@ inline MTAUniquePtr<T> ToMTAUniquePtr(T* aRawPtr) {
212219
if (aRawPtr) {
213220
aRawPtr->AddRef();
214221
}
215-
216222
return MTAUniquePtr<T>(aRawPtr);
217223
}
218224

@@ -239,7 +245,6 @@ inline ProxyUniquePtr<T> ToProxyUniquePtr(T* aRawPtr) {
239245
if (aRawPtr) {
240246
aRawPtr->AddRef();
241247
}
242-
243248
return ProxyUniquePtr<T>(aRawPtr);
244249
}
245250

ipc/mscom/Utils.cpp

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
66

77
#if defined(MOZILLA_INTERNAL_API)
8-
# include "MainThreadUtils.h"
98
# include "mozilla/dom/ContentChild.h"
109
#endif
1110

@@ -75,16 +74,6 @@ bool IsCurrentThreadImplicitMTA() {
7574
aptTypeQualifier == APTTYPEQUALIFIER_IMPLICIT_MTA;
7675
}
7776

78-
#if defined(MOZILLA_INTERNAL_API)
79-
bool IsCurrentThreadNonMainMTA() {
80-
if (NS_IsMainThread()) {
81-
return false;
82-
}
83-
84-
return IsCurrentThreadMTA();
85-
}
86-
#endif // defined(MOZILLA_INTERNAL_API)
87-
8877
bool IsProxy(IUnknown* aUnknown) {
8978
if (!aUnknown) {
9079
return false;
@@ -139,8 +128,8 @@ uintptr_t GetContainingModuleHandle() {
139128
return reinterpret_cast<uintptr_t>(thisModule);
140129
}
141130

142-
long CreateStream(const uint8_t* aInitBuf, const uint32_t aInitBufSize,
143-
IStream** aOutStream) {
131+
uint32_t CreateStream(const uint8_t* aInitBuf, const uint32_t aInitBufSize,
132+
IStream** aOutStream) {
144133
if (!aInitBufSize || !aOutStream) {
145134
return E_INVALIDARG;
146135
}
@@ -219,7 +208,7 @@ long CreateStream(const uint8_t* aInitBuf, const uint32_t aInitBufSize,
219208
return S_OK;
220209
}
221210

222-
long CopySerializedProxy(IStream* aInStream, IStream** aOutStream) {
211+
uint32_t CopySerializedProxy(IStream* aInStream, IStream** aOutStream) {
223212
if (!aInStream || !aOutStream) {
224213
return E_INVALIDARG;
225214
}

ipc/mscom/Utils.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ bool IsCOMInitializedOnCurrentThread();
2424
bool IsCurrentThreadMTA();
2525
bool IsCurrentThreadExplicitMTA();
2626
bool IsCurrentThreadImplicitMTA();
27-
#if defined(MOZILLA_INTERNAL_API)
28-
bool IsCurrentThreadNonMainMTA();
29-
#endif // defined(MOZILLA_INTERNAL_API)
3027
bool IsProxy(IUnknown* aUnknown);
3128
bool IsValidGUID(REFGUID aCheckGuid);
3229
uintptr_t GetContainingModuleHandle();
@@ -41,8 +38,8 @@ uintptr_t GetContainingModuleHandle();
4138
* @param aOutStream Outparam to receive the newly created stream.
4239
* @return HRESULT error code.
4340
*/
44-
long CreateStream(const uint8_t* aBuf, const uint32_t aBufLen,
45-
IStream** aOutStream);
41+
uint32_t CreateStream(const uint8_t* aBuf, const uint32_t aBufLen,
42+
IStream** aOutStream);
4643

4744
/**
4845
* 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,
5148
* @param aOutStream Outparam to receive the newly created stream.
5249
* @return HRESULT error code.
5350
*/
54-
long CopySerializedProxy(IStream* aInStream, IStream** aOutStream);
51+
uint32_t CopySerializedProxy(IStream* aInStream, IStream** aOutStream);
5552

5653
#if defined(MOZILLA_INTERNAL_API)
5754
/**

0 commit comments

Comments
 (0)