mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 709205 - use GetObserverService in xpcom; r=dougt
This commit is contained in:
parent
40b05d36da
commit
79815ed55a
@ -1192,8 +1192,7 @@ public:
|
||||
}
|
||||
|
||||
NS_IMETHOD Run() {
|
||||
nsCOMPtr<nsIObserverService> obs =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||
if (obs) {
|
||||
obs->NotifyObservers(nsnull, "cycle-collector-fault",
|
||||
mReport.get());
|
||||
|
@ -36,6 +36,7 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsIObserverService.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
|
||||
#include "nsXPCOMCID.h"
|
||||
@ -88,7 +89,7 @@ nsCategoryObserver::nsCategoryObserver(const char* aCategory,
|
||||
|
||||
// Now, listen for changes
|
||||
nsCOMPtr<nsIObserverService> serv =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
mozilla::services::GetObserverService();
|
||||
if (serv) {
|
||||
serv->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
|
||||
serv->AddObserver(this, NS_XPCOM_CATEGORY_ENTRY_ADDED_OBSERVER_ID, false);
|
||||
@ -118,7 +119,7 @@ nsCategoryObserver::RemoveObservers() {
|
||||
|
||||
mObserversRemoved = true;
|
||||
nsCOMPtr<nsIObserverService> obsSvc =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
mozilla::services::GetObserverService();
|
||||
if (obsSvc) {
|
||||
obsSvc->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
|
||||
obsSvc->RemoveObserver(this, NS_XPCOM_CATEGORY_ENTRY_ADDED_OBSERVER_ID);
|
||||
|
Loading…
Reference in New Issue
Block a user