Bug 1135803. Take out the bits that try to handle interface types mapping to JSObject* in worker descriptors, since we never do that anymore. r=smaug

This commit is contained in:
Boris Zbarsky 2015-02-24 16:04:22 -05:00
parent 0417f5bf22
commit 05d3e6df24
4 changed files with 15 additions and 34 deletions

View File

@ -13,13 +13,11 @@
# Valid fields for all descriptors:
# * nativeType - The native type (concrete class or XPCOM interface) that
# instances of this interface will unwrap to. If not
# specified, defaults to 'mozilla::dom::InterfaceName' for
# non-worker non-external-or-callback interfaces, to
# specified, defaults to 'nsIDOM' followed by the interface
# name for external interfaces,
# 'mozilla::dom::workers::InterfaceName' for worker
# non-external interfaces, to 'nsIDOM' followed by the
# interface name for non-worker external-or-callback
# interfaces, and to 'JSObject' for worker external-or-callback
# interfaces.
# non-callback interfaces, and 'mozilla::dom::InterfaceName'
# for everything else.
# * headerFile - The file in which the nativeType is declared (defaults
# to an educated guess).
# * concrete - Indicates whether there exist JS objects with this interface as
@ -31,6 +29,7 @@
# will not be made available on the main thread.
# * notflattened - The native type does not have nsIClassInfo, so when
# wrapping it the right IID needs to be passed in.
# Only relevant for callback interfaces.
# * register - True if this binding should be registered. Defaults to true.
# * binaryNames - Dict for mapping method and attribute names to different
# names when calling the native methods (defaults to an empty
@ -606,14 +605,10 @@ DOMInterfaces = {
'headerFile': 'IDBEvents.h',
},
'IID': [
{
'IID': {
'nativeType': 'nsIJSID',
'headerFile': 'xpcjsid.h',
},
{
'workers': True,
}],
'ImageCapture': {
'binaryNames': { 'videoStreamTrack': 'GetVideoStreamTrack' }
@ -623,14 +618,10 @@ DOMInterfaces = {
'wrapperCache': False,
},
'InputStream': [
{
'InputStream': {
'nativeType': 'nsIInputStream',
'notflattened': True
},
{
'workers': True,
}],
'InstallEvent': {
'headerFile': 'ServiceWorkerEvents.h',
@ -1484,16 +1475,10 @@ DOMInterfaces = {
},
},
'WindowProxy': [
{
'WindowProxy': {
'nativeType': 'nsIDOMWindow',
'concrete': False
},
{
# We need a worker descriptor for WindowProxy because EventTarget exists in
# workers. But it's an external interface, so it'll just map to JSObject*.
'workers': True
}],
'WindowRoot': {
'nativeType': 'nsWindowRoot'

View File

@ -4635,10 +4635,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
descriptor = descriptorProvider.getDescriptor(
type.unroll().inner.identifier.name)
if descriptor.nativeType == 'JSObject':
# XXXbz Workers code does this sometimes
assert descriptor.workers
return handleJSObjectType(type, isMember, failureCode, exceptionCode, sourceDescription)
assert descriptor.nativeType != 'JSObject'
if descriptor.interface.isCallback():
name = descriptor.interface.identifier.name
@ -4715,9 +4712,10 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
exceptionCode,
isCallbackReturnValue,
firstCap(sourceDescription)))
elif descriptor.workers:
return handleJSObjectType(type, isMember, failureCode, exceptionCode, sourceDescription)
else:
# Worker descriptors can't end up here, because all of our
# "external" stuff is not exposed in workers.
assert not descriptor.workers
# Either external, or new-binding non-castable. We always have a
# holder for these, because we don't actually know whether we have
# to addref when unwrapping or not. So we just pass an

View File

@ -305,10 +305,8 @@ class Descriptor(DescriptorProvider):
# Read the desc, and fill in the relevant defaults.
ifaceName = self.interface.identifier.name
if self.interface.isExternal():
if self.workers:
nativeTypeDefault = "JSObject"
else:
nativeTypeDefault = "nsIDOM" + ifaceName
assert not self.workers
nativeTypeDefault = "nsIDOM" + ifaceName
elif self.interface.isCallback():
nativeTypeDefault = "mozilla::dom::" + ifaceName
else:

View File

@ -43,6 +43,6 @@ partial interface EventTarget {
// chrome easier. This returns the window which can be used to create
// events to fire at this EventTarget, or null if there isn't one.
partial interface EventTarget {
[ChromeOnly]
[ChromeOnly, Exposed=Window]
readonly attribute WindowProxy? ownerGlobal;
};