diff -r 000000000000 -r 6474c204b198 js/xpconnect/src/dom_quickstubs.qsconf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/xpconnect/src/dom_quickstubs.qsconf Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,109 @@ +# -*- Mode: Python -*- +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +name = 'DOM' + +# A quick warning: +# +# Attributes or methods that call GetCurrentNativeCallContext must not be +# quick-stubbed, because quick stubs don't generate a native call context. +# qsgen.py has no way of knowing which attributes and methods do this, as it +# looks at interfaces, not implementations. The symptoms, if you quick-stub +# one of those, can be really weird, because GetCurrentNativeCallContext +# doesn't crash--it may in fact return a plausible wrong answer. + +members = [ + # dom/interfaces/base + # + # Note that many implementations of interfaces in this directory + # use GetCurrentNativeCallContext, notably: + # - nsIDOMLocation.reload + # - nsIDOMNSHistory.go + # - nsIDOMJSPluginArray.refresh + # - nsIDOMWindow.postMessage + # - nsIDOMJSWindow.{prompt,setTimeout,setInterval,open,openDialog} + # + # (And nsIDOMModalContentWindow.returnValue is an attribute of type + # nsIVariant, which qsgen.py can't handle.) + # + # nsLocationSH has ~ALLOW_PROP_MODS_TO_PROTOTYPE, so don't try. + #'nsIDOMLocation.hostname', + #'nsIDOMLocation.href', + + # dom/interfaces/storage + 'nsIDOMStorage.setItem', + 'nsIDOMStorage.length', + 'nsIDOMStorage.getItem', + 'nsIDOMStorage.key', + 'nsIDOMStorage.removeItem', + 'nsIDOMStorage.clear', + + # dom/interfaces/xpath + 'nsIDOMXPathExpression.evaluate', + 'nsIDOMXPathNSResolver.lookupNamespaceURI', + 'nsIDOMXPathResult.snapshotItem', + 'nsIDOMXPathResult.iterateNext', + 'nsIDOMXPathResult.snapshotLength', + 'nsIDOMXPathResult.resultType', + 'nsIDOMXPathResult.numberValue', + 'nsIDOMXPathResult.stringValue', + 'nsIDOMXPathResult.booleanValue', + 'nsIDOMXPathResult.singleNodeValue', + 'nsIDOMNSXPathExpression.evaluateWithContext', + + # layout/xul/base/public + 'nsIBoxObject.x', + 'nsIBoxObject.y', + 'nsIBoxObject.screenX', + 'nsIBoxObject.screenY', + 'nsIBoxObject.width', + 'nsIBoxObject.height', + + # dom/indexedDB + 'nsIIndexedDatabaseManager.*', + + # dom/quota + 'nsIQuotaManager.*', + 'nsIQuotaRequest.*', + 'nsIUsageCallback.*', + ] + +# Most interfaces can be found by searching the includePath; to find +# nsIDOMEvent, for example, just look for nsIDOMEvent.idl. But IDL filenames +# for very long interface names are slightly abbreviated, and many interfaces +# don't have their own files, just for extra wackiness. So qsgen.py needs +# a little help. +# +irregularFilenames = { + # stowaways + 'nsIDOMBlob': 'nsIDOMFile', + 'nsIIndexedDatabaseUsageCallback': 'nsIIndexedDatabaseManager', + 'nsITelephoneCallback': 'nsITelephone', + } + +customIncludes = [ + 'mozilla/dom/BindingUtils.h', + 'mozilla/dom/EventTargetBinding.h', + 'mozilla/dom/WindowBinding.h', + ] + +nsIDOMStorage_Clear_customMethodCallCode = """ + rv = self->Clear(); + if (NS_SUCCEEDED(rv)) + JS_ClearNonGlobalObject(cx, obj); +""" + +customMethodCalls = { + 'nsIDOMStorage_Clear': { + 'code': nsIDOMStorage_Clear_customMethodCallCode + }, + } + +newBindingProperties = { + # Once the last entry here goes away, we can make the sNativePropertyHooks + # of bindings static. + 'nsIDOMEventTarget': '&mozilla::dom::EventTargetBinding::sNativePropertyHooks->mNativeProperties', + 'nsIDOMWindow': '&mozilla::dom::WindowBinding::sNativePropertyHooks->mNativeProperties', + }