| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/local_file_system_file_util.h" | 5 #include "webkit/fileapi/local_file_system_file_util.h" |
| 6 | 6 |
| 7 #include "base/file_util_proxy.h" | 7 #include "base/file_util_proxy.h" |
| 8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 9 #include "webkit/fileapi/file_system_context.h" | 9 #include "webkit/fileapi/file_system_context.h" |
| 10 #include "webkit/fileapi/file_system_operation_context.h" | 10 #include "webkit/fileapi/file_system_operation_context.h" |
| 11 #include "webkit/fileapi/file_system_path_manager.h" | 11 #include "webkit/fileapi/file_system_path_manager.h" |
| 12 #include "webkit/fileapi/file_system_types.h" | 12 #include "webkit/fileapi/file_system_types.h" |
| 13 #include "webkit/fileapi/file_system_util.h" | 13 #include "webkit/fileapi/file_system_util.h" |
| 14 | 14 |
| 15 namespace fileapi { | 15 namespace fileapi { |
| 16 | 16 |
| 17 LocalFileSystemFileUtil::LocalFileSystemFileUtil( | 17 LocalFileSystemFileUtil::LocalFileSystemFileUtil( |
| 18 FileSystemFileUtil* underlying_file_util) | 18 FileSystemFileUtil* underlying_file_util) |
| 19 : underlying_file_util_(underlying_file_util) { | 19 : underlying_file_util_(underlying_file_util) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 LocalFileSystemFileUtil::~LocalFileSystemFileUtil() { |
| 23 } |
| 24 |
| 22 PlatformFileError LocalFileSystemFileUtil::CreateOrOpen( | 25 PlatformFileError LocalFileSystemFileUtil::CreateOrOpen( |
| 23 FileSystemOperationContext* context, | 26 FileSystemOperationContext* context, |
| 24 const FilePath& file_path, int file_flags, | 27 const FilePath& file_path, int file_flags, |
| 25 PlatformFile* file_handle, bool* created) { | 28 PlatformFile* file_handle, bool* created) { |
| 26 FilePath local_path = | 29 FilePath local_path = |
| 27 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 30 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
| 28 file_path); | 31 file_path); |
| 29 if (local_path.empty()) | 32 if (local_path.empty()) |
| 30 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | 33 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
| 31 return underlying_file_util_->CreateOrOpen( | 34 return underlying_file_util_->CreateOrOpen( |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 const FilePath& virtual_path) { | 289 const FilePath& virtual_path) { |
| 287 FilePath root = context->file_system_context()->path_manager()-> | 290 FilePath root = context->file_system_context()->path_manager()-> |
| 288 ValidateFileSystemRootAndGetPathOnFileThread(origin_url, type, | 291 ValidateFileSystemRootAndGetPathOnFileThread(origin_url, type, |
| 289 virtual_path, false); | 292 virtual_path, false); |
| 290 if (root.empty()) | 293 if (root.empty()) |
| 291 return FilePath(); | 294 return FilePath(); |
| 292 return root.Append(virtual_path); | 295 return root.Append(virtual_path); |
| 293 } | 296 } |
| 294 | 297 |
| 295 } // namespace fileapi | 298 } // namespace fileapi |
| OLD | NEW |