| 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.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "base/scoped_callback_factory.h" | 10 #include "base/scoped_callback_factory.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 DCHECK(file_system_); | 66 DCHECK(file_system_); |
| 67 WebFileInfo web_file_info; | 67 WebFileInfo web_file_info; |
| 68 web_file_info.length = info.size; | 68 web_file_info.length = info.size; |
| 69 web_file_info.modificationTime = info.last_modified.ToDoubleT(); | 69 web_file_info.modificationTime = info.last_modified.ToDoubleT(); |
| 70 web_file_info.type = info.is_directory ? | 70 web_file_info.type = info.is_directory ? |
| 71 WebFileInfo::TypeDirectory : WebFileInfo::TypeFile; | 71 WebFileInfo::TypeDirectory : WebFileInfo::TypeFile; |
| 72 callbacks_->didReadMetadata(web_file_info); | 72 callbacks_->didReadMetadata(web_file_info); |
| 73 } | 73 } |
| 74 | 74 |
| 75 virtual void DidReadDirectory( | 75 virtual void DidReadDirectory( |
| 76 const std::vector<base::FileUtilProxy::Entry>& entries, | 76 const std::vector<base::FileUtilProxyBase::Entry>& entries, |
| 77 bool has_more) { | 77 bool has_more) { |
| 78 DCHECK(file_system_); | 78 DCHECK(file_system_); |
| 79 std::vector<WebFileSystemEntry> web_entries_vector; | 79 std::vector<WebFileSystemEntry> web_entries_vector; |
| 80 for (std::vector<base::FileUtilProxy::Entry>::const_iterator it = | 80 for (std::vector<base::FileUtilProxyBase::Entry>::const_iterator it = |
| 81 entries.begin(); it != entries.end(); ++it) { | 81 entries.begin(); it != entries.end(); ++it) { |
| 82 WebFileSystemEntry entry; | 82 WebFileSystemEntry entry; |
| 83 entry.name = webkit_glue::FilePathStringToWebString(it->name); | 83 entry.name = webkit_glue::FilePathStringToWebString(it->name); |
| 84 entry.isDirectory = it->is_directory; | 84 entry.isDirectory = it->is_directory; |
| 85 web_entries_vector.push_back(entry); | 85 web_entries_vector.push_back(entry); |
| 86 } | 86 } |
| 87 WebVector<WebKit::WebFileSystemEntry> web_entries = | 87 WebVector<WebKit::WebFileSystemEntry> web_entries = |
| 88 web_entries_vector; | 88 web_entries_vector; |
| 89 callbacks_->didReadDirectory(web_entries, has_more); | 89 callbacks_->didReadDirectory(web_entries, has_more); |
| 90 } | 90 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 SandboxedFileSystemOperation* SimpleFileSystem::GetNewOperation( | 241 SandboxedFileSystemOperation* SimpleFileSystem::GetNewOperation( |
| 242 WebFileSystemCallbacks* callbacks) { | 242 WebFileSystemCallbacks* callbacks) { |
| 243 SimpleFileSystemCallbackDispatcher* dispatcher = | 243 SimpleFileSystemCallbackDispatcher* dispatcher = |
| 244 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); | 244 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); |
| 245 SandboxedFileSystemOperation* operation = new SandboxedFileSystemOperation( | 245 SandboxedFileSystemOperation* operation = new SandboxedFileSystemOperation( |
| 246 dispatcher, base::MessageLoopProxy::CreateForCurrentThread(), | 246 dispatcher, base::MessageLoopProxy::CreateForCurrentThread(), |
| 247 sandboxed_context_.get()); | 247 sandboxed_context_.get()); |
| 248 return operation; | 248 return operation; |
| 249 } | 249 } |
| OLD | NEW |