Bug 974356 - 1/4 - Initialize mOtherProcess to an invalid handle value - r=bent
authorBenoit Jacob <bjacob@mozilla.com>
Tue, 25 Feb 2014 08:12:49 -0500
changeset 170698 490d3e8706c324bc90c4b2a0d1681908d7298cc1
parent 170697 d20fd7b8501a200d3d1e4a5e9b10fb5a5b96993c
child 170699 b4a5fe646f2730adac0d57778cff3401a25ca087
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersbent
bugs974356
milestone30.0a1
Bug 974356 - 1/4 - Initialize mOtherProcess to an invalid handle value - r=bent
ipc/glue/ProtocolUtils.h
ipc/ipdl/ipdl/lower.py
--- a/ipc/glue/ProtocolUtils.h
+++ b/ipc/glue/ProtocolUtils.h
@@ -51,16 +51,22 @@ class ContentParent;
 }
 
 namespace net {
 class NeckoParent;
 }
 
 namespace ipc {
 
+#ifdef XP_WIN
+const base::ProcessHandle kInvalidProcessHandle = INVALID_HANDLE_VALUE;
+#else
+const base::ProcessHandle kInvalidProcessHandle = -1;
+#endif
+
 class ProtocolFdMapping;
 class ProtocolCloneContext;
 
 // Used to pass references to protocol actors across the wire.
 // Actors created on the parent-side have a positive ID, and actors
 // allocated on the child side have a negative ID.
 struct ActorHandle
 {
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -2879,16 +2879,18 @@ class _GenerateProtocolActorCode(ipdl.as
         ctor = ConstructorDefn(ConstructorDecl(self.clsname))
         if ptype.isToplevel():
             ctor.memberinits = [
                 ExprMemberInit(p.channelVar(), [
                     ExprCall(ExprVar('ALLOW_THIS_IN_INITIALIZER_LIST'),
                              [ ExprVar.THIS ]) ]),
                 ExprMemberInit(p.lastActorIdVar(),
                                [ p.actorIdInit(self.side) ]),
+                ExprMemberInit(p.otherProcessVar(),
+                               [ ExprVar('ipc::kInvalidProcessHandle') ]),
                 ExprMemberInit(p.lastShmemIdVar(),
                                [ p.shmemIdInit(self.side) ]),
                 ExprMemberInit(p.stateVar(),
                                [ p.startState() ])
             ]
             if ptype.isToplevel():
                 ctor.memberinits = [ExprMemberInit(
                     p.openedProtocolInterfaceType(),