mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 00:50:40 +00:00
Bug 817276 - Part b: Return the pointer directly from nsScriptNameSpaceManager::LookupNavigatorName; r=jst
This commit is contained in:
parent
28b59cc1af
commit
87a980808c
@ -7652,10 +7652,8 @@ nsNavigatorSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
|
||||
nsDependentJSString name(id);
|
||||
|
||||
const nsGlobalNameStruct *name_struct = nullptr;
|
||||
|
||||
nameSpaceManager->LookupNavigatorName(name, &name_struct);
|
||||
|
||||
const nsGlobalNameStruct* name_struct =
|
||||
nameSpaceManager->LookupNavigatorName(name);
|
||||
if (!name_struct) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -499,23 +499,20 @@ nsScriptNameSpaceManager::LookupNameInternal(const nsAString& aName,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsScriptNameSpaceManager::LookupNavigatorName(const nsAString& aName,
|
||||
const nsGlobalNameStruct **aNameStruct)
|
||||
const nsGlobalNameStruct*
|
||||
nsScriptNameSpaceManager::LookupNavigatorName(const nsAString& aName)
|
||||
{
|
||||
GlobalNameMapEntry *entry =
|
||||
static_cast<GlobalNameMapEntry *>
|
||||
(PL_DHashTableOperate(&mNavigatorNames, &aName,
|
||||
PL_DHASH_LOOKUP));
|
||||
|
||||
if (PL_DHASH_ENTRY_IS_BUSY(entry) &&
|
||||
!((&entry->mGlobalName)->mDisabled)) {
|
||||
*aNameStruct = &entry->mGlobalName;
|
||||
} else {
|
||||
*aNameStruct = nullptr;
|
||||
if (!PL_DHASH_ENTRY_IS_BUSY(entry) ||
|
||||
entry->mGlobalName.mDisabled) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
return &entry->mGlobalName;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -109,8 +109,7 @@ public:
|
||||
// null if one is not found. The returned nsGlobalNameStruct is only
|
||||
// guaranteed to be valid until the next call to any of the methods
|
||||
// in this class.
|
||||
nsresult LookupNavigatorName(const nsAString& aName,
|
||||
const nsGlobalNameStruct **aNameStruct);
|
||||
const nsGlobalNameStruct* LookupNavigatorName(const nsAString& aName);
|
||||
|
||||
nsresult RegisterClassName(const char *aClassName,
|
||||
int32_t aDOMClassInfoID,
|
||||
|
Loading…
Reference in New Issue
Block a user