Small style fix
authorromashin
Sat, 19 Apr 2008 18:39:22 +0300
changeset 16817 796d65c6513c93204bbd56072dd9a44ccf88527c
parent 16816 c3a396a7a0c2f370d3de1f8dd831a700bae8a0cf
child 16818 2c69b5cd65bae00652a3be5625fee00ee2c42aef
push id1298
push userpavlov@mozilla.com
push dateSun, 17 Aug 2008 05:03:09 +0000
treeherderautoland@4a506fa751d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0a1pre
Small style fix
embedding/browser/qt/src/qgeckoglobals.cpp
--- a/embedding/browser/qt/src/qgeckoglobals.cpp
+++ b/embedding/browser/qt/src/qgeckoglobals.cpp
@@ -162,80 +162,78 @@ int   QGeckoGlobals::sNumAppComps = size
 
 void
 QGeckoGlobals::pushStartup()
 {
     // increment the number of widgets
     sWidgetCount++;
 
     // if this is the first widget, fire up xpcom
-    if (sWidgetCount == 1) {
-        nsresult rv;
-        nsCOMPtr<nsILocalFile> binDir;
-
-        if (sCompPath) {
-            rv = NS_NewNativeLocalFile(nsDependentCString(sCompPath), 1, getter_AddRefs(binDir));
-            if (NS_FAILED(rv))
-                return;
-        }
+    if (sWidgetCount != 1) return;
+    nsresult rv;
+    nsCOMPtr<nsILocalFile> binDir;
 
-        const char *grePath = sPath;
-
-        if (!grePath)
-            grePath = getenv("MOZILLA_FIVE_HOME");
-
-        if (!grePath)
-            return;
-
-        nsCOMPtr<nsILocalFile> greDir;
-        rv = NS_NewNativeLocalFile(nsDependentCString(grePath), PR_TRUE,
-                                   getter_AddRefs(greDir));
+    if (sCompPath) {
+        rv = NS_NewNativeLocalFile(nsDependentCString(sCompPath), 1, getter_AddRefs(binDir));
         if (NS_FAILED(rv))
             return;
+    }
 
-        if (sProfileDir && !sProfileLock) {
-            rv = XRE_LockProfileDirectory(sProfileDir,
-                                          &sProfileLock);
-            if (NS_FAILED(rv)) return;
-        }
+    const char *grePath = sPath;
+
+    if (!grePath)
+        grePath = getenv("MOZILLA_FIVE_HOME");
+
+    if (!grePath)
+        return;
+
+    nsCOMPtr<nsILocalFile> greDir;
+    rv = NS_NewNativeLocalFile(nsDependentCString(grePath), PR_TRUE,
+                               getter_AddRefs(greDir));
+    if (NS_FAILED(rv))
+        return;
 
-        rv = XRE_InitEmbedding(greDir, binDir,
-                               const_cast<QTEmbedDirectoryProvider*>
-                                             (&kDirectoryProvider),
-                               nsnull, nsnull);
+    if (sProfileDir && !sProfileLock) {
+        rv = XRE_LockProfileDirectory(sProfileDir,
+                                      &sProfileLock);
+        if (NS_FAILED(rv)) return;
+    }
 
-        if (NS_FAILED(rv))
-            return;
+    rv = XRE_InitEmbedding(greDir, binDir,
+                           const_cast<QTEmbedDirectoryProvider*>
+                           (&kDirectoryProvider),
+                           nsnull, nsnull);
 
-        if (sProfileDir)
-          XRE_NotifyProfile();
+    if (NS_FAILED(rv))
+        return;
 
-        rv = registerAppComponents();
-        NS_ASSERTION(NS_SUCCEEDED(rv), "Warning: Failed to register app components.\n");
-    }
+    if (sProfileDir)
+        XRE_NotifyProfile();
+
+    rv = registerAppComponents();
+    NS_ASSERTION(NS_SUCCEEDED(rv), "Warning: Failed to register app components.\n");
 }
 
 void
 QGeckoGlobals::popStartup()
 {
     sWidgetCount--;
-    if (sWidgetCount == 0) {
+    if (sWidgetCount != 0) return;
 
-        // we no longer need a reference to the DirectoryServiceProvider
-        if (sAppFileLocProvider) {
-            NS_RELEASE(sAppFileLocProvider);
-            sAppFileLocProvider = nsnull;
-        }
+    // we no longer need a reference to the DirectoryServiceProvider
+    if (sAppFileLocProvider) {
+        NS_RELEASE(sAppFileLocProvider);
+        sAppFileLocProvider = nsnull;
+    }
 
-        // shut down XPCOM/Embedding
-        XRE_TermEmbedding();
+    // shut down XPCOM/Embedding
+    XRE_TermEmbedding();
 
-        NS_IF_RELEASE(sProfileLock);
-        NS_IF_RELEASE(sProfileDir);
-    }
+    NS_IF_RELEASE(sProfileLock);
+    NS_IF_RELEASE(sProfileDir);
 }
 
 void
 QGeckoGlobals::setPath(const char *aPath)
 {
     if (sPath)
         free(sPath);
     if (aPath)