Bug 878325 - Propagate exceptions out of CreateTemplateBuilder and LoadDataSources. r=bz
☠☠ backed out by 0a6f4bdb34bf ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Mon, 03 Jun 2013 11:27:41 -0700
changeset 133832 d4a39e18e5a78d5c92e188323e28c2bba79ff116
parent 133831 08a29f18500a1ef8e21187c68de482814bc029aa
child 133833 803586f0a297a46ef50dc3173defbc99b7dd1aaa
push id28918
push userbobbyholley@gmail.com
push dateMon, 03 Jun 2013 18:28:08 +0000
treeherdermozilla-inbound@803586f0a297 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs878325
milestone24.0a1
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 878325 - Propagate exceptions out of CreateTemplateBuilder and LoadDataSources. r=bz
content/xul/document/src/XULDocument.cpp
content/xul/templates/src/nsXULTemplateBuilder.cpp
--- a/content/xul/document/src/XULDocument.cpp
+++ b/content/xul/document/src/XULDocument.cpp
@@ -3866,18 +3866,20 @@ XULDocument::CreateTemplateBuilder(nsICo
     else {
         // Create and initialize a content builder.
         nsCOMPtr<nsIXULTemplateBuilder> builder
             = do_CreateInstance("@mozilla.org/xul/xul-template-builder;1");
 
         if (! builder)
             return NS_ERROR_FAILURE;
 
-        builder->Init(aElement);
-        builder->CreateContents(aElement, false);
+        nsresult rv = builder->Init(aElement);
+        NS_ENSURE_SUCCESS(rv, rv);
+        rv = builder->CreateContents(aElement, false);
+        NS_ENSURE_SUCCESS(rv, rv);
     }
 
     return NS_OK;
 }
 
 
 nsresult
 XULDocument::AddPrototypeSheets()
--- a/content/xul/templates/src/nsXULTemplateBuilder.cpp
+++ b/content/xul/templates/src/nsXULTemplateBuilder.cpp
@@ -1238,17 +1238,18 @@ nsXULTemplateBuilder::LoadDataSources(ns
     // access it.
     nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(aDocument);
     if (xuldoc)
         xuldoc->SetTemplateBuilderFor(mRoot, this);
 
     if (!mRoot->IsXUL()) {
         // Hmm. This must be an HTML element. Try to set it as a
         // JS property "by hand".
-        InitHTMLTemplateRoot();
+        rv = InitHTMLTemplateRoot();
+        NS_ENSURE_SUCCESS(rv, rv);
     }
   
     return NS_OK;
 }
   
 nsresult
 nsXULTemplateBuilder::LoadDataSourceUrls(nsIDocument* aDocument,
                                          const nsAString& aDataSources,