Bug 793528. Worker bindings should default to looking for headers in mozilla/dom/workers/bindings/. r=khuey
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 01 Oct 2012 08:45:11 -0400
changeset 108750 1b63db497ca442b68af42627d55d782fb3f89918
parent 108749 c61a2a4bc3940be530b760ccfef9adb45151232e
child 108751 144db3479fe37c80e9c92fbd6e1d3471010a7782
push idunknown
push userunknown
push dateunknown
reviewerskhuey
bugs793528
milestone18.0a1
Bug 793528. Worker bindings should default to looking for headers in mozilla/dom/workers/bindings/. r=khuey
dom/bindings/Bindings.conf
dom/bindings/Configuration.py
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -192,32 +192,30 @@ DOMInterfaces = {
 {
     'nativeType': 'nsDOMEventTargetHelper',
     'hasInstanceInterface': 'nsIDOMEventTarget',
     'concrete': False,
     'prefable': True,
 },
 {
     'workers': True,
-    'headerFile': 'mozilla/dom/workers/bindings/EventTarget.h',
     'concrete': False
 }],
 
 'FileList': [
 {
     'nativeType': 'nsDOMFileList',
     'headerFile': 'nsDOMFile.h',
     'prefable': True,
     'resultNotAddRefed': [ 'item' ]
 }],
 
 'FileReaderSync': [
 {
     'workers': True,
-    'headerFile': 'mozilla/dom/workers/bindings/FileReaderSync.h'
 }],
 
 'FormData': [
 {
 },
 {
     'workers': True,
 }],
@@ -377,41 +375,38 @@ DOMInterfaces = {
 'XMLHttpRequest': [
 {
     'nativeType': 'nsXMLHttpRequest',
     'implicitJSContext': [ 'constructor', ],
     'resultNotAddRefed': [ 'upload', 'responseXML' ]
 },
 {
     'workers': True,
-    'headerFile': 'mozilla/dom/workers/bindings/XMLHttpRequest.h',
 }],
 
 'XMLHttpRequestEventTarget': [
 {
     'nativeType': 'nsXHREventTarget',
     'headerFile': 'nsXMLHttpRequest.h',
     'concrete': False,
     'prefable': True,
 },
 {
     'workers': True,
     'concrete': False,
-    'headerFile': 'mozilla/dom/workers/bindings/XMLHttpRequestEventTarget.h'
 }],
 
 'XMLHttpRequestUpload': [
 {
     'nativeType': 'nsXMLHttpRequestUpload',
     'headerFile': 'nsXMLHttpRequest.h',
     'prefable': True
 },
 {
     'workers': True,
-    'headerFile': 'mozilla/dom/workers/bindings/XMLHttpRequestUpload.h'
 }],
 
 'WebSocket': [
 {
     'headerFile': 'WebSocket.h',
     'implicitJSContext': [ 'constructor' ]
 }],
 
--- a/dom/bindings/Configuration.py
+++ b/dom/bindings/Configuration.py
@@ -141,18 +141,21 @@ class Descriptor(DescriptorProvider):
 
         self.nativeType = desc.get('nativeType', nativeTypeDefault)
         self.hasInstanceInterface = desc.get('hasInstanceInterface', None)
 
         # Do something sane for JSObject
         if self.nativeType == "JSObject":
             headerDefault = "jsapi.h"
         else:
-            headerDefault = self.nativeType
-            headerDefault = headerDefault.replace("::", "/") + ".h"
+            if self.workers:
+                headerDefault = "mozilla/dom/workers/bindings/%s.h" % ifaceName
+            else:
+                headerDefault = self.nativeType
+                headerDefault = headerDefault.replace("::", "/") + ".h"
         self.headerFile = desc.get('headerFile', headerDefault)
 
         if self.interface.isCallback() or self.interface.isExternal():
             if 'castable' in desc:
                 raise TypeError("%s is external or callback but has a castable "
                                 "setting" % self.interface.identifier.name)
             self.castable = False
         else: