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

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

Issue 10447055: Move fileapi into its own component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 8 years, 6 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 | « webkit/fileapi/file_system_util.h ('k') | webkit/fileapi/file_util_helper.h » ('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 "webkit/fileapi/file_system_util.h" 5 #include "webkit/fileapi/file_system_util.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 242 }
243 243
244 FilePath StringToFilePath(const std::string& file_path_string) { 244 FilePath StringToFilePath(const std::string& file_path_string) {
245 #if defined(OS_WIN) 245 #if defined(OS_WIN)
246 return FilePath(UTF8ToUTF16(file_path_string)); 246 return FilePath(UTF8ToUTF16(file_path_string));
247 #elif defined(OS_POSIX) 247 #elif defined(OS_POSIX)
248 return FilePath(file_path_string); 248 return FilePath(file_path_string);
249 #endif 249 #endif
250 } 250 }
251 251
252 WebKit::WebFileError PlatformFileErrorToWebFileError(
253 base::PlatformFileError error_code) {
254 switch (error_code) {
255 case base::PLATFORM_FILE_ERROR_NOT_FOUND:
256 return WebKit::WebFileErrorNotFound;
257 case base::PLATFORM_FILE_ERROR_INVALID_OPERATION:
258 case base::PLATFORM_FILE_ERROR_EXISTS:
259 case base::PLATFORM_FILE_ERROR_NOT_EMPTY:
260 return WebKit::WebFileErrorInvalidModification;
261 case base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY:
262 case base::PLATFORM_FILE_ERROR_NOT_A_FILE:
263 return WebKit::WebFileErrorTypeMismatch;
264 case base::PLATFORM_FILE_ERROR_ACCESS_DENIED:
265 return WebKit::WebFileErrorNoModificationAllowed;
266 case base::PLATFORM_FILE_ERROR_FAILED:
267 return WebKit::WebFileErrorInvalidState;
268 case base::PLATFORM_FILE_ERROR_ABORT:
269 return WebKit::WebFileErrorAbort;
270 case base::PLATFORM_FILE_ERROR_SECURITY:
271 return WebKit::WebFileErrorSecurity;
272 case base::PLATFORM_FILE_ERROR_NO_SPACE:
273 return WebKit::WebFileErrorQuotaExceeded;
274 default:
275 return WebKit::WebFileErrorInvalidModification;
276 }
277 }
278
252 } // namespace fileapi 279 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_util.h ('k') | webkit/fileapi/file_util_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698