mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 709205 - use GetObserverService in dom,docshell; r=bz
This commit is contained in:
parent
1e51cfc1e0
commit
749ca58a65
@ -4518,7 +4518,7 @@ nsDocShell::Create()
|
||||
Preferences::AddStrongObserver(this, "browser.xul.error_pages.enabled");
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIObserverService> serv = do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
nsCOMPtr<nsIObserverService> serv = services::GetObserverService();
|
||||
if (serv) {
|
||||
const char* msg = mItemType == typeContent ?
|
||||
NS_WEBNAVIGATION_CREATE : NS_CHROME_WEBNAVIGATION_CREATE;
|
||||
@ -4535,8 +4535,7 @@ nsDocShell::Destroy()
|
||||
"Unexpected item type in docshell");
|
||||
|
||||
if (!mIsBeingDestroyed) {
|
||||
nsCOMPtr<nsIObserverService> serv =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
nsCOMPtr<nsIObserverService> serv = services::GetObserverService();
|
||||
if (serv) {
|
||||
const char* msg = mItemType == typeContent ?
|
||||
NS_WEBNAVIGATION_DESTROY : NS_CHROME_WEBNAVIGATION_DESTROY;
|
||||
|
@ -6750,7 +6750,7 @@ nsGlobalWindow::IsInModalState()
|
||||
void
|
||||
nsGlobalWindow::NotifyDOMWindowDestroyed(nsGlobalWindow* aWindow) {
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
services::GetObserverService();
|
||||
if (observerService) {
|
||||
observerService->
|
||||
NotifyObservers(static_cast<nsIScriptGlobalObject*>(aWindow),
|
||||
@ -6799,7 +6799,7 @@ void
|
||||
nsGlobalWindow::NotifyDOMWindowFrozen(nsGlobalWindow* aWindow) {
|
||||
if (aWindow && aWindow->IsInnerWindow()) {
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
services::GetObserverService();
|
||||
if (observerService) {
|
||||
observerService->
|
||||
NotifyObservers(static_cast<nsIScriptGlobalObject*>(aWindow),
|
||||
@ -6813,7 +6813,7 @@ void
|
||||
nsGlobalWindow::NotifyDOMWindowThawed(nsGlobalWindow* aWindow) {
|
||||
if (aWindow && aWindow->IsInnerWindow()) {
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
services::GetObserverService();
|
||||
if (observerService) {
|
||||
observerService->
|
||||
NotifyObservers(static_cast<nsIScriptGlobalObject*>(aWindow),
|
||||
|
@ -55,6 +55,7 @@
|
||||
#include "nsDOMClassInfo.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "mozilla/Services.h"
|
||||
|
||||
#define NS_INTERFACE_PREFIX "nsI"
|
||||
#define NS_DOM_INTERFACE_PREFIX "nsIDOM"
|
||||
@ -448,7 +449,7 @@ nsScriptNameSpaceManager::Init()
|
||||
// Initial filling of the has table has been done.
|
||||
// Now, listen for changes.
|
||||
nsCOMPtr<nsIObserverService> serv =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
mozilla::services::GetObserverService();
|
||||
|
||||
if (serv) {
|
||||
serv->AddObserver(this, NS_XPCOM_CATEGORY_ENTRY_ADDED_OBSERVER_ID, true);
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/Services.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#define ASSERT_OWNING_THREAD() \
|
||||
@ -267,7 +268,7 @@ LazyIdleThread::ShutdownThread()
|
||||
if (mThread) {
|
||||
if (mShutdownMethod == AutomaticShutdown && NS_IsMainThread()) {
|
||||
nsCOMPtr<nsIObserverService> obs =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
mozilla::services::GetObserverService();
|
||||
NS_WARN_IF_FALSE(obs, "Failed to get observer service!");
|
||||
|
||||
if (obs &&
|
||||
|
@ -995,8 +995,7 @@ RuntimeService::Cleanup()
|
||||
Preferences::UnregisterCallback(PrefCallback, gPrefsToWatch[index], this);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIObserverService> obs =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
|
||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||
NS_WARN_IF_FALSE(obs, "Failed to get observer service?!");
|
||||
|
||||
if (obs) {
|
||||
|
Loading…
Reference in New Issue
Block a user