Bug 1038966, part 2 - Rename autoptr methods to refptr in lower.py. r=bent
authorAndrew McCreight <continuation@gmail.com>
Fri, 25 Jul 2014 16:41:25 -0700
changeset 196219 833d3741961c53f58d65601e32dd05c07bc72c65
parent 196218 edf7cf2e8fd78bb5ac4644c49491d68bdc92e8e2
child 196220 c8cee3a37f9c333eb97283f0b75c82607728702f
push id27208
push usercbook@mozilla.com
push dateMon, 28 Jul 2014 13:33:20 +0000
treeherdermozilla-central@70b3fc807a70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs1038966
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1038966, part 2 - Rename autoptr methods to refptr in lower.py. r=bent Rename these before changing the definition to reduce the noise in the next patch.
ipc/ipdl/ipdl/lower.py
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -314,23 +314,23 @@ def _abortIfFalse(cond, msg):
         [ cond, ExprLiteral.String(msg) ]))
 
 def _runtimeAbort(msg):
     if isinstance(msg, str):
         msg = ExprLiteral.String(msg)
     return StmtExpr(
         ExprCall(ExprVar('NS_RUNTIMEABORT'), args=[ msg ]))
 
-def _autoptr(T):
+def _refptr(T):
     return Type('nsAutoPtr', T=T)
 
-def _autoptrGet(expr):
+def _refptrGet(expr):
     return ExprCall(ExprSelect(expr, '.', 'get'))
 
-def _autoptrForget(expr):
+def _refptrForget(expr):
     return ExprCall(ExprSelect(expr, '.', 'forget'))
 
 def _cxxArrayType(basetype, const=0, ref=0):
     return Type('InfallibleTArray', T=basetype, const=const, ref=ref)
 
 def _cxxFallibleArrayType(basetype, const=0, ref=0):
     return Type('FallibleTArray', T=basetype, const=const, ref=ref)
 
@@ -3635,28 +3635,28 @@ class _GenerateProtocolActorCode(ipdl.as
             #   Shmem s(seg, [nextshmemid]);
             #   Message descriptor;
             #   if (!s->ShareTo(subprocess, mId, descriptor) ||
             #       !Send(descriptor))
             #     return null;
             #   mShmemMap.Add(seg, id);
             #   return shmem.forget();
             createshmem.addstmt(StmtDecl(
-                Decl(_autoptr(_rawShmemType()), rawvar.name),
+                Decl(_refptr(_rawShmemType()), rawvar.name),
                 initargs=[ _shmemAlloc(sizevar, typevar, unsafevar) ]))
             failif = StmtIf(ExprNot(rawvar))
             failif.addifstmt(StmtReturn(ExprLiteral.NULL))
             createshmem.addstmt(failif)
 
             descriptorvar = ExprVar('descriptor')
             createshmem.addstmts([
                 StmtDecl(
                     Decl(_shmemType(), shmemvar.name),
                     initargs=[ _shmemBackstagePass(),
-                               _autoptrGet(rawvar),
+                               _refptrGet(rawvar),
                                p.nextShmemIdExpr(self.side) ]),
                 StmtDecl(Decl(Type('Message', ptr=1), descriptorvar.name),
                          init=_shmemShareTo(shmemvar,
                                             p.callOtherProcess(),
                                             p.routingId()))
             ])
             failif = StmtIf(ExprNot(descriptorvar))
             failif.addifstmt(StmtReturn(ExprLiteral.NULL))
@@ -3667,17 +3667,17 @@ class _GenerateProtocolActorCode(ipdl.as
                 args=[ descriptorvar ])))
             createshmem.addstmt(failif)
 
             createshmem.addstmts([
                 StmtExpr(ExprAssn(ExprDeref(idvar), _shmemId(shmemvar))),
                 StmtExpr(ExprCall(
                     ExprSelect(p.shmemMapVar(), '.', 'AddWithID'),
                     args=[ rawvar, ExprDeref(idvar) ])),
-                StmtReturn(_autoptrForget(rawvar))
+                StmtReturn(_refptrForget(rawvar))
             ])
 
             # SharedMemory* AdoptSharedMemory(SharedMemory*, id_t*):
             #   Shmem s(seg, [nextshmemid]);
             #   Message descriptor;
             #   if (!s->ShareTo(subprocess, mId, descriptor) ||
             #       !Send(descriptor))
             #     return false;
@@ -4125,28 +4125,28 @@ class _GenerateProtocolActorCode(ipdl.as
         assert p.decl.type.isToplevel()
         
         case = StmtBlock()                                          
 
         rawvar = ExprVar('rawmem')
         idvar = ExprVar('id')
         case.addstmts([
             StmtDecl(Decl(_shmemIdType(), idvar.name)),
-            StmtDecl(Decl(_autoptr(_rawShmemType()), rawvar.name),
+            StmtDecl(Decl(_refptr(_rawShmemType()), rawvar.name),
                      initargs=[ _shmemOpenExisting(self.msgvar,
                                                    ExprAddrOf(idvar)) ])
         ])
         failif = StmtIf(ExprNot(rawvar))
         failif.addifstmt(StmtReturn(_Result.PayloadError))
 
         case.addstmts([
             failif,
             StmtExpr(ExprCall(
                 ExprSelect(p.shmemMapVar(), '.', 'AddWithID'),
-                args=[ _autoptrForget(rawvar), idvar ])),
+                args=[ _refptrForget(rawvar), idvar ])),
             Whitespace.NL,
             StmtReturn(_Result.Processed)
         ])
 
         return case
 
     def genShmemDestroyedHandler(self):
         p = self.protocol