Bug 1073597, part 1 - Don't get a CPOW manager to wrap unless there are CPOWs. r=smaug

This commit is contained in:
Andrew McCreight 2014-10-06 15:45:42 -07:00
parent d1f5d678d4
commit 4397abb1f4
2 changed files with 4 additions and 4 deletions

View File

@ -1728,7 +1728,7 @@ public:
return false; return false;
} }
InfallibleTArray<mozilla::jsipc::CpowEntry> cpows; InfallibleTArray<mozilla::jsipc::CpowEntry> cpows;
if (!cc->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) { if (aCpows && !cc->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) {
return false; return false;
} }
if (aIsSync) { if (aIsSync) {
@ -1755,7 +1755,7 @@ public:
return false; return false;
} }
InfallibleTArray<mozilla::jsipc::CpowEntry> cpows; InfallibleTArray<mozilla::jsipc::CpowEntry> cpows;
if (!cc->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) { if (aCpows && !cc->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) {
return false; return false;
} }
return cc->SendAsyncMessage(PromiseFlatString(aMessage), data, cpows, return cc->SendAsyncMessage(PromiseFlatString(aMessage), data, cpows,

View File

@ -2910,7 +2910,7 @@ TabChild::DoSendBlockingMessage(JSContext* aCx,
return false; return false;
} }
InfallibleTArray<CpowEntry> cpows; InfallibleTArray<CpowEntry> cpows;
if (!Manager()->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) { if (aCpows && !Manager()->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) {
return false; return false;
} }
if (aIsSync) { if (aIsSync) {
@ -2934,7 +2934,7 @@ TabChild::DoSendAsyncMessage(JSContext* aCx,
return false; return false;
} }
InfallibleTArray<CpowEntry> cpows; InfallibleTArray<CpowEntry> cpows;
if (!Manager()->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) { if (aCpows && !Manager()->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) {
return false; return false;
} }
return SendAsyncMessage(PromiseFlatString(aMessage), data, cpows, return SendAsyncMessage(PromiseFlatString(aMessage), data, cpows,