nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1");  if (observerService) { observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE); }  nsCOMPtr<nsIExceptionService> xs = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID);  if (xs) { xs->RegisterExceptionProvider(this, NS_ERROR_MODULE_DOM); xs->RegisterExceptionProvider(this, NS_ERROR_MODULE_DOM_RANGE); #ifdef MOZ_SVG xs->RegisterExceptionProvider(this, NS_ERROR_MODULE_SVG); #endif }
NS_INIT_REFCNT();
nsDOMScriptObjectFactory::nsDOMScriptObjectFactory(){  nsCOMPtr<nsIObserverService> observerService =    do_GetService("@mozilla.org/observer-service;1");  if (observerService) {    observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE);  }  nsCOMPtr<nsIExceptionService> xs =    do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID);  if (xs) {    xs->RegisterExceptionProvider(this, NS_ERROR_MODULE_DOM);    xs->RegisterExceptionProvider(this, NS_ERROR_MODULE_DOM_RANGE);#ifdef MOZ_SVG    xs->RegisterExceptionProvider(this, NS_ERROR_MODULE_SVG);#endif  }}