| 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/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/memory/scoped_callback_factory.h" | 8 #include "base/memory/scoped_callback_factory.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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 ~SimpleFileSystemCallbackDispatcher() { | 59 ~SimpleFileSystemCallbackDispatcher() { |
| 60 } | 60 } |
| 61 | 61 |
| 62 virtual void DidSucceed() { | 62 virtual void DidSucceed() { |
| 63 DCHECK(file_system_); | 63 DCHECK(file_system_); |
| 64 callbacks_->didSucceed(); | 64 callbacks_->didSucceed(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 // Callback to report information for a file. |
| 68 virtual void DidGetLocalPath(const FilePath& local_path) { |
| 69 NOTREACHED(); |
| 70 } |
| 71 |
| 67 virtual void DidReadMetadata(const base::PlatformFileInfo& info, | 72 virtual void DidReadMetadata(const base::PlatformFileInfo& info, |
| 68 const FilePath& platform_path) { | 73 const FilePath& platform_path) { |
| 69 DCHECK(file_system_); | 74 DCHECK(file_system_); |
| 70 WebFileInfo web_file_info; | 75 WebFileInfo web_file_info; |
| 71 web_file_info.length = info.size; | 76 web_file_info.length = info.size; |
| 72 web_file_info.modificationTime = info.last_modified.ToDoubleT(); | 77 web_file_info.modificationTime = info.last_modified.ToDoubleT(); |
| 73 web_file_info.type = info.is_directory ? | 78 web_file_info.type = info.is_directory ? |
| 74 WebFileInfo::TypeDirectory : WebFileInfo::TypeFile; | 79 WebFileInfo::TypeDirectory : WebFileInfo::TypeFile; |
| 75 web_file_info.platformPath = | 80 web_file_info.platformPath = |
| 76 webkit_glue::FilePathToWebString(platform_path); | 81 webkit_glue::FilePathToWebString(platform_path); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 231 |
| 227 FileSystemOperation* SimpleFileSystem::GetNewOperation( | 232 FileSystemOperation* SimpleFileSystem::GetNewOperation( |
| 228 WebFileSystemCallbacks* callbacks) { | 233 WebFileSystemCallbacks* callbacks) { |
| 229 SimpleFileSystemCallbackDispatcher* dispatcher = | 234 SimpleFileSystemCallbackDispatcher* dispatcher = |
| 230 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); | 235 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); |
| 231 FileSystemOperation* operation = new FileSystemOperation( | 236 FileSystemOperation* operation = new FileSystemOperation( |
| 232 dispatcher, base::MessageLoopProxy::CreateForCurrentThread(), | 237 dispatcher, base::MessageLoopProxy::CreateForCurrentThread(), |
| 233 file_system_context_.get(), NULL); | 238 file_system_context_.get(), NULL); |
| 234 return operation; | 239 return operation; |
| 235 } | 240 } |
| OLD | NEW |