Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1047)

Side by Side Diff: net/disk_cache/simple/simple_util_win.cc

Issue 651063002: Deflake Simple Cache backend on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add index file Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/disk_cache/simple/simple_util.h"
6
7 #include <windows.h>
8
9 #include "base/files/file_util.h"
10 #include "base/format_macros.h"
11 #include "base/rand_util.h"
12 #include "base/strings/stringprintf.h"
13 #include "net/disk_cache/cache_util.h"
14
15 namespace disk_cache {
16 namespace simple_util {
17
18 bool SimpleCacheDeleteFile(const base::FilePath& path) {
mmenke 2014/10/28 20:07:43 Per offline discussion, this could be a little cle
19 const base::FilePath rename_target =
20 path.DirName().AppendASCII(base::StringPrintf("todelete_%016" PRIx64,
21 base::RandUint64()));
22
23 const base::FilePath to_delete_file =
24 MoveFile(path.value().c_str(), rename_target.value().c_str()) ?
25 rename_target : path;
26
27 return DeleteCacheFile(to_delete_file);
28 }
29
30 } // namespace simple_util
31 } // namespace disk_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698