Bug 1267369 - Only generate typelib data for scriptable interfaces; r=khuey
authorGregory Szorc <gps@mozilla.com>
Mon, 25 Apr 2016 12:32:10 -0700
changeset 295193 20f5f2164454d1b9b25cfc41a702f41f4166afb0
parent 295192 8fa535b41cad328e6fe334075e3b965d8e5d6507
child 295194 663ca52b138abc91ee1ddeb0a6d32b80b5e48675
push id30220
push usercbook@mozilla.com
push dateThu, 28 Apr 2016 14:31:09 +0000
treeherdermozilla-central@4292da9df16b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1267369
milestone49.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 1267369 - Only generate typelib data for scriptable interfaces; r=khuey We are currently generating typelib data for all interfaces. Apparently typelib data is only needed for scriptable interfaces. So let's stop generating typelib data for interfaces that aren't scriptable. The impact of this is that some typelibs are dropped from interfaces.xpt, resulting in ~10kb smaller interfaces.xpt: * nsIDOMCSSValue * nsIDOMDOMImplementation * nsIDOMDOMCursor * nsIProfilerStartParams * nsIStreamingProtocolMetaData * nsIDOMCharacterData * nsIPrintSession * nsIDOMDocumentFragment * nsIDOMProcessingInstruction * nsIDOMElement * nsIDOMText * nsIDOMXULElement * nsIDOMAttr * nsIDOMGeoPositionError * nsIXMLHttpRequestEventTarget * nsIDOMCSSStyleDeclaration * nsIDOMCSSStyleSheet * nsIDOMDocument * nsIDOMClientRect * nsIDOMMozNamedAttrMap * nsIDOMNode * nsIThreadObserver * nsIDOMDocumentType * nsIXMLHttpRequestUpload * nsISelection * nsIDOMCDATASection * nsIDOMDOMRequest * nsIDOMComment * nsIDOMEvent MozReview-Commit-ID: 3LYdNYs7Tum
xpcom/idl-parser/xpidl/typelib.py
--- a/xpcom/idl-parser/xpidl/typelib.py
+++ b/xpcom/idl-parser/xpidl/typelib.py
@@ -237,20 +237,20 @@ def build_interface(iface, ifaces):
                          function=iface.attributes.function,
                          builtinclass=iface.attributes.builtinclass,
                          main_process_scriptable_only=iface.attributes.main_process_scriptable_only)
 
 
 def write_typelib(idl, fd, filename):
     """ Generate the typelib. """
 
-    # We only care about interfaces
+    # We only care about interfaces that are scriptable.
     ifaces = []
     for p in idl.productions:
-        if p.kind == 'interface':
+        if p.kind == 'interface' and p.attributes.scriptable:
             ifaces.append(build_interface(p, ifaces))
 
     typelib = xpt.Typelib(interfaces=ifaces)
     typelib.writefd(fd)
 
 if __name__ == '__main__':
     from optparse import OptionParser
     o = OptionParser()