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