Commit ed3cf8a2 authored by shess@chromium.org's avatar shess@chromium.org

[safe browsing] Delete temporary files on cancelled update.

If the server sends down no changes, then the update is cancelled.
Previously, this left stale temporary files in the profile.

BUG=none

Review URL: https://codereview.chromium.org/381243002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282534 0039d316-1c4b-4281-b951-d872f2087c98
parent 3050bfd9
...@@ -1182,7 +1182,13 @@ bool SafeBrowsingStoreFile::FinishUpdate( ...@@ -1182,7 +1182,13 @@ bool SafeBrowsingStoreFile::FinishUpdate(
} }
bool SafeBrowsingStoreFile::CancelUpdate() { bool SafeBrowsingStoreFile::CancelUpdate() {
return Close(); bool ret = Close();
// Delete stale staging file.
const base::FilePath new_filename = TemporaryFileForFilename(filename_);
base::DeleteFile(new_filename, false);
return ret;
} }
void SafeBrowsingStoreFile::SetAddChunk(int32 chunk_id) { void SafeBrowsingStoreFile::SetAddChunk(int32 chunk_id) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment