Bug 1150197 - Remove useless null checks after allocating memory with new from xpcom/threads/; r=froydnj

This commit is contained in:
Atif Iqbal 2015-04-02 14:57:46 -04:00
parent d18985cfe1
commit ce96843aa0
3 changed files with 0 additions and 15 deletions

View File

@ -28,9 +28,6 @@ nsEnvironment::Create(nsISupports* aOuter, REFNSIID aIID, void** aResult)
}
nsEnvironment* obj = new nsEnvironment();
if (!obj) {
return NS_ERROR_OUT_OF_MEMORY;
}
rv = obj->QueryInterface(aIID, aResult);
if (NS_FAILED(rv)) {

View File

@ -559,9 +559,6 @@ nsThread::DispatchInternal(nsIRunnable* aEvent, uint32_t aFlags,
nsRefPtr<nsThreadSyncDispatch> wrapper =
new nsThreadSyncDispatch(thread, aEvent);
if (!wrapper) {
return NS_ERROR_OUT_OF_MEMORY;
}
nsresult rv = PutEvent(wrapper, aTarget);
// Don't wait for the event to finish if we didn't dispatch it...
if (NS_FAILED(rv)) {
@ -639,9 +636,6 @@ nsThread::Shutdown()
// Set mShutdownContext and wake up the thread in case it is waiting for
// events to process.
nsCOMPtr<nsIRunnable> event = new nsThreadShutdownEvent(this, &context);
if (!event) {
return NS_ERROR_OUT_OF_MEMORY;
}
// XXXroc What if posting the event fails due to OOM?
PutEvent(event, nullptr);

View File

@ -304,9 +304,6 @@ nsTimerImpl::Startup()
nsTimerEvent::Init();
gThread = new TimerThread();
if (!gThread) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(gThread);
rv = gThread->InitLocks();
@ -827,9 +824,6 @@ NS_NewTimer(nsITimer** aResult, nsTimerCallbackFunc aCallback, void* aClosure,
uint32_t aDelay, uint32_t aType)
{
nsTimerImpl* timer = new nsTimerImpl();
if (!timer) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(timer);
nsresult rv = timer->InitWithFuncCallback(aCallback, aClosure,