Bug 779809 part 1 - Make [notxpcom] attributes an error; r=khuey
authorAryeh Gregor <ayg@aryeh.name>
Thu, 09 Aug 2012 11:31:14 +0300
changeset 111861 385bc6d035973f3909fb943484d1485583199608
parent 111860 385dbb23bb344d9390a756bb9422fc07b7f29699
child 111862 0cbe950173a83dea4f9dbd43f7b53796678b864b
push id2248
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 19:23:44 +0000
treeherdermozilla-aurora@118a3b748323 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs779809
milestone18.0a1
Bug 779809 part 1 - Make [notxpcom] attributes an error; r=khuey
caps/idl/nsIPrincipal.idl
js/xpconnect/src/qsgen.py
netwerk/base/public/nsITimedChannel.idl
xpcom/components/nsIClassInfo.idl
xpcom/idl-parser/typelib.py
xpcom/idl-parser/xpidl.py
--- a/caps/idl/nsIPrincipal.idl
+++ b/caps/idl/nsIPrincipal.idl
@@ -296,10 +296,10 @@ interface nsIPrincipal : nsISerializable
 [uuid(f3e177Df-6a5e-489f-80a7-2dd1481471d8)]
 interface nsIExpandedPrincipal : nsISupports
 {
   /**
    * An array of principals that the expanded principal subsumes.
    * Note: this list is not reference counted, it is shared, so 
    * should not be changed and should only be used ephemerally.
    */
-  [notxpcom] readonly attribute PrincipalArray whiteList;
+  [noscript] readonly attribute PrincipalArray whiteList;
 };
--- a/js/xpconnect/src/qsgen.py
+++ b/js/xpconnect/src/qsgen.py
@@ -183,17 +183,17 @@ def addStubMember(memberId, member):
 def checkStubMember(member, isCustom):
     memberId = member.iface.name + "." + member.name
     if member.kind not in ('method', 'attribute'):
         raise UserError("Member %s is %r, not a method or attribute."
                         % (memberId, member.kind))
     if member.noscript:
         raise UserError("%s %s is noscript."
                         % (member.kind.capitalize(), memberId))
-    if member.notxpcom:
+    if member.kind == 'method' and member.notxpcom:
         raise UserError(
             "%s %s: notxpcom methods are not supported."
             % (member.kind.capitalize(), memberId))
 
     if (member.kind == 'attribute'
           and not member.readonly
           and isSpecificInterfaceType(member.realtype, 'nsIVariant')
           and not isCustom):
--- a/netwerk/base/public/nsITimedChannel.idl
+++ b/netwerk/base/public/nsITimedChannel.idl
@@ -14,33 +14,33 @@ native TimeStamp(mozilla::TimeStamp);
 // All properties return zero if the value is not available
 [scriptable, uuid(c259b593-a9bf-4d08-8149-ef89e1977dc4)]
 interface nsITimedChannel : nsISupports {
   // Set this attribute to true to enable collection of timing data.
   // channelCreationTime will be available even with this attribute set to
   // false.
   attribute boolean timingEnabled;
 
-  [notxpcom] readonly attribute TimeStamp channelCreation;
-  [notxpcom] readonly attribute TimeStamp asyncOpen;
+  [noscript] readonly attribute TimeStamp channelCreation;
+  [noscript] readonly attribute TimeStamp asyncOpen;
 
   // The following are only set when the document is not (only) read from the
   // cache
-  [notxpcom] readonly attribute TimeStamp domainLookupStart;
-  [notxpcom] readonly attribute TimeStamp domainLookupEnd;
-  [notxpcom] readonly attribute TimeStamp connectStart;
-  [notxpcom] readonly attribute TimeStamp connectEnd;
-  [notxpcom] readonly attribute TimeStamp requestStart;
-  [notxpcom] readonly attribute TimeStamp responseStart;
-  [notxpcom] readonly attribute TimeStamp responseEnd;
+  [noscript] readonly attribute TimeStamp domainLookupStart;
+  [noscript] readonly attribute TimeStamp domainLookupEnd;
+  [noscript] readonly attribute TimeStamp connectStart;
+  [noscript] readonly attribute TimeStamp connectEnd;
+  [noscript] readonly attribute TimeStamp requestStart;
+  [noscript] readonly attribute TimeStamp responseStart;
+  [noscript] readonly attribute TimeStamp responseEnd;
 
   // The following are only set if the document is (partially) read from the
   // cache
-  [notxpcom] readonly attribute TimeStamp cacheReadStart;
-  [notxpcom] readonly attribute TimeStamp cacheReadEnd;
+  [noscript] readonly attribute TimeStamp cacheReadStart;
+  [noscript] readonly attribute TimeStamp cacheReadEnd;
 
   // All following are PRTime versions of the above.
   readonly attribute PRTime channelCreationTime;
   readonly attribute PRTime asyncOpenTime;
   readonly attribute PRTime domainLookupStartTime;
   readonly attribute PRTime domainLookupEndTime;
   readonly attribute PRTime connectStartTime;
   readonly attribute PRTime connectEndTime;
--- a/xpcom/components/nsIClassInfo.idl
+++ b/xpcom/components/nsIClassInfo.idl
@@ -101,11 +101,11 @@ interface nsIClassInfo : nsISupports
 
     /**
      * Also a class ID through which an instance of this class can be created
      * (or accessed as a service, if |flags & SINGLETON|).  If the class does
      * not have a CID, it should return NS_ERROR_NOT_AVAILABLE.  This attribute
      * exists so C++ callers can avoid allocating and freeing a CID, as would
      * happen if they used classID.
      */
-    [notxpcom] readonly attribute nsCID classIDNoAlloc;
+    [noscript] readonly attribute nsCID classIDNoAlloc;
 
 };
--- a/xpcom/idl-parser/typelib.py
+++ b/xpcom/idl-parser/typelib.py
@@ -188,26 +188,26 @@ def build_interface(iface, ifaces):
                                   constructor=False, hidden=m.noscript,
                                   optargc=m.optional_argc,
                                   implicit_jscontext=m.implicit_jscontext))
 
     def build_attr(a):
         # Write the getter
         methods.append(xpt.Method(a.name, build_nsresult_param(),
                                   [build_attr_param(a, getter=True)],
-                                  getter=True, setter=False, notxpcom=a.notxpcom,
+                                  getter=True, setter=False,
                                   constructor=False, hidden=a.noscript,
                                   optargc=False,
                                   implicit_jscontext=a.implicit_jscontext))
 
         # And maybe the setter
         if not a.readonly:
             methods.append(xpt.Method(a.name, build_nsresult_param(),
                                       [build_attr_param(a, setter=True)],
-                                      getter=False, setter=True, notxpcom=a.notxpcom,
+                                      getter=False, setter=True,
                                       constructor=False, hidden=a.noscript,
                                       optargc=False,
                                       implicit_jscontext=a.implicit_jscontext))
 
     for member in iface.members:
         if isinstance(member, xpidl.ConstMember):
             build_const(member)
         elif isinstance(member, xpidl.Attribute):
--- a/xpcom/idl-parser/xpidl.py
+++ b/xpcom/idl-parser/xpidl.py
@@ -701,17 +701,16 @@ class ConstMember(object):
         return "\tconst %s %s = %s\n" % (self.type, self.name, self.getValue())
 
     def count(self):
         return 0
 
 class Attribute(object):
     kind = 'attribute'
     noscript = False
-    notxpcom = False
     readonly = False
     implicit_jscontext = False
     nostdcall = False
     binaryname = None
     null = None
     undefined = None
     deprecated = False
     nullable = False
@@ -758,18 +757,16 @@ class Attribute(object):
                                    aloc);
                 self.undefined = value
             else:
                 if value is not None:
                     raise IDLError("Unexpected attribute value", aloc)
 
                 if name == 'noscript':
                     self.noscript = True
-                elif name == 'notxpcom':
-                    self.notxpcom = True
                 elif name == 'implicit_jscontext':
                     self.implicit_jscontext = True
                 elif name == 'deprecated':
                     self.deprecated = True
                 elif name == 'nostdcall':
                     self.nostdcall = True
                 elif name == 'infallible':
                     self.infallible = True
@@ -800,20 +797,20 @@ class Attribute(object):
                            '[builtinclass] interfaces',
                            self.location)
 
 
     def toIDL(self):
         attribs = attlistToIDL(self.attlist)
         readonly = self.readonly and 'readonly ' or ''
         return "%s%sattribute %s %s;" % (attribs, readonly, self.type, self.name)
-        
+
     def isScriptable(self):
         if not self.iface.attributes.scriptable: return False
-        return not (self.noscript or self.notxpcom)
+        return not self.noscript
 
     def __str__(self):
         return "\t%sattribute %s %s\n" % (self.readonly and 'readonly ' or '',
                                           self.type, self.name)
 
     def count(self):
         return self.readonly and 1 or 2