| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "third_party/WebKit/WebKit/chromium/public/WebFileInfo.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebFileInfo.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 WebFileInfo web_file_info; | 66 WebFileInfo web_file_info; |
| 67 web_file_info.length = info.size; | 67 web_file_info.length = info.size; |
| 68 web_file_info.modificationTime = info.last_modified.ToDoubleT(); | 68 web_file_info.modificationTime = info.last_modified.ToDoubleT(); |
| 69 web_file_info.type = info.is_directory ? | 69 web_file_info.type = info.is_directory ? |
| 70 WebFileInfo::TypeDirectory : WebFileInfo::TypeFile; | 70 WebFileInfo::TypeDirectory : WebFileInfo::TypeFile; |
| 71 callbacks_->didReadMetadata(web_file_info); | 71 callbacks_->didReadMetadata(web_file_info); |
| 72 file_system_->RemoveCompletedOperation(request_id_); | 72 file_system_->RemoveCompletedOperation(request_id_); |
| 73 } | 73 } |
| 74 | 74 |
| 75 virtual void DidReadDirectory( | 75 virtual void DidReadDirectory( |
| 76 const std::vector<base::file_util_proxy::Entry>& entries, | 76 const std::vector<base::FileUtilProxy::Entry>& entries, |
| 77 bool has_more) { | 77 bool has_more) { |
| 78 std::vector<WebFileSystemEntry> web_entries_vector; | 78 std::vector<WebFileSystemEntry> web_entries_vector; |
| 79 for (std::vector<base::file_util_proxy::Entry>::const_iterator it = | 79 for (std::vector<base::FileUtilProxy::Entry>::const_iterator it = |
| 80 entries.begin(); it != entries.end(); ++it) { | 80 entries.begin(); it != entries.end(); ++it) { |
| 81 WebFileSystemEntry entry; | 81 WebFileSystemEntry entry; |
| 82 entry.name = webkit_glue::FilePathStringToWebString(it->name); | 82 entry.name = webkit_glue::FilePathStringToWebString(it->name); |
| 83 entry.isDirectory = it->is_directory; | 83 entry.isDirectory = it->is_directory; |
| 84 web_entries_vector.push_back(entry); | 84 web_entries_vector.push_back(entry); |
| 85 } | 85 } |
| 86 WebVector<WebKit::WebFileSystemEntry> web_entries = | 86 WebVector<WebKit::WebFileSystemEntry> web_entries = |
| 87 web_entries_vector; | 87 web_entries_vector; |
| 88 callbacks_->didReadDirectory(web_entries, has_more); | 88 callbacks_->didReadDirectory(web_entries, has_more); |
| 89 file_system_->RemoveCompletedOperation(request_id_); | 89 file_system_->RemoveCompletedOperation(request_id_); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 fileapi::FileSystemOperation* operation = new fileapi::FileSystemOperation( | 204 fileapi::FileSystemOperation* operation = new fileapi::FileSystemOperation( |
| 205 dispatcher, base::MessageLoopProxy::CreateForCurrentThread()); | 205 dispatcher, base::MessageLoopProxy::CreateForCurrentThread()); |
| 206 int32 request_id = operations_.Add(operation); | 206 int32 request_id = operations_.Add(operation); |
| 207 dispatcher->set_request_id(request_id); | 207 dispatcher->set_request_id(request_id); |
| 208 return operation; | 208 return operation; |
| 209 } | 209 } |
| 210 | 210 |
| 211 void SimpleFileSystem::RemoveCompletedOperation(int request_id) { | 211 void SimpleFileSystem::RemoveCompletedOperation(int request_id) { |
| 212 operations_.Remove(request_id); | 212 operations_.Remove(request_id); |
| 213 } | 213 } |
| OLD | NEW |