Bug 1252839 - Remove some if stmt after allocation with 'new' - patch 2, r=bz

This commit is contained in:
Andrea Marchesini 2016-03-02 18:51:33 +01:00
parent 554300e7bb
commit 49f343092d
5 changed files with 0 additions and 18 deletions

View File

@ -512,10 +512,6 @@ nsAppShellService::CreateWindowlessBrowser(bool aIsChrome, nsIWindowlessBrowser
* of nsIWebBrowserChrome2.
*/
RefPtr<WebBrowserChrome2Stub> stub = new WebBrowserChrome2Stub();
if (!stub) {
NS_ERROR("Couldn't create instance of WebBrowserChrome2Stub!");
return NS_ERROR_FAILURE;
}
browser->SetContainerWindow(stub);
nsCOMPtr<nsIWebNavigation> navigation = do_QueryInterface(browser);
@ -642,7 +638,6 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent,
parent = aParent;
RefPtr<nsWebShellWindow> window = new nsWebShellWindow(aChromeMask);
NS_ENSURE_TRUE(window, NS_ERROR_OUT_OF_MEMORY);
#ifdef XP_WIN
// If the parent is currently fullscreen, tell the child to ignore persisted

View File

@ -63,8 +63,6 @@ nsChromeTreeOwner::InitGlobals()
{
NS_ASSERTION(gLiterals == nullptr, "already initialized");
gLiterals = new nsChromeTreeOwnerLiterals();
if (!gLiterals)
return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;
}

View File

@ -90,8 +90,6 @@ NS_IMETHODIMP nsWindowMediator::RegisterWindow(nsIXULWindow* inWindow)
// Create window info struct and add to list of windows
nsWindowInfo* windowInfo = new nsWindowInfo(inWindow, mTimeStamp);
if (!windowInfo)
return NS_ERROR_OUT_OF_MEMORY;
WindowTitleData winData = { inWindow, nullptr };
mListeners.EnumerateForwards(notifyOpenWindow, &winData);

View File

@ -968,8 +968,6 @@ NS_IMETHODIMP nsXULWindow::EnsureChromeTreeOwner()
return NS_OK;
mChromeTreeOwner = new nsChromeTreeOwner();
NS_ENSURE_TRUE(mChromeTreeOwner, NS_ERROR_OUT_OF_MEMORY);
NS_ADDREF(mChromeTreeOwner);
mChromeTreeOwner->XULWindow(this);
@ -982,8 +980,6 @@ NS_IMETHODIMP nsXULWindow::EnsureContentTreeOwner()
return NS_OK;
mContentTreeOwner = new nsContentTreeOwner(false);
NS_ENSURE_TRUE(mContentTreeOwner, NS_ERROR_FAILURE);
NS_ADDREF(mContentTreeOwner);
mContentTreeOwner->XULWindow(this);
@ -996,8 +992,6 @@ NS_IMETHODIMP nsXULWindow::EnsurePrimaryContentTreeOwner()
return NS_OK;
mPrimaryContentTreeOwner = new nsContentTreeOwner(true);
NS_ENSURE_TRUE(mPrimaryContentTreeOwner, NS_ERROR_FAILURE);
NS_ADDREF(mPrimaryContentTreeOwner);
mPrimaryContentTreeOwner->XULWindow(this);

View File

@ -651,9 +651,6 @@ nsHTTPIndex::Create(nsIURI* aBaseURL, nsIInterfaceRequestor* aRequestor,
*aResult = nullptr;
nsHTTPIndex* result = new nsHTTPIndex(aRequestor);
if (! result)
return NS_ERROR_OUT_OF_MEMORY;
nsresult rv = result->Init(aBaseURL);
if (NS_SUCCEEDED(rv))
{