sprinkle some asserts, and remove redundant #include.

This commit is contained in:
dwitte%stanford.edu 2004-07-19 23:38:35 +00:00
parent 7f24d7f4e8
commit bdf2a2307d
3 changed files with 3 additions and 1 deletions

View File

@ -935,6 +935,7 @@ nsPermissionManager::Write()
// All went ok. Maybe except for problems in Write(), but the stream detects
// that for us
nsCOMPtr<nsISafeOutputStream> safeStream = do_QueryInterface(bufferedOutputStream);
NS_ASSERTION(safeStream, "expected a safe output stream!");
if (safeStream) {
rv = safeStream->Finish();
if (NS_FAILED(rv)) {

View File

@ -45,7 +45,6 @@
#include "nsNetUtil.h"
#include "nsIFile.h"
#include "nsILocalFile.h"
#include "nsISafeOutputStream.h"
#include "nsIObserverService.h"
#include "nsPrefBranch.h"
#include "nsXPIDLString.h"
@ -530,6 +529,7 @@ nsresult nsPrefService::WritePrefFile(nsIFile* aFile)
// tell the safe output stream to overwrite the real prefs file
// (it'll abort if there were any errors during writing)
nsCOMPtr<nsISafeOutputStream> safeStream = do_QueryInterface(outStream);
NS_ASSERTION(safeStream, "expected a safe output stream!");
if (safeStream) {
rv = safeStream->Finish();
if (NS_FAILED(rv)) {

View File

@ -1115,6 +1115,7 @@ nsCookieService::Write()
// All went ok. Maybe except for problems in Write(), but the stream detects
// that for us
nsCOMPtr<nsISafeOutputStream> safeStream = do_QueryInterface(bufferedOutputStream);
NS_ASSERTION(safeStream, "expected a safe output stream!");
if (safeStream) {
rv = safeStream->Finish();
if (NS_FAILED(rv)) {