Bug 897359 - Remove unimplemented popChallengeResponse, random, and disableRightClick methods. r=bz
authorAnuj Agarwal <anujagarwal464@gmail.com>
Fri, 18 Apr 2014 09:32:52 -0400
changeset 179292 e5bffd7d60c5780f300425e9f55bcc55c9d80eae
parent 179233 45ba19361b97d3154fa8dc26b707f48fab65fa99
child 179293 5fa0c8f5ccb2bd124a49f058ebdad002eff9695e
push id26613
push userryanvm@gmail.com
push dateSat, 19 Apr 2014 02:00:22 +0000
treeherdermozilla-central@582b2d81ebe1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs897359
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 897359 - Remove unimplemented popChallengeResponse, random, and disableRightClick methods. r=bz
dom/base/Crypto.cpp
dom/base/Crypto.h
dom/tests/mochitest/crypto/test_legacy.html
dom/tests/mochitest/crypto/test_no_legacy.html
dom/webidl/Crypto.webidl
security/manager/ssl/src/nsCrypto.cpp
security/manager/ssl/src/nsCrypto.h
--- a/dom/base/Crypto.cpp
+++ b/dom/base/Crypto.cpp
@@ -170,52 +170,32 @@ Crypto::ImportUserCertificates(const nsA
                                bool aDoForcedBackup,
                                nsAString& aReturn,
                                ErrorResult& aRv)
 {
   aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
 void
-Crypto::PopChallengeResponse(const nsAString& aChallenge,
-                             nsAString& aReturn,
-                             ErrorResult& aRv)
-{
-  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
-}
-
-void
-Crypto::Random(int32_t aNumBytes, nsAString& aReturn, ErrorResult& aRv)
-{
-  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
-}
-
-void
 Crypto::SignText(JSContext* aContext,
                  const nsAString& aStringToSign,
                  const nsAString& aCaOption,
                  const Sequence<nsCString>& aArgs,
                  nsAString& aReturn)
 
 {
   aReturn.AssignLiteral("error:internalError");
 }
 
 void
 Crypto::Logout(ErrorResult& aRv)
 {
   aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
-void
-Crypto::DisableRightClick(ErrorResult& aRv)
-{
-  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
-}
-
 #endif
 
 /* static */ uint8_t*
 Crypto::GetRandomValues(uint32_t aLength)
 {
   nsCOMPtr<nsIRandomGenerator> randomGenerator;
   nsresult rv;
   randomGenerator = do_GetService("@mozilla.org/security/random-generator;1");
--- a/dom/base/Crypto.h
+++ b/dom/base/Crypto.h
@@ -61,31 +61,24 @@ public:
                       ErrorResult& aRv);
 
   virtual void ImportUserCertificates(const nsAString& aNickname,
                                       const nsAString& aCmmfResponse,
                                       bool aDoForcedBackup,
                                       nsAString& aReturn,
                                       ErrorResult& aRv);
 
-  virtual void PopChallengeResponse(const nsAString& aChallenge,
-                                    nsAString& aReturn,
-                                    ErrorResult& aRv);
-
-  virtual void Random(int32_t aNumBytes, nsAString& aReturn, ErrorResult& aRv);
-
   virtual void SignText(JSContext* aContext,
                         const nsAString& aStringToSign,
                         const nsAString& aCaOption,
                         const Sequence<nsCString>& aArgs,
                         nsAString& aReturn);
 
   virtual void Logout(ErrorResult& aRv);
 
-  virtual void DisableRightClick(ErrorResult& aRv);
 #endif
 
   // WebIDL
 
   nsPIDOMWindow*
   GetParentObject() const
   {
     return mWindow;
--- a/dom/tests/mochitest/crypto/test_legacy.html
+++ b/dom/tests/mochitest/crypto/test_legacy.html
@@ -12,22 +12,17 @@
 ok("crypto" in window, "crypto in window");
 ok("version" in window.crypto, "version in window.crypto");
 ok("enableSmartCardEvents" in window.crypto,
    "enableSmartCardEvents in window.crypto");
 ok("generateCRMFRequest" in window.crypto,
    "generateCRMFRequest in window.crypto");
 ok("importUserCertificates" in window.crypto,
    "importUserCertificates in window.crypto");
-ok("popChallengeResponse" in window.crypto,
-   "popChallengeResponse in window.crypto");
-ok("random" in window.crypto, "random in window.crypto");
 ok("signText" in window.crypto, "signText in window.crypto");
-ok("disableRightClick" in window.crypto,
-   "disableRightClick in window.crypto");
 
 function jsCallback () {
 }
 
 try {
   window.crypto.generateCRMFRequest(null, null, null, null, jsCallback.toString());
   ok(false, "window.crypto.generateCRMFRequest failed, should throw error");
 } catch (e) {
--- a/dom/tests/mochitest/crypto/test_no_legacy.html
+++ b/dom/tests/mochitest/crypto/test_no_legacy.html
@@ -12,17 +12,12 @@
 ok("crypto" in window, "crypto in window");
 ok(!("version" in window.crypto), "version not in window.crypto");
 ok(!("enableSmartCardEvents" in window.crypto),
    "enableSmartCardEvents not in window.crypto");
 ok(!("generateCRMFRequest" in window.crypto),
    "generateCRMFRequest not in window.crypto");
 ok(!("importUserCertificates" in window.crypto),
    "importUserCertificates not in window.crypto");
-ok(!("popChallengeResponse" in window.crypto),
-   "popChallengeResponse not in window.crypto");
-ok(!("random" in window.crypto), "random not in window.crypto");
 ok(!("signText" in window.crypto), "signText not in window.crypto");
-ok(!("disableRightClick" in window.crypto),
-   "disableRightClick not in window.crypto");
 
 </script>
 </body></html>
--- a/dom/webidl/Crypto.webidl
+++ b/dom/webidl/Crypto.webidl
@@ -34,28 +34,19 @@ interface CryptoLegacy {
                                   ByteString? jsCallback,
                                   any... args);
 
   [Throws]
   DOMString importUserCertificates(DOMString nickname,
                                    DOMString cmmfResponse,
                                    boolean doForcedBackup);
 
-  [Throws]
-  DOMString popChallengeResponse(DOMString challenge);
-
-  [Throws]
-  DOMString random(long numBytes);
-
   DOMString signText(DOMString stringToSign,
                      DOMString caOption,
                      ByteString... args);
 
   [Throws]
   void logout();
-
-  [Throws]
-  void disableRightClick();
 };
 
 Crypto implements CryptoLegacy;
 #endif // !MOZ_DISABLE_CRYPTOLEGACY
 
--- a/security/manager/ssl/src/nsCrypto.cpp
+++ b/security/manager/ssl/src/nsCrypto.cpp
@@ -2440,30 +2440,16 @@ nsCrypto::ImportUserCertificates(const n
     CMMF_DestroyCertRepContent(certRepContent);
   }
 
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
   }
 }
 
-void
-nsCrypto::PopChallengeResponse(const nsAString& aChallenge,
-                               nsAString& aReturn,
-                               ErrorResult& aRv)
-{
-  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
-}
-
-void
-nsCrypto::Random(int32_t aNumBytes, nsAString& aReturn, ErrorResult& aRv)
-{
-  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
-}
-
 static void
 GetDocumentFromContext(JSContext *cx, nsIDocument **aDocument)
 {
   // Get the script context.
   nsIScriptContext* scriptContext = GetScriptContextFromJSContext(cx);
   if (!scriptContext) {
     return;
   }
@@ -2826,22 +2812,16 @@ nsCrypto::Logout(ErrorResult& aRv)
   }
 
   rv = nssComponent->LogoutAuthenticatedPK11();
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
   }
 }
 
-void
-nsCrypto::DisableRightClick(ErrorResult& aRv)
-{
-  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
-}
-
 CRMFObject::CRMFObject()
 {
   MOZ_COUNT_CTOR(CRMFObject);
 }
 
 CRMFObject::~CRMFObject()
 {
   MOZ_COUNT_DTOR(CRMFObject);
--- a/security/manager/ssl/src/nsCrypto.h
+++ b/security/manager/ssl/src/nsCrypto.h
@@ -75,34 +75,24 @@ public:
                       mozilla::ErrorResult& aRv) MOZ_OVERRIDE;
 
   virtual void ImportUserCertificates(const nsAString& aNickname,
                                       const nsAString& aCmmfResponse,
                                       bool aDoForcedBackup,
                                       nsAString& aReturn,
                                       mozilla::ErrorResult& aRv) MOZ_OVERRIDE;
 
-  virtual void PopChallengeResponse(const nsAString& aChallenge,
-                                    nsAString& aReturn,
-                                    mozilla::ErrorResult& aRv) MOZ_OVERRIDE;
-
-  virtual void Random(int32_t aNumBytes,
-                      nsAString& aReturn,
-                      mozilla::ErrorResult& aRv) MOZ_OVERRIDE;
-
   virtual void SignText(JSContext* aContext,
                         const nsAString& aStringToSign,
                         const nsAString& aCaOption,
                         const mozilla::dom::Sequence<nsCString>& aArgs,
                         nsAString& aReturn) MOZ_OVERRIDE;
 
   virtual void Logout(mozilla::ErrorResult& aRv) MOZ_OVERRIDE;
 
-  virtual void DisableRightClick(mozilla::ErrorResult& aRv) MOZ_OVERRIDE;
-
 private:
   static already_AddRefed<nsIPrincipal> GetScriptPrincipal(JSContext *cx);
 
   bool mEnableSmartCardEvents;
 };
 #endif // MOZ_DISABLE_CRYPTOLEGACY
 
 #include "nsIPKCS11.h"