| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 void SimpleFileSystem::copy( | 123 void SimpleFileSystem::copy( |
| 124 const WebString& src_path, const WebString& dest_path, | 124 const WebString& src_path, const WebString& dest_path, |
| 125 WebFileSystemCallbacks* callbacks) { | 125 WebFileSystemCallbacks* callbacks) { |
| 126 FilePath dest_filepath(webkit_glue::WebStringToFilePath(dest_path)); | 126 FilePath dest_filepath(webkit_glue::WebStringToFilePath(dest_path)); |
| 127 FilePath src_filepath(webkit_glue::WebStringToFilePath(src_path)); | 127 FilePath src_filepath(webkit_glue::WebStringToFilePath(src_path)); |
| 128 | 128 |
| 129 GetNewOperation(callbacks)->Copy(src_filepath, dest_filepath); | 129 GetNewOperation(callbacks)->Copy(src_filepath, dest_filepath); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void SimpleFileSystem::remove( | 132 void SimpleFileSystem::remove( |
| 133 const WebString& path, WebFileSystemCallbacks* callbacks) { | 133 const WebString& path, bool recursive, WebFileSystemCallbacks* callbacks) { |
| 134 FilePath filepath(webkit_glue::WebStringToFilePath(path)); | 134 FilePath filepath(webkit_glue::WebStringToFilePath(path)); |
| 135 | 135 |
| 136 GetNewOperation(callbacks)->Remove(filepath); | 136 GetNewOperation(callbacks)->Remove(filepath, recursive); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void SimpleFileSystem::readMetadata( | 139 void SimpleFileSystem::readMetadata( |
| 140 const WebString& path, WebFileSystemCallbacks* callbacks) { | 140 const WebString& path, WebFileSystemCallbacks* callbacks) { |
| 141 FilePath filepath(webkit_glue::WebStringToFilePath(path)); | 141 FilePath filepath(webkit_glue::WebStringToFilePath(path)); |
| 142 | 142 |
| 143 GetNewOperation(callbacks)->GetMetadata(filepath); | 143 GetNewOperation(callbacks)->GetMetadata(filepath); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void SimpleFileSystem::createFile( | 146 void SimpleFileSystem::createFile( |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 fileapi::FileSystemOperation* operation = new fileapi::FileSystemOperation( | 186 fileapi::FileSystemOperation* operation = new fileapi::FileSystemOperation( |
| 187 dispatcher, base::MessageLoopProxy::CreateForCurrentThread()); | 187 dispatcher, base::MessageLoopProxy::CreateForCurrentThread()); |
| 188 int32 request_id = operations_.Add(operation); | 188 int32 request_id = operations_.Add(operation); |
| 189 dispatcher->set_request_id(request_id); | 189 dispatcher->set_request_id(request_id); |
| 190 return operation; | 190 return operation; |
| 191 } | 191 } |
| 192 | 192 |
| 193 void SimpleFileSystem::RemoveCompletedOperation(int request_id) { | 193 void SimpleFileSystem::RemoveCompletedOperation(int request_id) { |
| 194 operations_.Remove(request_id); | 194 operations_.Remove(request_id); |
| 195 } | 195 } |
| OLD | NEW |