summaryrefslogtreecommitdiffstats
path: root/net/disk_cache
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-07 21:26:16 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-07 21:26:16 +0000
commitfc73431bf3ba8acbf3346a86cece20c75ad1dd11 (patch)
tree9d1d15c5307c1013116dc71172e28d43676a19d2 /net/disk_cache
parent1a23a6aefb1108f8c1192ebdc4f141a3a2e53eae (diff)
downloadchromium_src-fc73431bf3ba8acbf3346a86cece20c75ad1dd11.zip
chromium_src-fc73431bf3ba8acbf3346a86cece20c75ad1dd11.tar.gz
chromium_src-fc73431bf3ba8acbf3346a86cece20c75ad1dd11.tar.bz2
Cleanup: Remove deprecated version of file_util::AppendToPath() from net/.
BUG=24672 TEST=none Review URL: https://chromiumcodereview.appspot.com/9586001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125459 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache')
-rw-r--r--net/disk_cache/cache_util_win.cc19
1 files changed, 7 insertions, 12 deletions
diff --git a/net/disk_cache/cache_util_win.cc b/net/disk_cache/cache_util_win.cc
index 65fc064..6adc456 100644
--- a/net/disk_cache/cache_util_win.cc
+++ b/net/disk_cache/cache_util_win.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -6,7 +6,7 @@
#include <windows.h>
-#include "base/file_util.h"
+#include "base/file_path.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/win/scoped_handle.h"
@@ -14,24 +14,19 @@
namespace {
// Deletes all the files on path that match search_name pattern.
-void DeleteFiles(const wchar_t* path, const wchar_t* search_name) {
- std::wstring name(path);
- file_util::AppendToPath(&name, search_name);
+void DeleteFiles(const FilePath& path, const wchar_t* search_name) {
+ FilePath name(path.Append(search_name));
WIN32_FIND_DATA data;
- HANDLE handle = FindFirstFile(name.c_str(), &data);
+ HANDLE handle = FindFirstFile(name.value().c_str(), &data);
if (handle == INVALID_HANDLE_VALUE)
return;
- std::wstring adjusted_path(path);
- adjusted_path += L'\\';
do {
if (data.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY ||
data.dwFileAttributes == FILE_ATTRIBUTE_REPARSE_POINT)
continue;
- std::wstring current(adjusted_path);
- current += data.cFileName;
- DeleteFile(current.c_str());
+ DeleteFile(path.Append(data.cFileName).value().c_str());
} while (FindNextFile(handle, &data));
FindClose(handle);
@@ -52,7 +47,7 @@ bool MoveCache(const FilePath& from_path, const FilePath& to_path) {
}
void DeleteCache(const FilePath& path, bool remove_folder) {
- DeleteFiles(path.value().c_str(), L"*");
+ DeleteFiles(path, L"*");
if (remove_folder)
RemoveDirectory(path.value().c_str());
}