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

Side by Side Diff: webkit/fileapi/native_file_util.cc

Issue 10855002: Change the type of file_type parameter to int, as the parameter actually takes or-ed bitmasks, (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
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 "webkit/fileapi/native_file_util.h" 5 #include "webkit/fileapi/native_file_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 21 matching lines...) Expand all
32 // Keep the directory permissions unchanged on non-Chrome OS platforms. 32 // Keep the directory permissions unchanged on non-Chrome OS platforms.
33 return true; 33 return true;
34 } 34 }
35 35
36 } // namespace 36 } // namespace
37 37
38 class NativeFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator { 38 class NativeFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator {
39 public: 39 public:
40 NativeFileEnumerator(const FilePath& root_path, 40 NativeFileEnumerator(const FilePath& root_path,
41 bool recursive, 41 bool recursive,
42 file_util::FileEnumerator::FileType file_type) 42 int file_type)
43 : file_enum_(root_path, recursive, file_type) { 43 : file_enum_(root_path, recursive, file_type) {
44 #if defined(OS_WIN) 44 #if defined(OS_WIN)
45 memset(&file_util_info_, 0, sizeof(file_util_info_)); 45 memset(&file_util_info_, 0, sizeof(file_util_info_));
46 #endif // defined(OS_WIN) 46 #endif // defined(OS_WIN)
47 } 47 }
48 48
49 ~NativeFileEnumerator() {} 49 ~NativeFileEnumerator() {}
50 50
51 virtual FilePath Next() OVERRIDE; 51 virtual FilePath Next() OVERRIDE;
52 virtual int64 Size() OVERRIDE; 52 virtual int64 Size() OVERRIDE;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 return base::PLATFORM_FILE_ERROR_NOT_FOUND; 152 return base::PLATFORM_FILE_ERROR_NOT_FOUND;
153 if (!file_util::GetFileInfo(path, file_info)) 153 if (!file_util::GetFileInfo(path, file_info))
154 return base::PLATFORM_FILE_ERROR_FAILED; 154 return base::PLATFORM_FILE_ERROR_FAILED;
155 return base::PLATFORM_FILE_OK; 155 return base::PLATFORM_FILE_OK;
156 } 156 }
157 157
158 FileSystemFileUtil::AbstractFileEnumerator* 158 FileSystemFileUtil::AbstractFileEnumerator*
159 NativeFileUtil::CreateFileEnumerator(const FilePath& root_path, 159 NativeFileUtil::CreateFileEnumerator(const FilePath& root_path,
160 bool recursive) { 160 bool recursive) {
161 return new NativeFileEnumerator( 161 return new NativeFileEnumerator(
162 root_path, recursive, 162 root_path, recursive,
jar (doing other things) 2012/08/06 18:27:02 nit: push line 162 onto end of line 161.
Haruki Sato 2012/08/06 23:22:18 Done.
163 static_cast<file_util::FileEnumerator::FileType>( 163 (file_util::FileEnumerator::FILES |
164 file_util::FileEnumerator::FILES | 164 file_util::FileEnumerator::DIRECTORIES));
165 file_util::FileEnumerator::DIRECTORIES));
166 } 165 }
167 166
168 PlatformFileError NativeFileUtil::Touch( 167 PlatformFileError NativeFileUtil::Touch(
169 const FilePath& path, 168 const FilePath& path,
170 const base::Time& last_access_time, 169 const base::Time& last_access_time,
171 const base::Time& last_modified_time) { 170 const base::Time& last_modified_time) {
172 if (!file_util::TouchFile( 171 if (!file_util::TouchFile(
173 path, last_access_time, last_modified_time)) 172 path, last_access_time, last_modified_time))
174 return base::PLATFORM_FILE_ERROR_FAILED; 173 return base::PLATFORM_FILE_ERROR_FAILED;
175 return base::PLATFORM_FILE_OK; 174 return base::PLATFORM_FILE_OK;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 if (!file_util::IsDirectoryEmpty(path)) { 240 if (!file_util::IsDirectoryEmpty(path)) {
242 // TODO(dmikurube): Check if this error code is appropriate. 241 // TODO(dmikurube): Check if this error code is appropriate.
243 return base::PLATFORM_FILE_ERROR_NOT_EMPTY; 242 return base::PLATFORM_FILE_ERROR_NOT_EMPTY;
244 } 243 }
245 if (!file_util::Delete(path, false)) 244 if (!file_util::Delete(path, false))
246 return base::PLATFORM_FILE_ERROR_FAILED; 245 return base::PLATFORM_FILE_ERROR_FAILED;
247 return base::PLATFORM_FILE_OK; 246 return base::PLATFORM_FILE_OK;
248 } 247 }
249 248
250 } // namespace fileapi 249 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698