| 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/tools/test_shell/simple_file_system.h" | 5 #include "webkit/tools/test_shell/simple_file_system.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 webkit_base::FilePathToWebString(platform_path); | 336 webkit_base::FilePathToWebString(platform_path); |
| 337 callbacks->didReadMetadata(web_file_info); | 337 callbacks->didReadMetadata(web_file_info); |
| 338 } else { | 338 } else { |
| 339 callbacks->didFail(fileapi::PlatformFileErrorToWebFileError(result)); | 339 callbacks->didFail(fileapi::PlatformFileErrorToWebFileError(result)); |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 | 342 |
| 343 void SimpleFileSystem::DidReadDirectory( | 343 void SimpleFileSystem::DidReadDirectory( |
| 344 WebFileSystemCallbacks* callbacks, | 344 WebFileSystemCallbacks* callbacks, |
| 345 base::PlatformFileError result, | 345 base::PlatformFileError result, |
| 346 const std::vector<base::FileUtilProxy::Entry>& entries, | 346 const std::vector<FileSystemOperation::Entry>& entries, |
| 347 bool has_more) { | 347 bool has_more) { |
| 348 if (result == base::PLATFORM_FILE_OK) { | 348 if (result == base::PLATFORM_FILE_OK) { |
| 349 std::vector<WebFileSystemEntry> web_entries_vector; | 349 std::vector<WebFileSystemEntry> web_entries_vector; |
| 350 for (std::vector<base::FileUtilProxy::Entry>::const_iterator it = | 350 for (std::vector<FileSystemOperation::Entry>::const_iterator it = |
| 351 entries.begin(); it != entries.end(); ++it) { | 351 entries.begin(); it != entries.end(); ++it) { |
| 352 WebFileSystemEntry entry; | 352 WebFileSystemEntry entry; |
| 353 entry.name = webkit_base::FilePathStringToWebString(it->name); | 353 entry.name = webkit_base::FilePathStringToWebString(it->name); |
| 354 entry.isDirectory = it->is_directory; | 354 entry.isDirectory = it->is_directory; |
| 355 web_entries_vector.push_back(entry); | 355 web_entries_vector.push_back(entry); |
| 356 } | 356 } |
| 357 WebVector<WebKit::WebFileSystemEntry> web_entries = web_entries_vector; | 357 WebVector<WebKit::WebFileSystemEntry> web_entries = web_entries_vector; |
| 358 callbacks->didReadDirectory(web_entries, has_more); | 358 callbacks->didReadDirectory(web_entries, has_more); |
| 359 } else { | 359 } else { |
| 360 callbacks->didFail(fileapi::PlatformFileErrorToWebFileError(result)); | 360 callbacks->didFail(fileapi::PlatformFileErrorToWebFileError(result)); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 web_file_info.modificationTime = info.last_modified.ToDoubleT(); | 396 web_file_info.modificationTime = info.last_modified.ToDoubleT(); |
| 397 web_file_info.type = info.is_directory ? | 397 web_file_info.type = info.is_directory ? |
| 398 WebFileInfo::TypeDirectory : WebFileInfo::TypeFile; | 398 WebFileInfo::TypeDirectory : WebFileInfo::TypeFile; |
| 399 web_file_info.platformPath = | 399 web_file_info.platformPath = |
| 400 webkit_base::FilePathToWebString(platform_path); | 400 webkit_base::FilePathToWebString(platform_path); |
| 401 callbacks->didCreateSnapshotFile(web_file_info); | 401 callbacks->didCreateSnapshotFile(web_file_info); |
| 402 } else { | 402 } else { |
| 403 callbacks->didFail(fileapi::PlatformFileErrorToWebFileError(result)); | 403 callbacks->didFail(fileapi::PlatformFileErrorToWebFileError(result)); |
| 404 } | 404 } |
| 405 } | 405 } |
| OLD | NEW |