if i'm reading the old comment within DeleteCacheFile correctly, it sounds like you are certain that the cache has an open handle to the file at the moment you want to delete it. if this is the case, then perhaps there's an even better way to delete the file.
since windows deletes files when the last handle is closed, you can effectively delete and undelete a file as much as you want while you have an open handle to it. once you mark a file for deletion via an open handle, no other process can open it. when the last handle to a file marked for deletion is closed, the file is deleted. knowing this, you can use base::File::FLAG_CAN_DELETE_ON_CLOSE when you open a file and then use base::File::DeleteOnClose(true) to cause the file to be deleted when you close your handle. base/files/file.h has some commentary about this on the base::File::DeleteOnClose() method.
another thing to consider is what behavior you want in case of abnormal process termination while a file is open in the cache. should the file stay there or be deleted? if the latter, you can use base::File::FLAG_CAN_DELETE_ON_CLOSE when you open the file, call DeleteOnClose(true) immediately thereafter, and then do nothing other than close the handle if you wish to delete the file after use. when you reach the point in processing where you want the file to persist, call DeleteOnClose(false). now the file will stay there after being closed but will not if the process terminates before reaching that point.
let me know if this isn't clear. it's a bit non-intuitive.