DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (27a812186ff4)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
# -*- 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
    'nsIDOMToString.toString',
    '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/file
    'nsIDOMLockedFile.*',

    # 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',
    }