Bug 1012639 - Fix OtherProcess sometimes being the current process handle. r=bent

This commit is contained in:
Chris Lord 2014-06-11 14:51:12 +01:00
parent baf27cdb55
commit 5c57498fbc
2 changed files with 6 additions and 1 deletions

View File

@ -623,6 +623,11 @@ Shmem::ShareTo(IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead,
{
AssertInvariants();
// kInvalidProcessHandle is used to indicate that it's the same process.
if (aProcess == kInvalidProcessHandle) {
aProcess = base::GetCurrentProcessHandle();
}
if (SharedMemory::TYPE_BASIC == mSegment->Type()) {
SharedMemoryBasic* seg = static_cast<SharedMemoryBasic*>(mSegment);
SharedMemoryBasic::Handle handle;

View File

@ -2961,7 +2961,7 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
ret=Type.BOOL))
openmeth.addstmts([
StmtExpr(ExprAssn(p.otherProcessVar(), ExprCall(ExprVar('base::GetCurrentProcessHandle')))),
StmtExpr(ExprAssn(p.otherProcessVar(), ExprVar('ipc::kInvalidProcessHandle'))),
StmtReturn(ExprCall(ExprSelect(p.channelVar(), '.', 'Open'),
[ aChannel, aMessageLoop, sidevar ]))
])