Bug 586789 - Incubator embedding: MozApp & MozView don't care if InitEmbedding() fails. r=mark.finkle
authorTatiana Meshkova <tanya.meshkova@gmail.com>
Tue, 17 Aug 2010 10:42:13 -0700
changeset 123 ee3722ecb5228f114c4eb8f0466748bcb5fb834f
parent 122 07985cf307db6c736b6bfbbc168f73f227cfed4b
child 124 8826f3cba2b00ee569df8b21359d63865abad6fc
push id38
push userromaxa@gmail.com
push dateWed, 18 Aug 2010 17:43:40 +0000
reviewersmark.finkle
bugs586789
Bug 586789 - Incubator embedding: MozApp & MozView don't care if InitEmbedding() fails. r=mark.finkle
common/embed.cpp
--- a/common/embed.cpp
+++ b/common/embed.cpp
@@ -81,17 +81,20 @@ using namespace std;
 #include "nsIWindowCreator2.h"
 #include "nsIWindowWatcher.h"
 
 // globals
 static nsCOMPtr<WindowCreator> sWindowCreator;
 
 MozApp::MozApp(const char* aProfilePath)
 {
-    InitEmbedding(aProfilePath);
+    nsresult rv = InitEmbedding(aProfilePath);
+    if (NS_FAILED(rv)) {
+        NS_RUNTIMEABORT("Embedding initialization failed!");
+    }
 }
 
 MozApp::~MozApp()
 {
     TermEmbedding();
 }
 
 nsresult MozApp::SetCharPref(const char *aName, const char *aValue)
@@ -258,17 +261,21 @@ WindowCreator::CreateChromeWindow2(nsIWe
                                    nsIURI * /*aUri*/, PRBool * /*aCancel*/,
                                    nsIWebBrowserChrome **_retval)
 {
     return CreateChromeWindow(aParent, aChromeFlags, _retval);
 }
 
 MozView::MozView()
 {
-    InitEmbedding();
+    nsresult rv = InitEmbedding();
+    if (NS_FAILED(rv)) {
+        NS_RUNTIMEABORT("Embedding initialization failed!");
+    }
+
     mPrivate = new Private();
 
     // TODO: should probably deal with WindowCreator in InitEmbedding
     //       or maybe in mozapp
     if (sWindowCreator)
         return;
 
     // create an nsWindowCreator and give it to the WindowWatcher service