Bug 734847 part 2 - treewide changes resulting from the default-infallibility of hashtables; either remove useless result checks, or use the fallible version of APIs, depending on context, r=jlebar

This commit is contained in:
Benjamin Smedberg
2012-05-18 13:30:49 -04:00
parent e14bd0e946
commit 2b55dddfca
107 changed files with 322 additions and 714 deletions

View File

@@ -877,8 +877,7 @@ nsDocShell::Init()
rv = mContentListener->Init();
NS_ENSURE_SUCCESS(rv, rv);
if (!mStorages.Init())
return NS_ERROR_OUT_OF_MEMORY;
mStorages.Init();
// We want to hold a strong ref to the loadgroup, so it better hold a weak
// ref to us... use an InterfaceRequestorProxy to do this.
@@ -2442,8 +2441,7 @@ nsDocShell::GetSessionStorageForPrincipal(nsIPrincipal* aPrincipal,
if (NS_FAILED(rv))
return rv;
if (!mStorages.Put(origin, newstorage))
return NS_ERROR_OUT_OF_MEMORY;
mStorages.Put(origin, newstorage);
newstorage.swap(*aStorage);
#if defined(PR_LOGGING) && defined(DEBUG)
@@ -2580,8 +2578,7 @@ nsDocShell::AddSessionStorage(nsIPrincipal* aPrincipal,
("nsDocShell[%p]: was added a sessionStorage %p",
this, aStorage));
#endif
if (!mStorages.Put(origin, aStorage))
return NS_ERROR_OUT_OF_MEMORY;
mStorages.Put(origin, aStorage);
}
else {
return topDocShell->AddSessionStorage(aPrincipal, aStorage);