mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 541356 - session lost after restart. Part 1: Fix AddCookieToList(). r=sdwilsh
This commit is contained in:
parent
91c79aee06
commit
8ac39437d3
@ -2911,18 +2911,21 @@ nsCookieService::AddCookieToList(const nsCString &aBaseDomain,
|
||||
|
||||
// if it's a non-session cookie and hasn't just been read from the db, write it out.
|
||||
if (aWriteToDB && !aCookie->IsSession() && mDBState->dbConn) {
|
||||
nsCOMPtr<mozIStorageBindingParamsArray> array(aParamsArray);
|
||||
if (!array) {
|
||||
mDBState->stmtInsert->NewBindingParamsArray(getter_AddRefs(array));
|
||||
mozIStorageStatement *stmt = mDBState->stmtInsert;
|
||||
nsCOMPtr<mozIStorageBindingParamsArray> paramsArray(aParamsArray);
|
||||
if (!paramsArray) {
|
||||
stmt->NewBindingParamsArray(getter_AddRefs(paramsArray));
|
||||
}
|
||||
bindCookieParameters(array, aCookie);
|
||||
bindCookieParameters(paramsArray, aCookie);
|
||||
|
||||
// If we were supplied an array to store parameters, we shouldn't call
|
||||
// executeAsync - someone up the stack will do this for us.
|
||||
if (!aParamsArray) {
|
||||
nsresult rv = stmt->BindParameters(paramsArray);
|
||||
NS_ASSERT_SUCCESS(rv);
|
||||
nsCOMPtr<mozIStoragePendingStatement> handle;
|
||||
nsresult rv = mDBState->stmtInsert->ExecuteAsync(&sInsertCookieDBListener,
|
||||
getter_AddRefs(handle));
|
||||
rv = stmt->ExecuteAsync(&sInsertCookieDBListener,
|
||||
getter_AddRefs(handle));
|
||||
NS_ASSERT_SUCCESS(rv);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user