Bug 621366 - Content process nsDOMStorageManager observes notifications needlessly; r=honzab a=jst
authorJosh Matthews <josh@joshmatthews.net>
Sat, 25 Dec 2010 02:31:01 -0500
changeset 61792 4eb9e146d2304d06e2df85dc01d0b0eb24bb2495
parent 61791 5947cd7a6ca2af3febf77c63f8cd1d68ffa0eca8
child 61793 af87fa0a3052d6dd3ae3f5ce3d2f7b5ee64af3ef
push id18492
push usereakhgari@mozilla.com
push dateWed, 02 Feb 2011 18:57:14 +0000
treeherdermozilla-central@db765563b6fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershonzab, jst
bugs621366
milestone2.0b12pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 621366 - Content process nsDOMStorageManager observes notifications needlessly; r=honzab a=jst
dom/src/storage/nsDOMStorage.cpp
--- a/dom/src/storage/nsDOMStorage.cpp
+++ b/dom/src/storage/nsDOMStorage.cpp
@@ -266,16 +266,22 @@ nsDOMStorageManager::Initialize()
   if (!gStorageManager->mStorages.Init()) {
     delete gStorageManager;
     gStorageManager = nsnull;
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   NS_ADDREF(gStorageManager);
 
+#ifdef MOZ_IPC
+  // No observers needed in non-chrome
+  if (XRE_GetProcessType() != GeckoProcessType_Default)
+    return NS_OK;
+#endif
+
   nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
   if (!os)
     return NS_OK;
 
   os->AddObserver(gStorageManager, "cookie-changed", PR_FALSE);
   os->AddObserver(gStorageManager, "offline-app-removed", PR_FALSE);
   os->AddObserver(gStorageManager, NS_PRIVATE_BROWSING_SWITCH_TOPIC, PR_FALSE);
   os->AddObserver(gStorageManager, "profile-after-change", PR_FALSE);