Bug 1218454 - part 1 - move DialogValueHolder::Get out-of-line; r=bz

No reason for one ::Get to be out-of-line and the other not.  This
change means that nsGlobalWindow.h doesn't depend on nsContentUtils.
This commit is contained in:
Nathan Froyd 2015-10-26 12:55:45 -04:00
parent 091b2967a3
commit 510688b31c
2 changed files with 15 additions and 9 deletions

View File

@ -584,6 +584,20 @@ DialogValueHolder::Get(nsIPrincipal* aSubject, nsIVariant** aResult)
return NS_OK;
}
void
DialogValueHolder::Get(JSContext* aCx, JS::Handle<JSObject*> aScope,
nsIPrincipal* aSubject,
JS::MutableHandle<JS::Value> aResult,
mozilla::ErrorResult& aError)
{
if (aSubject->Subsumes(mOrigin)) {
aError = nsContentUtils::XPConnect()->VariantToJS(aCx, aScope,
mValue, aResult);
} else {
aResult.setUndefined();
}
}
namespace mozilla {
namespace dom {
extern uint64_t

View File

@ -267,15 +267,7 @@ public:
, mValue(aValue) {}
nsresult Get(nsIPrincipal* aSubject, nsIVariant** aResult);
void Get(JSContext* aCx, JS::Handle<JSObject*> aScope, nsIPrincipal* aSubject,
JS::MutableHandle<JS::Value> aResult, mozilla::ErrorResult& aError)
{
if (aSubject->Subsumes(mOrigin)) {
aError = nsContentUtils::XPConnect()->VariantToJS(aCx, aScope,
mValue, aResult);
} else {
aResult.setUndefined();
}
}
JS::MutableHandle<JS::Value> aResult, mozilla::ErrorResult& aError);
private:
virtual ~DialogValueHolder() {}