Backed out changeset d385df62c0e7 (bug 1267186) for hazard failures
This commit is contained in:
@@ -33,24 +33,35 @@
|
||||
#include "nsWeakReference.h"
|
||||
#include "xpcpublic.h"
|
||||
|
||||
|
||||
struct nsGlobalNameStruct
|
||||
{
|
||||
enum nametype {
|
||||
eTypeNotInitialized,
|
||||
eTypeNewDOMBinding,
|
||||
eTypeProperty,
|
||||
eTypeExternalConstructor,
|
||||
eTypeClassConstructor,
|
||||
eTypeClassProto,
|
||||
} mType;
|
||||
|
||||
// mChromeOnly is only used for structs that define non-WebIDL things
|
||||
// (possibly in addition to WebIDL ones). In particular, it's not even
|
||||
// initialized for eTypeNewDOMBinding structs.
|
||||
bool mChromeOnly : 1;
|
||||
bool mAllowXBL : 1;
|
||||
|
||||
union {
|
||||
int32_t mDOMClassInfoID; // eTypeClassConstructor
|
||||
nsIID mIID; // eTypeClassProto
|
||||
nsCID mCID; // All other types
|
||||
nsCID mCID; // All other types except eTypeNewDOMBinding
|
||||
};
|
||||
|
||||
// For new style DOM bindings.
|
||||
mozilla::dom::DefineInterface mDefineDOMInterface;
|
||||
|
||||
// May be null if enabled unconditionally
|
||||
mozilla::dom::ConstructorEnabled* mConstructorEnabled;
|
||||
};
|
||||
|
||||
class GlobalNameMapEntry : public PLDHashEntryHdr
|
||||
@@ -101,6 +112,19 @@ public:
|
||||
const nsIID *aConstructorProtoIID,
|
||||
bool *aFoundOld);
|
||||
|
||||
void RegisterDefineDOMInterface(const nsAFlatString& aName,
|
||||
mozilla::dom::DefineInterface aDefineDOMInterface,
|
||||
mozilla::dom::ConstructorEnabled* aConstructorEnabled);
|
||||
template<size_t N>
|
||||
void RegisterDefineDOMInterface(const char16_t (&aKey)[N],
|
||||
mozilla::dom::DefineInterface aDefineDOMInterface,
|
||||
mozilla::dom::ConstructorEnabled* aConstructorEnabled)
|
||||
{
|
||||
nsLiteralString key(aKey);
|
||||
return RegisterDefineDOMInterface(key, aDefineDOMInterface,
|
||||
aConstructorEnabled);
|
||||
}
|
||||
|
||||
class NameIterator : public PLDHashTable::Iterator
|
||||
{
|
||||
public:
|
||||
@@ -131,14 +155,22 @@ private:
|
||||
// that aKey will be mapped to. If mType in the returned
|
||||
// nsGlobalNameStruct is != eTypeNotInitialized, an entry for aKey
|
||||
// already existed.
|
||||
nsGlobalNameStruct *AddToHash(const char *aKey,
|
||||
nsGlobalNameStruct *AddToHash(const nsAString *aKey,
|
||||
const char16_t **aClassName = nullptr);
|
||||
|
||||
nsGlobalNameStruct *AddToHash(const char *aKey,
|
||||
const char16_t **aClassName = nullptr)
|
||||
{
|
||||
NS_ConvertASCIItoUTF16 key(aKey);
|
||||
return AddToHash(&key, aClassName);
|
||||
}
|
||||
// Removes an existing entry from the hash.
|
||||
void RemoveFromHash(const nsAString *aKey);
|
||||
|
||||
nsresult FillHash(nsICategoryManager *aCategoryManager,
|
||||
const char *aCategory);
|
||||
nsresult RegisterInterface(const char* aIfName,
|
||||
const nsIID *aIfIID,
|
||||
bool* aFoundOld);
|
||||
|
||||
/**
|
||||
* Add a new category entry into the hash table.
|
||||
|
||||
Reference in New Issue
Block a user