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/common/file_system/file_system_dispatcher.h" | 5 #include "chrome/common/file_system/file_system_dispatcher.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "chrome/common/child_thread.h" | 8 #include "chrome/common/child_thread.h" |
9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
10 #include "chrome/common/render_messages_params.h" | 10 #include "chrome/common/render_messages_params.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 const FilePath& src_path, | 60 const FilePath& src_path, |
61 const FilePath& dest_path, | 61 const FilePath& dest_path, |
62 fileapi::FileSystemCallbackDispatcher* dispatcher) { | 62 fileapi::FileSystemCallbackDispatcher* dispatcher) { |
63 int request_id = dispatchers_.Add(dispatcher); | 63 int request_id = dispatchers_.Add(dispatcher); |
64 return ChildThread::current()->Send(new ViewHostMsg_FileSystem_Copy( | 64 return ChildThread::current()->Send(new ViewHostMsg_FileSystem_Copy( |
65 request_id, src_path, dest_path)); | 65 request_id, src_path, dest_path)); |
66 } | 66 } |
67 | 67 |
68 bool FileSystemDispatcher::Remove( | 68 bool FileSystemDispatcher::Remove( |
69 const FilePath& path, | 69 const FilePath& path, |
| 70 bool recursive, |
70 fileapi::FileSystemCallbackDispatcher* dispatcher) { | 71 fileapi::FileSystemCallbackDispatcher* dispatcher) { |
71 int request_id = dispatchers_.Add(dispatcher); | 72 int request_id = dispatchers_.Add(dispatcher); |
72 return ChildThread::current()->Send( | 73 return ChildThread::current()->Send( |
73 new ViewHostMsg_FileSystem_Remove(request_id, path)); | 74 new ViewHostMsg_FileSystem_Remove(request_id, path, recursive)); |
74 } | 75 } |
75 | 76 |
76 bool FileSystemDispatcher::ReadMetadata( | 77 bool FileSystemDispatcher::ReadMetadata( |
77 const FilePath& path, | 78 const FilePath& path, |
78 fileapi::FileSystemCallbackDispatcher* dispatcher) { | 79 fileapi::FileSystemCallbackDispatcher* dispatcher) { |
79 int request_id = dispatchers_.Add(dispatcher); | 80 int request_id = dispatchers_.Add(dispatcher); |
80 return ChildThread::current()->Send( | 81 return ChildThread::current()->Send( |
81 new ViewHostMsg_FileSystem_ReadMetadata(request_id, path)); | 82 new ViewHostMsg_FileSystem_ReadMetadata(request_id, path)); |
82 } | 83 } |
83 | 84 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 void FileSystemDispatcher::DidWrite( | 214 void FileSystemDispatcher::DidWrite( |
214 int request_id, int64 bytes, bool complete) { | 215 int request_id, int64 bytes, bool complete) { |
215 fileapi::FileSystemCallbackDispatcher* dispatcher = | 216 fileapi::FileSystemCallbackDispatcher* dispatcher = |
216 dispatchers_.Lookup(request_id); | 217 dispatchers_.Lookup(request_id); |
217 DCHECK(dispatcher); | 218 DCHECK(dispatcher); |
218 // TODO(ericu): Coming soon. | 219 // TODO(ericu): Coming soon. |
219 // dispatcher->DidWrite(bytes, complete); | 220 // dispatcher->DidWrite(bytes, complete); |
220 if (complete) | 221 if (complete) |
221 dispatchers_.Remove(request_id); | 222 dispatchers_.Remove(request_id); |
222 } | 223 } |
223 | |
OLD | NEW |