Bug 1323339 - Cleanup of WebAuthn DOM classes; r=jcj r=baku

Changes WebAuthn DOM classes to take nsPIDOMInnerWindow* as parent
pointer, instead of WebAuthentication* pointer.

MozReview-Commit-ID: aK3k9Cc7hv
This commit is contained in:
Kyle Machulis 2017-04-06 15:30:54 -07:00
parent 2945d52cd5
commit 8ad053f05d
8 changed files with 16 additions and 19 deletions

View File

@ -19,7 +19,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ScopedCredential)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
ScopedCredential::ScopedCredential(WebAuthentication* aParent)
ScopedCredential::ScopedCredential(nsPIDOMWindowInner* aParent)
: mParent(aParent)
, mType(ScopedCredentialType::ScopedCred)
{}

View File

@ -27,13 +27,13 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ScopedCredential)
public:
explicit ScopedCredential(WebAuthentication* aParent);
explicit ScopedCredential(nsPIDOMWindowInner* aParent);
protected:
~ScopedCredential();
public:
WebAuthentication*
nsISupports*
GetParentObject() const
{
return mParent;
@ -55,7 +55,7 @@ public:
SetId(CryptoBuffer& aBuffer);
private:
RefPtr<WebAuthentication> mParent;
nsCOMPtr<nsPIDOMWindowInner> mParent;
CryptoBuffer mIdBuffer;
ScopedCredentialType mType;
};

View File

@ -19,7 +19,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ScopedCredentialInfo)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
ScopedCredentialInfo::ScopedCredentialInfo(WebAuthentication* aParent)
ScopedCredentialInfo::ScopedCredentialInfo(nsPIDOMWindowInner* aParent)
: mParent(aParent)
{}
@ -59,6 +59,5 @@ ScopedCredentialInfo::SetAttestation(RefPtr<WebAuthnAttestation> aAttestation)
mAttestation = aAttestation;
}
} // namespace dom
} // namespace mozilla

View File

@ -35,13 +35,13 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ScopedCredentialInfo)
public:
explicit ScopedCredentialInfo(WebAuthentication* aParent);
explicit ScopedCredentialInfo(nsPIDOMWindowInner* aParent);
protected:
~ScopedCredentialInfo();
public:
WebAuthentication*
nsISupports*
GetParentObject() const
{
return mParent;
@ -63,7 +63,7 @@ public:
SetAttestation(RefPtr<WebAuthnAttestation>);
private:
RefPtr<WebAuthentication> mParent;
nsCOMPtr<nsPIDOMWindowInner> mParent;
RefPtr<WebAuthnAttestation> mAttestation;
RefPtr<ScopedCredential> mCredential;
};

View File

@ -19,7 +19,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WebAuthnAssertion)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
WebAuthnAssertion::WebAuthnAssertion(WebAuthentication* aParent)
WebAuthnAssertion::WebAuthnAssertion(nsPIDOMWindowInner* aParent)
: mParent(aParent)
{}

View File

@ -33,13 +33,13 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WebAuthnAssertion)
public:
explicit WebAuthnAssertion(WebAuthentication* aParent);
explicit WebAuthnAssertion(nsPIDOMWindowInner* aParent);
protected:
~WebAuthnAssertion();
public:
WebAuthentication*
nsPIDOMWindowInner*
GetParentObject() const
{
return mParent;
@ -73,7 +73,7 @@ public:
SetSignature(CryptoBuffer& aBuffer);
private:
RefPtr<WebAuthentication> mParent;
nsCOMPtr<nsPIDOMWindowInner> mParent;
RefPtr<ScopedCredential> mCredential;
CryptoBuffer mAuthenticatorData;
CryptoBuffer mClientData;

View File

@ -19,7 +19,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WebAuthnAttestation)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
WebAuthnAttestation::WebAuthnAttestation(WebAuthentication* aParent)
WebAuthnAttestation::WebAuthnAttestation(nsPIDOMWindowInner* aParent)
: mParent(aParent)
{}
@ -57,8 +57,6 @@ void
WebAuthnAttestation::GetAttestation(JSContext* aCx,
JS::MutableHandle<JS::Value> aRetVal) const
{
// JS::RootedObject obj(aCx);
// obj.set();
aRetVal.setObject(*mAttestation.ToUint8Array(aCx));
}

View File

@ -26,13 +26,13 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WebAuthnAttestation)
public:
explicit WebAuthnAttestation(WebAuthentication* aParent);
explicit WebAuthnAttestation(nsPIDOMWindowInner* aParent);
protected:
~WebAuthnAttestation();
public:
WebAuthentication*
nsISupports*
GetParentObject() const
{
return mParent;
@ -66,7 +66,7 @@ public:
SetAttestation(CryptoBuffer& aBuffer);
private:
RefPtr<WebAuthentication> mParent;
nsCOMPtr<nsPIDOMWindowInner> mParent;
nsString mFormat;
CryptoBuffer mClientData;
CryptoBuffer mAuthenticatorData;