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

Side by Side Diff: base/files/file_util_proxy.cc

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual 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 | « base/files/file_path_watcher_win.cc ('k') | base/files/scoped_temp_dir.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/files/file_util_proxy.h" 5 #include "base/files/file_util_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 int bytes_written_; 190 int bytes_written_;
191 DISALLOW_COPY_AND_ASSIGN(WriteHelper); 191 DISALLOW_COPY_AND_ASSIGN(WriteHelper);
192 }; 192 };
193 193
194 #if !defined(OS_NACL) 194 #if !defined(OS_NACL)
195 PlatformFileError CreateOrOpenAdapter( 195 PlatformFileError CreateOrOpenAdapter(
196 const FilePath& file_path, int file_flags, 196 const FilePath& file_path, int file_flags,
197 PlatformFile* file_handle, bool* created) { 197 PlatformFile* file_handle, bool* created) {
198 DCHECK(file_handle); 198 DCHECK(file_handle);
199 DCHECK(created); 199 DCHECK(created);
200 if (!file_util::DirectoryExists(file_path.DirName())) { 200 if (!DirectoryExists(file_path.DirName())) {
201 // If its parent does not exist, should return NOT_FOUND error. 201 // If its parent does not exist, should return NOT_FOUND error.
202 return PLATFORM_FILE_ERROR_NOT_FOUND; 202 return PLATFORM_FILE_ERROR_NOT_FOUND;
203 } 203 }
204 PlatformFileError error = PLATFORM_FILE_OK; 204 PlatformFileError error = PLATFORM_FILE_OK;
205 *file_handle = CreatePlatformFile(file_path, file_flags, created, &error); 205 *file_handle = CreatePlatformFile(file_path, file_flags, created, &error);
206 return error; 206 return error;
207 } 207 }
208 #endif // !defined(OS_NACL) 208 #endif // !defined(OS_NACL)
209 209
210 PlatformFileError CloseAdapter(PlatformFile file_handle) { 210 PlatformFileError CloseAdapter(PlatformFile file_handle) {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 bool FileUtilProxy::RelayClose( 432 bool FileUtilProxy::RelayClose(
433 TaskRunner* task_runner, 433 TaskRunner* task_runner,
434 const CloseTask& close_task, 434 const CloseTask& close_task,
435 PlatformFile file_handle, 435 PlatformFile file_handle,
436 const StatusCallback& callback) { 436 const StatusCallback& callback) {
437 return base::PostTaskAndReplyWithResult( 437 return base::PostTaskAndReplyWithResult(
438 task_runner, FROM_HERE, Bind(close_task, file_handle), callback); 438 task_runner, FROM_HERE, Bind(close_task, file_handle), callback);
439 } 439 }
440 440
441 } // namespace base 441 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_path_watcher_win.cc ('k') | base/files/scoped_temp_dir.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698