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

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

Issue 16950028: Move file_util::Delete to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/simple/simple_index_file.cc ('k') | net/http/http_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/disk_cache/simple/simple_synchronous_entry.h" 5 #include "net/disk_cache/simple/simple_synchronous_entry.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 #include <functional> 9 #include <functional>
10 #include <limits> 10 #include <limits>
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 // TODO(gavinp): Move this function to its correct location in this .cc file. 181 // TODO(gavinp): Move this function to its correct location in this .cc file.
182 // static 182 // static
183 bool SimpleSynchronousEntry::DeleteFilesForEntryHash( 183 bool SimpleSynchronousEntry::DeleteFilesForEntryHash(
184 const FilePath& path, 184 const FilePath& path,
185 const uint64 entry_hash) { 185 const uint64 entry_hash) {
186 bool result = true; 186 bool result = true;
187 for (int i = 0; i < kSimpleEntryFileCount; ++i) { 187 for (int i = 0; i < kSimpleEntryFileCount; ++i) {
188 FilePath to_delete = path.AppendASCII( 188 FilePath to_delete = path.AppendASCII(
189 GetFilenameFromEntryHashAndIndex(entry_hash, i)); 189 GetFilenameFromEntryHashAndIndex(entry_hash, i));
190 if (!file_util::Delete(to_delete, false)) { 190 if (!base::Delete(to_delete, false)) {
191 result = false; 191 result = false;
192 DLOG(ERROR) << "Could not delete " << to_delete.MaybeAsASCII(); 192 DLOG(ERROR) << "Could not delete " << to_delete.MaybeAsASCII();
193 } 193 }
194 } 194 }
195 return result; 195 return result;
196 } 196 }
197 197
198 // static 198 // static
199 void SimpleSynchronousEntry::DoomEntry( 199 void SimpleSynchronousEntry::DoomEntry(
200 const FilePath& path, 200 const FilePath& path,
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 initialized_ = true; 554 initialized_ = true;
555 return net::OK; 555 return net::OK;
556 } 556 }
557 557
558 void SimpleSynchronousEntry::Doom() { 558 void SimpleSynchronousEntry::Doom() {
559 // TODO(gavinp): Consider if we should guard against redundant Doom() calls. 559 // TODO(gavinp): Consider if we should guard against redundant Doom() calls.
560 DeleteFilesForEntryHash(path_, entry_hash_); 560 DeleteFilesForEntryHash(path_, entry_hash_);
561 } 561 }
562 562
563 } // namespace disk_cache 563 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_index_file.cc ('k') | net/http/http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698