mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 22:32:51 +00:00
Bug 1626570 - Use CopyableTArray in ipdlc as member type for now. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D73685
This commit is contained in:
parent
c4fb12bd56
commit
61ad805d68
@ -180,7 +180,7 @@ void InternalRequest::ToIPC(
|
||||
MOZ_ASSERT(!mURLList.IsEmpty());
|
||||
|
||||
aIPCRequest->method() = mMethod;
|
||||
aIPCRequest->urlList() = mURLList;
|
||||
aIPCRequest->urlList() = mURLList.Clone();
|
||||
mHeaders->ToIPC(aIPCRequest->headers(), aIPCRequest->headersGuard());
|
||||
|
||||
if (mBodyStream) {
|
||||
|
@ -38,9 +38,9 @@ JSProcessActorInfo JSProcessActorProtocol::ToIPC() {
|
||||
|
||||
JSProcessActorInfo info;
|
||||
info.name() = mName;
|
||||
info.remoteTypes() = mRemoteTypes;
|
||||
info.remoteTypes() = mRemoteTypes.Clone();
|
||||
info.url() = mChild.mModuleURI;
|
||||
info.observers() = mChild.mObservers;
|
||||
info.observers() = mChild.mObservers.Clone();
|
||||
return info;
|
||||
}
|
||||
|
||||
|
@ -56,9 +56,9 @@ JSWindowActorInfo JSWindowActorProtocol::ToIPC() {
|
||||
JSWindowActorInfo info;
|
||||
info.name() = mName;
|
||||
info.allFrames() = mAllFrames;
|
||||
info.matches() = mMatches;
|
||||
info.remoteTypes() = mRemoteTypes;
|
||||
info.messageManagerGroups() = mMessageManagerGroups;
|
||||
info.matches() = mMatches.Clone();
|
||||
info.remoteTypes() = mRemoteTypes.Clone();
|
||||
info.messageManagerGroups() = mMessageManagerGroups.Clone();
|
||||
info.url() = mChild.mModuleURI;
|
||||
|
||||
info.events().SetCapacity(mChild.mEvents.Length());
|
||||
@ -73,7 +73,7 @@ JSWindowActorInfo JSWindowActorProtocol::ToIPC() {
|
||||
}
|
||||
}
|
||||
|
||||
info.observers() = mChild.mObservers;
|
||||
info.observers() = mChild.mObservers.Clone();
|
||||
return info;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ RefPtr<MediaDataDecoder::InitPromise> ChromiumCDMVideoDecoder::Init() {
|
||||
config.mCodec() = cdm::VideoCodec::kCodecH264;
|
||||
config.mProfile() =
|
||||
ToCDMH264Profile(mConfig.mExtraData->SafeElementAt(1, 0));
|
||||
config.mExtraData() = *mConfig.mExtraData;
|
||||
config.mExtraData() = mConfig.mExtraData->Clone();
|
||||
mConvertToAnnexB = true;
|
||||
} else if (VPXDecoder::IsVP8(mConfig.mMimeType)) {
|
||||
config.mCodec() = cdm::VideoCodec::kCodecVp8;
|
||||
|
@ -630,9 +630,10 @@ bool ShadowLayerForwarder::EndTransaction(
|
||||
common.maskLayer() = LayerHandle();
|
||||
}
|
||||
common.compositorAnimations().id() = mutant->GetCompositorAnimationsId();
|
||||
common.compositorAnimations().animations() = mutant->GetAnimations();
|
||||
common.compositorAnimations().animations() =
|
||||
mutant->GetAnimations().Clone();
|
||||
common.invalidRegion() = mutant->GetInvalidRegion().GetRegion();
|
||||
common.scrollMetadata() = mutant->GetAllScrollMetadata();
|
||||
common.scrollMetadata() = mutant->GetAllScrollMetadata().Clone();
|
||||
for (size_t i = 0; i < mutant->GetAncestorMaskLayerCount(); i++) {
|
||||
auto layer =
|
||||
Shadow(mutant->GetAncestorMaskLayerAt(i)->AsShadowableLayer());
|
||||
@ -659,10 +660,10 @@ bool ShadowLayerForwarder::EndTransaction(
|
||||
info.setSimpleAttrs() = std::move(setSimpleAttrs);
|
||||
info.setAttrs() = std::move(setAttrs);
|
||||
info.paints() = std::move(mTxn->mPaints);
|
||||
info.toDestroy() = mTxn->mDestroyedActors;
|
||||
info.toDestroy() = mTxn->mDestroyedActors.Clone();
|
||||
info.fwdTransactionId() = GetFwdTransactionId();
|
||||
info.id() = aId;
|
||||
info.plugins() = mPluginWindowData;
|
||||
info.plugins() = mPluginWindowData.Clone();
|
||||
info.isFirstPaint() = mIsFirstPaint;
|
||||
info.focusTarget() = mFocusTarget;
|
||||
info.scheduleComposite() = aScheduleComposite;
|
||||
@ -677,7 +678,7 @@ bool ShadowLayerForwarder::EndTransaction(
|
||||
#if defined(ENABLE_FRAME_LATENCY_LOG)
|
||||
info.fwdTime() = TimeStamp::Now();
|
||||
#endif
|
||||
info.payload() = aPayload;
|
||||
info.payload() = aPayload.Clone();
|
||||
|
||||
TargetConfig targetConfig(mTxn->mTargetBounds, mTxn->mTargetRotation,
|
||||
mTxn->mTargetOrientation, aRegionToClear);
|
||||
|
@ -942,6 +942,8 @@ IPDL union type."""
|
||||
def callOperatorEq(self, rhs):
|
||||
if self.ipdltype.isIPDL() and self.ipdltype.isActor():
|
||||
rhs = ExprCast(rhs, self.bareType(), const=True)
|
||||
elif self.ipdltype.isIPDL() and self.ipdltype.isArray() and not isinstance(rhs, ExprMove):
|
||||
rhs = ExprCall(ExprSelect(rhs, '.', 'Clone'), args=[])
|
||||
return ExprAssn(ExprDeref(self.callGetPtr()), rhs)
|
||||
|
||||
def callCtor(self, expr=None):
|
||||
@ -951,6 +953,8 @@ IPDL union type."""
|
||||
args = None
|
||||
elif self.ipdltype.isIPDL() and self.ipdltype.isActor():
|
||||
args = [ExprCast(expr, self.bareType(), const=True)]
|
||||
elif self.ipdltype.isIPDL() and self.ipdltype.isArray() and not isinstance(expr, ExprMove):
|
||||
args = [ExprCall(ExprSelect(expr, '.', 'Clone'), args=[])]
|
||||
else:
|
||||
args = [expr]
|
||||
|
||||
@ -2519,11 +2523,22 @@ def _generateCxxStruct(sd):
|
||||
struct.addstmts([method])
|
||||
|
||||
# members
|
||||
struct.addstmts([StmtDecl(Decl(f.bareType(), f.memberVar().name))
|
||||
struct.addstmts([StmtDecl(Decl(_effectiveMemberType(f), f.memberVar().name))
|
||||
for f in sd.fields_member_order()])
|
||||
|
||||
return forwarddeclstmts, fulldecltypes, struct
|
||||
|
||||
|
||||
def _effectiveMemberType(f):
|
||||
effective_type = f.bareType()
|
||||
# Structs must be copyable for backwards compatibility reasons, so we use
|
||||
# CopyableTArray<T> as their member type for arrays. This is not exposed
|
||||
# in the method signatures, these keep using nsTArray<T>, which is a base
|
||||
# class of CopyableTArray<T>.
|
||||
if effective_type.name == "nsTArray":
|
||||
effective_type.name = "CopyableTArray"
|
||||
return effective_type
|
||||
|
||||
# --------------------------------------------------
|
||||
|
||||
|
||||
@ -3004,9 +3019,12 @@ def _generateCxxUnion(ud):
|
||||
readvalue = MethodDefn(MethodDecl(
|
||||
'get', ret=Type.VOID, const=True,
|
||||
params=[Decl(c.ptrToType(), 'aOutValue')]))
|
||||
rhs = ExprCall(getConstValueVar)
|
||||
if c.ipdltype.isIPDL() and c.ipdltype.isArray():
|
||||
rhs = ExprCall(ExprSelect(rhs, '.', 'Clone'), args=[])
|
||||
readvalue.addstmts([
|
||||
StmtExpr(ExprAssn(ExprDeref(ExprVar('aOutValue')),
|
||||
ExprCall(getConstValueVar)))
|
||||
rhs))
|
||||
])
|
||||
cls.addstmt(readvalue)
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace net {
|
||||
|
||||
class WebrtcTCPData {
|
||||
public:
|
||||
explicit WebrtcTCPData(nsTArray<uint8_t>&& aData) : mData(aData) {
|
||||
explicit WebrtcTCPData(nsTArray<uint8_t>&& aData) : mData(std::move(aData)) {
|
||||
MOZ_COUNT_CTOR(WebrtcTCPData);
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,8 @@ using std::shared_ptr;
|
||||
|
||||
class NrTcpSocketData {
|
||||
public:
|
||||
explicit NrTcpSocketData(nsTArray<uint8_t>&& aData) : mData(aData) {
|
||||
explicit NrTcpSocketData(nsTArray<uint8_t>&& aData)
|
||||
: mData(std::move(aData)) {
|
||||
MOZ_COUNT_CTOR(NrTcpSocketData);
|
||||
}
|
||||
|
||||
|
@ -375,7 +375,7 @@ void nsMIMEInputStream::SerializeInternal(InputStreamParams& aParams,
|
||||
params.optionalStream().emplace(wrappedParams);
|
||||
}
|
||||
|
||||
params.headers() = mHeaders;
|
||||
params.headers() = mHeaders.Clone();
|
||||
params.startedReading() = mStartedReading;
|
||||
|
||||
aParams = params;
|
||||
|
@ -1137,7 +1137,7 @@ void DocumentLoadListener::SerializeRedirectData(
|
||||
|
||||
aArgs.newLoadFlags() = aLoadFlags;
|
||||
aArgs.redirectFlags() = aRedirectFlags;
|
||||
aArgs.redirects() = mRedirects;
|
||||
aArgs.redirects() = mRedirects.Clone();
|
||||
aArgs.redirectIdentifier() = mCrossProcessRedirectIdentifier;
|
||||
aArgs.properties() = do_QueryObject(mChannel.get());
|
||||
aArgs.lastVisitInfo() = LastVisitInfo();
|
||||
|
@ -2692,7 +2692,7 @@ nsresult HttpChannelChild::ContinueAsyncOpen() {
|
||||
openArgs.loadFlags() = mLoadFlags;
|
||||
openArgs.requestHeaders() = mClientSetRequestHeaders;
|
||||
mRequestHead.Method(openArgs.requestMethod());
|
||||
openArgs.preferredAlternativeTypes() = mPreferredCachedAltDataTypes;
|
||||
openArgs.preferredAlternativeTypes() = mPreferredCachedAltDataTypes.Clone();
|
||||
openArgs.referrerInfo() = mReferrerInfo;
|
||||
|
||||
AutoIPCStream autoStream(openArgs.uploadStream());
|
||||
@ -3398,7 +3398,7 @@ void HttpChannelChild::GetClientSetCorsPreflightParameters(
|
||||
Maybe<CorsPreflightArgs>& aArgs) {
|
||||
if (mRequireCORSPreflight) {
|
||||
CorsPreflightArgs args;
|
||||
args.unsafeHeaders() = mUnsafeHeaders;
|
||||
args.unsafeHeaders() = mUnsafeHeaders.Clone();
|
||||
aArgs.emplace(args);
|
||||
} else {
|
||||
aArgs = Nothing();
|
||||
|
@ -371,7 +371,7 @@ void nsHttpConnectionInfo::SerializeHttpConnectionInfo(
|
||||
|
||||
nsTArray<ProxyInfoCloneArgs> proxyInfoArray;
|
||||
nsProxyInfo::SerializeProxyInfo(aInfo->ProxyInfo(), proxyInfoArray);
|
||||
aArgs.proxyInfo() = proxyInfoArray;
|
||||
aArgs.proxyInfo() = std::move(proxyInfoArray);
|
||||
}
|
||||
|
||||
// This function needs to be synced with nsHttpConnectionInfo::Clone.
|
||||
|
@ -279,7 +279,7 @@ void DataStorage::SetCachedStorageEntries(
|
||||
entry.filename() = NS_LITERAL_STRING(#_ ".txt"); \
|
||||
for (auto& e : aEntries) { \
|
||||
if (entry.filename().Equals(e.filename())) { \
|
||||
entry.items() = std::move(e.items()); \
|
||||
entry.items() = e.items().Clone(); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
|
@ -190,7 +190,7 @@ void ProfilerParent::ProfilerStarted(nsIProfilerStartParams* aParams) {
|
||||
}
|
||||
aParams->GetInterval(&ipcParams.interval());
|
||||
aParams->GetFeatures(&ipcParams.features());
|
||||
ipcParams.filters() = aParams->GetFilters();
|
||||
ipcParams.filters() = aParams->GetFilters().Clone();
|
||||
aParams->GetActiveBrowsingContextID(&ipcParams.activeBrowsingContextID());
|
||||
|
||||
ProfilerParentTracker::Enumerate([&](ProfilerParent* profilerParent) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user