author | Daniel Holbert <dholbert@cs.stanford.edu> |
Fri, 03 Oct 2014 10:54:44 -0700 | |
changeset 208701 | 3bea361c1f4014e09fdcee60db8b585b104acab9 |
parent 208700 | eaa8c62e29f650fd254241f11b0862d3473230ad |
child 208702 | b1a9b31ab26e28c99b9583a31e5ea5c97f16aa68 |
push id | 49985 |
push user | dholbert@mozilla.com |
push date | Fri, 03 Oct 2014 17:55:19 +0000 |
treeherder | mozilla-inbound@3bea361c1f40 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mayhemer |
bugs | 1073711 |
milestone | 35.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
|
--- a/netwerk/cache/nsCacheService.cpp +++ b/netwerk/cache/nsCacheService.cpp @@ -1318,22 +1318,19 @@ nsCacheService::CreateSession(const char } nsresult nsCacheService::CreateSessionInternal(const char * clientID, nsCacheStoragePolicy storagePolicy, bool streamBased, nsICacheSession **result) { - if (this == nullptr) return NS_ERROR_NOT_AVAILABLE; - - nsCacheSession * session = new nsCacheSession(clientID, storagePolicy, streamBased); - if (!session) return NS_ERROR_OUT_OF_MEMORY; - - NS_ADDREF(*result = session); + nsRefPtr<nsCacheSession> session = + new nsCacheSession(clientID, storagePolicy, streamBased); + session.forget(result); return NS_OK; } nsresult nsCacheService::EvictEntriesForSession(nsCacheSession * session) {