зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1442039 part 8. Remove now-unused eTypeClassConstructor type of nsGlobalNameStruct. r=peterv
GetXPCProto is now static and not called, so needs to go too. MozReview-Commit-ID: I6DilDx2e2m
This commit is contained in:
Родитель
ba414c683e
Коммит
9d7bf3da5c
|
@ -491,29 +491,6 @@ nsDOMClassInfo::ShutDown()
|
|||
sIsInitialized = false;
|
||||
}
|
||||
|
||||
static nsresult
|
||||
GetXPCProto(nsIXPConnect *aXPConnect, JSContext *cx, nsGlobalWindowInner *aWin,
|
||||
const nsGlobalNameStruct *aNameStruct,
|
||||
JS::MutableHandle<JSObject*> aProto)
|
||||
{
|
||||
NS_ASSERTION(aNameStruct->mType == nsGlobalNameStruct::eTypeClassConstructor,
|
||||
"Wrong type!");
|
||||
|
||||
int32_t id = aNameStruct->mDOMClassInfoID;
|
||||
MOZ_ASSERT(id >= 0, "Negative DOM classinfo?!?");
|
||||
|
||||
nsDOMClassInfoID ci_id = (nsDOMClassInfoID)id;
|
||||
|
||||
nsCOMPtr<nsIClassInfo> ci = NS_GetDOMClassInfoInstance(ci_id);
|
||||
NS_ENSURE_TRUE(ci, NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsresult rv =
|
||||
aXPConnect->GetWrappedNativePrototype(cx, aWin->GetGlobalJSObject(), ci, aProto.address());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return JS_WrapObject(cx, aProto) ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
static nsresult
|
||||
LookupComponentsShim(JSContext *cx, JS::Handle<JSObject*> global,
|
||||
nsPIDOMWindowInner *win,
|
||||
|
@ -606,24 +583,6 @@ nsWindowSH::GlobalResolve(nsGlobalWindowInner *aWin, JSContext *cx,
|
|||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor) {
|
||||
// The only eTypeClassConstructor struct left is DOMConstructor.
|
||||
MOZ_ASSERT(name.EqualsLiteral("DOMConstructor"));
|
||||
|
||||
// Create the XPConnect prototype for our classinfo, PostCreateProto will
|
||||
// set up the prototype chain. This will go ahead and define things on the
|
||||
// actual window's global.
|
||||
JS::Rooted<JSObject*> dot_prototype(cx);
|
||||
rv = GetXPCProto(nsDOMClassInfo::sXPConnect, cx, aWin, name_struct,
|
||||
&dot_prototype);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
MOZ_ASSERT(dot_prototype);
|
||||
|
||||
// GetXPCProto already defined the property for us if needed.
|
||||
FillPropertyDescriptor(desc, obj, JS::UndefinedValue(), false);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (name_struct->mType == nsGlobalNameStruct::eTypeProperty) {
|
||||
// Before defining a global property, check for a named subframe of the
|
||||
// same name. If it exists, we don't want to shadow it.
|
||||
|
|
|
@ -24,11 +24,9 @@ struct nsGlobalNameStruct
|
|||
enum nametype {
|
||||
eTypeNotInitialized,
|
||||
eTypeProperty,
|
||||
eTypeClassConstructor,
|
||||
} mType;
|
||||
|
||||
union {
|
||||
int32_t mDOMClassInfoID; // eTypeClassConstructor
|
||||
nsCID mCID; // eTypeProperty
|
||||
};
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче