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 "chrome/browser/file_system/file_system_dispatcher_host.h" | 5 #include "chrome/browser/file_system/file_system_dispatcher_host.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/thread.h" | 8 #include "base/thread.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 void FileSystemDispatcherHost::OnCopy( | 155 void FileSystemDispatcherHost::OnCopy( |
156 int request_id, const FilePath& src_path, const FilePath& dest_path) { | 156 int request_id, const FilePath& src_path, const FilePath& dest_path) { |
157 if (!CheckValidFileSystemPath(src_path, request_id) || | 157 if (!CheckValidFileSystemPath(src_path, request_id) || |
158 !CheckValidFileSystemPath(dest_path, request_id)) | 158 !CheckValidFileSystemPath(dest_path, request_id)) |
159 return; | 159 return; |
160 | 160 |
161 GetNewOperation(request_id)->Copy(src_path, dest_path); | 161 GetNewOperation(request_id)->Copy(src_path, dest_path); |
162 } | 162 } |
163 | 163 |
164 void FileSystemDispatcherHost::OnRemove(int request_id, const FilePath& path) { | 164 void FileSystemDispatcherHost::OnRemove( |
| 165 int request_id, const FilePath& path, bool recursive) { |
165 if (!CheckValidFileSystemPath(path, request_id)) | 166 if (!CheckValidFileSystemPath(path, request_id)) |
166 return; | 167 return; |
167 GetNewOperation(request_id)->Remove(path); | 168 GetNewOperation(request_id)->Remove(path, recursive); |
168 } | 169 } |
169 | 170 |
170 void FileSystemDispatcherHost::OnReadMetadata( | 171 void FileSystemDispatcherHost::OnReadMetadata( |
171 int request_id, const FilePath& path) { | 172 int request_id, const FilePath& path) { |
172 if (!CheckValidFileSystemPath(path, request_id)) | 173 if (!CheckValidFileSystemPath(path, request_id)) |
173 return; | 174 return; |
174 GetNewOperation(request_id)->GetMetadata(path); | 175 GetNewOperation(request_id)->GetMetadata(path); |
175 } | 176 } |
176 | 177 |
177 void FileSystemDispatcherHost::OnCreate( | 178 void FileSystemDispatcherHost::OnCreate( |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 dispatcher, | 275 dispatcher, |
275 ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE)); | 276 ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE)); |
276 operations_.AddWithID(operation, request_id); | 277 operations_.AddWithID(operation, request_id); |
277 return operation; | 278 return operation; |
278 } | 279 } |
279 | 280 |
280 void FileSystemDispatcherHost::RemoveCompletedOperation(int request_id) { | 281 void FileSystemDispatcherHost::RemoveCompletedOperation(int request_id) { |
281 DCHECK(operations_.Lookup(request_id)); | 282 DCHECK(operations_.Lookup(request_id)); |
282 operations_.Remove(request_id); | 283 operations_.Remove(request_id); |
283 } | 284 } |
OLD | NEW |