diff --git a/dom/crypto/KeyAlgorithm.h b/dom/crypto/KeyAlgorithm.h index 3b3c4ce18082..4900685ef555 100644 --- a/dom/crypto/KeyAlgorithm.h +++ b/dom/crypto/KeyAlgorithm.h @@ -31,12 +31,6 @@ enum KeyAlgorithmStructuredCloneTags { } -template<> -struct HasDangerousPublicDestructor -{ - static const bool value = true; -}; - namespace dom { class KeyAlgorithm : public nsISupports, @@ -49,8 +43,6 @@ public: public: KeyAlgorithm(nsIGlobalObject* aGlobal, const nsString& aName); - virtual ~KeyAlgorithm(); - nsIGlobalObject* GetParentObject() const { return mGlobal; @@ -72,6 +64,8 @@ public: } protected: + virtual ~KeyAlgorithm(); + nsRefPtr mGlobal; nsString mName; CK_MECHANISM_TYPE mMechanism; diff --git a/dom/crypto/WebCryptoTask.cpp b/dom/crypto/WebCryptoTask.cpp index 8272b972c9d9..a99434348fb7 100644 --- a/dom/crypto/WebCryptoTask.cpp +++ b/dom/crypto/WebCryptoTask.cpp @@ -1167,8 +1167,8 @@ public: if (params.mLength.WasPassed()) { mLength = params.mLength.Value(); } else { - KeyAlgorithm hashAlg(global, hashName); - switch (hashAlg.Mechanism()) { + nsRefPtr hashAlg = new KeyAlgorithm(global, hashName); + switch (hashAlg->Mechanism()) { case CKM_SHA_1: case CKM_SHA256: mLength = 512;