NSSErrorsService.h (1427B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef NSSErrorsService_h 6 #define NSSErrorsService_h 7 8 #include "nsCOMPtr.h" 9 #include "nsILineInputStream.h" 10 #include "nsINSSErrorsService.h" 11 #include "nsISafeOutputStream.h" 12 #include "nsIStringBundle.h" 13 #include "prerror.h" 14 15 class nsIStringBundle; 16 17 namespace mozilla { 18 namespace psm { 19 20 class NSSErrorsService final : public nsINSSErrorsService { 21 NS_DECL_ISUPPORTS 22 NS_DECL_NSINSSERRORSSERVICE 23 24 public: 25 nsresult Init(); 26 27 private: 28 // For XPCOM implementations that are not a base class for some other 29 // class, it is good practice to make the destructor non-virtual and 30 // private. Then the only way to delete the object is via Release. 31 #ifdef _MSC_VER 32 // C4265: Class has virtual members but destructor is not virtual 33 __pragma(warning(disable : 4265)) 34 #endif 35 ~NSSErrorsService(); 36 37 nsCOMPtr<nsIStringBundle> mPIPNSSBundle; 38 nsCOMPtr<nsIStringBundle> mNSSErrorsBundle; 39 }; 40 41 bool IsNSSErrorCode(PRErrorCode code); 42 nsresult GetXPCOMFromNSSError(PRErrorCode code); 43 bool ErrorIsOverridable(PRErrorCode code); 44 45 } // namespace psm 46 } // namespace mozilla 47 48 #define NS_NSSERRORSSERVICE_CID \ 49 {0x9ef18451, 0xa157, 0x4d17, {0x81, 0x32, 0x47, 0xaf, 0xef, 0x21, 0x36, 0x89}} 50 51 #endif // NSSErrorsService_h