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

Unified Diff: net/disk_cache/simple/simple_util_win.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/simple/simple_util_unittest.cc ('k') | net/disk_cache/simple/simple_version_upgrade.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_util_win.cc
diff --git a/net/disk_cache/simple/simple_util_win.cc b/net/disk_cache/simple/simple_util_win.cc
deleted file mode 100644
index f2adcd04b898603b7e8d80cb8fc197f5565f8ed2..0000000000000000000000000000000000000000
--- a/net/disk_cache/simple/simple_util_win.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/disk_cache/simple/simple_util.h"
-
-#include <windows.h>
-
-#include "base/files/file_util.h"
-#include "base/format_macros.h"
-#include "base/rand_util.h"
-#include "base/strings/stringprintf.h"
-#include "net/disk_cache/cache_util.h"
-
-namespace disk_cache {
-namespace simple_util {
-
-bool SimpleCacheDeleteFile(const base::FilePath& path) {
- // Even if a file was opened with FLAG_SHARE_DELETE, it is not possible to
- // create a new file with the same name until the original file is actually
- // deleted. To allow new files to be created with the new name right away,
- // the file is renamed before it is deleted.
-
- // Why a random name? Because if the name was derived from our original name,
- // then churn on a particular cache entry could cause flakey behaviour.
-
- // TODO(gavinp): Ensure these "todelete_" files are cleaned up on periodic
- // directory sweeps.
- const base::FilePath rename_target =
- path.DirName().AppendASCII(base::StringPrintf("todelete_%016" PRIx64,
- base::RandUint64()));
-
- bool rename_succeeded = !!MoveFile(path.value().c_str(),
- rename_target.value().c_str());
- if (rename_succeeded)
- return DeleteCacheFile(rename_target);
-
- // The rename did not succeed. The fallback behaviour is to delete the file in
- // place, which might cause some flake.
- return DeleteCacheFile(path);
-}
-
-} // namespace simple_util
-} // namespace disk_cache
« no previous file with comments | « net/disk_cache/simple/simple_util_unittest.cc ('k') | net/disk_cache/simple/simple_version_upgrade.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698