Bug 1603703 - Part 1: Change mozIStorageAsyncConnection::CreateFunction to accept a nsCOMPtr rather than a raw pointer. r=asuth,mak

Differential Revision: https://phabricator.services.mozilla.com/D57089
This commit is contained in:
Simon Giesecke
2020-03-05 16:51:14 +00:00
parent 5ce51e1f0f
commit e09b6ec755
7 changed files with 74 additions and 89 deletions

View File

@@ -1164,7 +1164,7 @@ nsresult nsOfflineCacheDevice::InitWithSqlite(mozIStorageService* ss) {
if (!mEvictionFunction) return NS_ERROR_OUT_OF_MEMORY;
rv = mDB->CreateFunction(NS_LITERAL_CSTRING("cache_eviction_observer"), 3,
mEvictionFunction);
do_AddRef(mEvictionFunction));
NS_ENSURE_SUCCESS(rv, rv);
// create all (most) of our statements up front
@@ -2337,8 +2337,8 @@ nsresult nsOfflineCacheDevice::Evict(
nsresult rv;
nsCOMPtr<mozIStorageFunction> function1(new OriginMatch(aPattern));
rv = mDB->CreateFunction(NS_LITERAL_CSTRING("ORIGIN_MATCH"), 1, function1);
rv = mDB->CreateFunction(NS_LITERAL_CSTRING("ORIGIN_MATCH"), 1,
MakeAndAddRef<OriginMatch>(aPattern));
NS_ENSURE_SUCCESS(rv, rv);
class AutoRemoveFunc {