1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/base/public/nsINSSErrorsService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 + 1.12 +[scriptable, uuid(3a5c7a0f-f5da-4a8b-a748-d7c5a528f33b)] 1.13 +interface nsINSSErrorsService : nsISupports 1.14 +{ 1.15 + /** 1.16 + * @param aNSPRCode An error code obtained using PR_GetError() 1.17 + * @return True if it is error code defined by the NSS library 1.18 + */ 1.19 + boolean isNSSErrorCode(in int32_t aNSPRCode); 1.20 + 1.21 + /** 1.22 + * Function will fail if aNSPRCode is not an NSS error code. 1.23 + * @param aNSPRCode An error code obtained using PR_GetError() 1.24 + * @return The result of the conversion, an XPCOM error code 1.25 + */ 1.26 + nsresult getXPCOMFromNSSError(in int32_t aNSPRCode); 1.27 + 1.28 + /** 1.29 + * Function will fail if aXPCOMErrorCode is not an NSS error code. 1.30 + * @param aXPCOMErrorCode An error code obtain using getXPCOMFromNSSError 1.31 + * return A localized human readable error explanation. 1.32 + */ 1.33 + AString getErrorMessage(in nsresult aXPCOMErrorCode); 1.34 + 1.35 + /** 1.36 + * Function will fail if aXPCOMErrorCode is not an NSS error code. 1.37 + * @param aXPCOMErrorCode An error code obtain using getXPCOMFromNSSError 1.38 + * return the 1.39 + */ 1.40 + uint32_t getErrorClass(in nsresult aXPCOMErrorCode); 1.41 + 1.42 + const unsigned long ERROR_CLASS_SSL_PROTOCOL = 1; 1.43 + const unsigned long ERROR_CLASS_BAD_CERT = 2; 1.44 + 1.45 + /** 1.46 + * The following values define the range of NSPR error codes used by NSS. 1.47 + * NSS remains the authorative source for these numbers, as a result, 1.48 + * the values might change in the future. 1.49 + * The security module will perform a runtime check and assertion 1.50 + * to ensure the values are in synch with NSS. 1.51 + */ 1.52 + const long NSS_SEC_ERROR_BASE = -(0x2000); 1.53 + const long NSS_SEC_ERROR_LIMIT = (NSS_SEC_ERROR_BASE + 1000); 1.54 + const long NSS_SSL_ERROR_BASE = -(0x3000); 1.55 + const long NSS_SSL_ERROR_LIMIT = (NSS_SSL_ERROR_BASE + 1000); 1.56 +};