Bug 1247548 - Changed nsCookieService::EnsureReadComplete and nsCookieService::PurgeCookeis to allocate nsTArray instead of AutoTArray. r=jdm
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -2692,17 +2692,17 @@ nsCookieService::EnsureReadComplete()
("EnsureReadComplete(): corruption detected when creating statement "
"with rv 0x%x", rv));
HandleCorruptDB(mDefaultDBState);
return;
}
nsCString baseDomain, name, value, host, path;
bool hasResult;
- AutoTArray<CookieDomainTuple, kMaxNumberOfCookies> array;
+ nsTArray<CookieDomainTuple> array(kMaxNumberOfCookies);
while (1) {
rv = stmt->ExecuteStep(&hasResult);
if (NS_FAILED(rv)) {
// Recreate the database.
COOKIE_LOGSTRING(LogLevel::Debug,
("EnsureReadComplete(): corruption detected when reading result "
"with rv 0x%x", rv));
HandleCorruptDB(mDefaultDBState);
@@ -4082,18 +4082,18 @@ nsCookieService::PurgeCookies(int64_t aC
NS_ASSERTION(mDBState->hostTable.Count() > 0, "table is empty");
EnsureReadComplete();
uint32_t initialCookieCount = mDBState->cookieCount;
COOKIE_LOGSTRING(LogLevel::Debug,
("PurgeCookies(): beginning purge with %ld cookies and %lld oldest age",
mDBState->cookieCount, aCurrentTimeInUsec - mDBState->cookieOldestTime));
- typedef AutoTArray<nsListIter, kMaxNumberOfCookies> PurgeList;
- PurgeList purgeList;
+ typedef nsTArray<nsListIter> PurgeList;
+ PurgeList purgeList(kMaxNumberOfCookies);
nsCOMPtr<nsIMutableArray> removedList = do_CreateInstance(NS_ARRAY_CONTRACTID);
// Create a params array to batch the removals. This is OK here because
// all the removals are in order, and there are no interleaved additions.
mozIStorageAsyncStatement *stmt = mDBState->stmtDelete;
nsCOMPtr<mozIStorageBindingParamsArray> paramsArray;
if (mDBState->dbConn) {