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

Side by Side Diff: base/memory/shared_memory_posix.cc

Issue 18584011: Rename base::Delete to base::DeleteFile (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 | « base/json/json_value_serializer_unittest.cc ('k') | base/prefs/json_pref_store_unittest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/memory/shared_memory.h" 5 #include "base/memory/shared_memory.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <sys/mman.h> 9 #include <sys/mman.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 // Our current implementation of shmem is with mmap()ing of files. 231 // Our current implementation of shmem is with mmap()ing of files.
232 // These files need to be deleted explicitly. 232 // These files need to be deleted explicitly.
233 // In practice this call is only needed for unit tests. 233 // In practice this call is only needed for unit tests.
234 bool SharedMemory::Delete(const std::string& name) { 234 bool SharedMemory::Delete(const std::string& name) {
235 FilePath path; 235 FilePath path;
236 if (!FilePathForMemoryName(name, &path)) 236 if (!FilePathForMemoryName(name, &path))
237 return false; 237 return false;
238 238
239 if (PathExists(path)) 239 if (PathExists(path))
240 return base::Delete(path, false); 240 return base::DeleteFile(path, false);
241 241
242 // Doesn't exist, so success. 242 // Doesn't exist, so success.
243 return true; 243 return true;
244 } 244 }
245 245
246 bool SharedMemory::Open(const std::string& name, bool read_only) { 246 bool SharedMemory::Open(const std::string& name, bool read_only) {
247 FilePath path; 247 FilePath path;
248 if (!FilePathForMemoryName(name, &path)) 248 if (!FilePathForMemoryName(name, &path))
249 return false; 249 return false;
250 250
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 new_handle->fd = new_fd; 414 new_handle->fd = new_fd;
415 new_handle->auto_close = true; 415 new_handle->auto_close = true;
416 416
417 if (close_self) 417 if (close_self)
418 Close(); 418 Close();
419 419
420 return true; 420 return true;
421 } 421 }
422 422
423 } // namespace base 423 } // namespace base
OLDNEW
« no previous file with comments | « base/json/json_value_serializer_unittest.cc ('k') | base/prefs/json_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698