Bug 1317180, part 7 - Remove TypeSpec fields myChmod and otherChmod that are never set. r=billm draft
authorAndrew McCreight <continuation@gmail.com>
Mon, 14 Nov 2016 11:17:12 -0800
changeset 438684 b59718b64863522a6147417e4ff06cef77c177bf
parent 438683 a384dae027844d4326f401b2420d70deb20ffd26
child 438685 67dcf5e9f613b3b021d28332614681ecc615ec0c
push id35795
push userbmo:continuation@gmail.com
push dateMon, 14 Nov 2016 22:23:52 +0000
reviewersbillm
bugs1317180
milestone53.0a1
Bug 1317180, part 7 - Remove TypeSpec fields myChmod and otherChmod that are never set. r=billm The other fields, spec, array, and nullable, are set in some places. Also remove a dead chunk of code with a FIXME that refers to a bug that was WONTFIXed in 2010.
ipc/ipdl/ipdl/ast.py
ipc/ipdl/ipdl/type.py
--- a/ipc/ipdl/ipdl/ast.py
+++ b/ipc/ipdl/ipdl/ast.py
@@ -406,19 +406,16 @@ class Param(Node):
         self.typespec = typespec
 
 class TypeSpec(Node):
     def __init__(self, loc, spec):
         Node.__init__(self, loc)
         self.spec = spec                # QualifiedId
         self.array = 0                  # bool
         self.nullable = 0               # bool
-        self.myChmod = None             # None or string
-        self.otherChmod = None          # None or string
-
     def basename(self):
         return self.spec.baseid
 
     def __str__(self):  return str(self.spec)
 
 class QualifiedId:              # FIXME inherit from node?
     def __init__(self, loc, baseid, quals=[ ]):
         assert isinstance(baseid, str)
--- a/ipc/ipdl/ipdl/type.py
+++ b/ipc/ipdl/ipdl/type.py
@@ -200,17 +200,16 @@ class IPDLType(Type):
     def isProtocol(self): return False
     def isActor(self): return False
     def isStruct(self): return False
     def isUnion(self): return False
     def isArray(self): return False
     def isAtom(self):  return True
     def isCompound(self): return False
     def isShmem(self): return False
-    def isChmod(self): return False
     def isFD(self): return False
     def isEndpoint(self): return False
 
     def isAsync(self): return self.sendSemantics == ASYNC
     def isSync(self): return self.sendSemantics == SYNC
     def isInterrupt(self): return self.sendSemantics is INTR
 
     def hasReply(self):  return (self.isSync() or self.isInterrupt())
@@ -1219,32 +1218,16 @@ class GatherDecls(TcheckVisitor):
 
 
     def _canonicalType(self, itype, typespec, chmodallowed=0):
         loc = typespec.loc
         if itype.isIPDL():
             if itype.isProtocol():
                 itype = ActorType(itype,
                                   nullable=typespec.nullable)
-            # FIXME/cjones: ShmemChmod is disabled until bug 524193
-            if 0 and chmodallowed and itype.isShmem():
-                itype = ShmemChmodType(
-                    itype,
-                    myChmod=typespec.myChmod,
-                    otherChmod=typespec.otherChmod)
-
-        if ((typespec.myChmod or typespec.otherChmod)
-            and not (itype.isIPDL() and (itype.isShmem() or itype.isChmod()))):
-            self.error(
-                loc,
-                "fine-grained access controls make no sense for type `%s'",
-                itype.name())
-
-        if not chmodallowed and (typespec.myChmod or typespec.otherChmod):
-            self.error(loc, "fine-grained access controls not allowed here")
 
         if typespec.nullable and not (itype.isIPDL() and itype.isActor()):
             self.error(
                 loc,
                 "`nullable' qualifier for type `%s' makes no sense",
                 itype.name())
 
         if typespec.array: