mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 725597 - SafeBrowsing fails to update persistent PrefixSet on Windows. r=dcamp
This commit is contained in:
parent
1055fd4f4a
commit
1caaad7538
@ -587,7 +587,8 @@ Classifier::ApplyTableUpdates(nsTArray<TableUpdate*>* aUpdates,
|
||||
#if defined(DEBUG) && defined(PR_LOGGING)
|
||||
prefixSet->Dump();
|
||||
#endif
|
||||
prefixSet->WriteFile();
|
||||
rv = prefixSet->WriteFile();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// This will drop all the temporary storage used during the update.
|
||||
rv = store->FinishUpdate();
|
||||
|
@ -259,6 +259,13 @@ LookupCache::WriteFile()
|
||||
rv = storeFile->AppendNative(mTableName + NS_LITERAL_CSTRING(CACHE_SUFFIX));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Need to close the inputstream here *before* rewriting its file.
|
||||
// Windows will fail if we don't.
|
||||
if (mInputStream) {
|
||||
rv = mInputStream->Close();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIOutputStream> out;
|
||||
rv = NS_NewSafeLocalFileOutputStream(getter_AddRefs(out), storeFile,
|
||||
PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE);
|
||||
|
@ -43,8 +43,8 @@ function delFile(name) {
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
delFile("classifier.hashkey");
|
||||
delFile("urlclassifier3.sqlite");
|
||||
delFile("safebrowsing/classifier.hashkey");
|
||||
delFile("safebrowsing/test-phish-simple.sbstore");
|
||||
delFile("safebrowsing/test-malware-simple.sbstore");
|
||||
delFile("safebrowsing/test-phish-simple.cache");
|
||||
|
Loading…
Reference in New Issue
Block a user