OLD | NEW |
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/local_file_util.h" | 5 #include "webkit/fileapi/local_file_util.h" |
6 | 6 |
7 #include "base/files/file_util_proxy.h" | 7 #include "base/files/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_mount_point_provider.h" | 10 #include "webkit/fileapi/file_system_mount_point_provider.h" |
11 #include "webkit/fileapi/file_system_operation_context.h" | 11 #include "webkit/fileapi/file_system_operation_context.h" |
12 #include "webkit/fileapi/file_system_types.h" | 12 #include "webkit/fileapi/file_system_types.h" |
13 #include "webkit/fileapi/file_system_url.h" | 13 #include "webkit/fileapi/file_system_url.h" |
14 #include "webkit/fileapi/file_system_util.h" | 14 #include "webkit/fileapi/file_system_util.h" |
15 #include "webkit/fileapi/native_file_util.h" | 15 #include "webkit/fileapi/native_file_util.h" |
| 16 #include <fstream> |
16 | 17 |
17 namespace fileapi { | 18 namespace fileapi { |
18 | 19 |
19 using base::PlatformFileError; | 20 using base::PlatformFileError; |
20 | 21 |
21 class LocalFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator { | 22 class LocalFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator { |
22 public: | 23 public: |
23 LocalFileEnumerator(const base::FilePath& platform_root_path, | 24 LocalFileEnumerator(const base::FilePath& platform_root_path, |
24 const base::FilePath& virtual_root_path, | 25 const base::FilePath& virtual_root_path, |
25 bool recursive, | 26 bool recursive, |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 return error; | 244 return error; |
244 return NativeFileUtil::DeleteDirectory(file_path); | 245 return NativeFileUtil::DeleteDirectory(file_path); |
245 } | 246 } |
246 | 247 |
247 base::PlatformFileError LocalFileUtil::CreateSnapshotFile( | 248 base::PlatformFileError LocalFileUtil::CreateSnapshotFile( |
248 FileSystemOperationContext* context, | 249 FileSystemOperationContext* context, |
249 const FileSystemURL& url, | 250 const FileSystemURL& url, |
250 base::PlatformFileInfo* file_info, | 251 base::PlatformFileInfo* file_info, |
251 base::FilePath* platform_path, | 252 base::FilePath* platform_path, |
252 SnapshotFilePolicy* policy) { | 253 SnapshotFilePolicy* policy) { |
| 254 LOG(WARNING) << "LocalFileUtil::CreateSnapshotFile"; |
| 255 std::ofstream mylog("/tmp/krblog", std::ios::app); |
| 256 mylog << "LocalFileUtil::CreateSnapshotFile" << std::endl;; |
253 DCHECK(policy); | 257 DCHECK(policy); |
254 DCHECK(file_info); | 258 DCHECK(file_info); |
255 // We're just returning the local file information. | 259 // We're just returning the local file information. |
256 *policy = kSnapshotFileLocal; | 260 *policy = kSnapshotFileLocal; |
257 base::PlatformFileError error = | 261 base::PlatformFileError error = |
258 GetFileInfo(context, url, file_info, platform_path); | 262 GetFileInfo(context, url, file_info, platform_path); |
259 if (error == base::PLATFORM_FILE_OK && file_info->is_directory) | 263 if (error == base::PLATFORM_FILE_OK && file_info->is_directory) |
260 return base::PLATFORM_FILE_ERROR_NOT_A_FILE; | 264 return base::PLATFORM_FILE_ERROR_NOT_A_FILE; |
261 return error; | 265 return error; |
262 } | 266 } |
263 | 267 |
264 } // namespace fileapi | 268 } // namespace fileapi |
OLD | NEW |