mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 19:41:49 +00:00
Bug 413627, nsCertOverrideService can't register observers (NS_ERROR_UNEXPECTED) intended to fix blocking1.9+ Bug 414808 Patch contributed by Ehsan Akhgari, timeless and some trivial tweaks by myself Thanks to Tomcat for help with testing r=me, a=mtschrep, blocking1.9-on-414808=beltzner
This commit is contained in:
parent
a26fbc8e54
commit
b3944fe7fb
@ -22,6 +22,7 @@
|
||||
*
|
||||
* Contributor(s):
|
||||
* Kai Engert <kengert@redhat.com>
|
||||
* Ehsan Akhgari <ehsan.akhgari@gmail.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@ -47,7 +48,9 @@
|
||||
#include "nsILineInputStream.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsPromiseFlatString.h"
|
||||
#include "nsProxiedService.h"
|
||||
#include "nsStringBuffer.h"
|
||||
#include "nsAutoLock.h"
|
||||
#include "nsAutoPtr.h"
|
||||
@ -109,9 +112,10 @@ nsCertOverride::convertStringToBits(const nsACString &str, OverrideBits &ob)
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsCertOverrideService,
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS3(nsCertOverrideService,
|
||||
nsICertOverrideService,
|
||||
nsIObserver)
|
||||
nsIObserver,
|
||||
nsISupportsWeakReference)
|
||||
|
||||
nsCertOverrideService::nsCertOverrideService()
|
||||
{
|
||||
@ -151,8 +155,10 @@ nsCertOverrideService::Init()
|
||||
|
||||
Read();
|
||||
|
||||
nsCOMPtr<nsIObserverService> mObserverService =
|
||||
do_GetService("@mozilla.org/observer-service;1");
|
||||
nsresult rv;
|
||||
NS_WITH_ALWAYS_PROXIED_SERVICE(nsIObserverService, mObserverService,
|
||||
"@mozilla.org/observer-service;1",
|
||||
NS_PROXY_TO_MAIN_THREAD, &rv);
|
||||
|
||||
if (mObserverService) {
|
||||
mObserverService->AddObserver(this, "profile-before-change", PR_TRUE);
|
||||
|
@ -22,6 +22,7 @@
|
||||
*
|
||||
* Contributor(s):
|
||||
* Kai Engert <kengert@redhat.com>
|
||||
* Ehsan Akhgari <ehsan.akhgari@gmail.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@ -47,6 +48,7 @@
|
||||
#include "nsIFile.h"
|
||||
#include "prmon.h"
|
||||
#include "secoidt.h"
|
||||
#include "nsWeakReference.h"
|
||||
|
||||
class nsCertOverride
|
||||
{
|
||||
@ -152,6 +154,7 @@ class nsCertOverrideEntry : public PLDHashEntryHdr
|
||||
|
||||
class nsCertOverrideService : public nsICertOverrideService
|
||||
, public nsIObserver
|
||||
, public nsSupportsWeakReference
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
Loading…
x
Reference in New Issue
Block a user