OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/file_system_provider/provided_file_system.h" | 5 #include "chrome/browser/chromeos/file_system_provider/provided_file_system.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 callback.Run(make_scoped_ptr<EntryMetadata>(NULL), | 191 callback.Run(make_scoped_ptr<EntryMetadata>(NULL), |
192 base::File::FILE_ERROR_SECURITY); | 192 base::File::FILE_ERROR_SECURITY); |
193 return AbortCallback(); | 193 return AbortCallback(); |
194 } | 194 } |
195 | 195 |
196 return base::Bind( | 196 return base::Bind( |
197 &ProvidedFileSystem::Abort, weak_ptr_factory_.GetWeakPtr(), request_id); | 197 &ProvidedFileSystem::Abort, weak_ptr_factory_.GetWeakPtr(), request_id); |
198 } | 198 } |
199 | 199 |
200 AbortCallback ProvidedFileSystem::GetActions( | 200 AbortCallback ProvidedFileSystem::GetActions( |
201 const base::FilePath& entry_path, | 201 const std::vector<base::FilePath>& entry_paths, |
202 const GetActionsCallback& callback) { | 202 const GetActionsCallback& callback) { |
203 const int request_id = request_manager_->CreateRequest( | 203 const int request_id = request_manager_->CreateRequest( |
204 GET_ACTIONS, | 204 GET_ACTIONS, |
205 scoped_ptr<RequestManager::HandlerInterface>(new operations::GetActions( | 205 scoped_ptr<RequestManager::HandlerInterface>(new operations::GetActions( |
206 event_router_, file_system_info_, entry_path, callback))); | 206 event_router_, file_system_info_, entry_paths, callback))); |
207 if (!request_id) { | 207 if (!request_id) { |
208 callback.Run(Actions(), base::File::FILE_ERROR_SECURITY); | 208 callback.Run(Actions(), base::File::FILE_ERROR_SECURITY); |
209 return AbortCallback(); | 209 return AbortCallback(); |
210 } | 210 } |
211 | 211 |
212 return base::Bind(&ProvidedFileSystem::Abort, weak_ptr_factory_.GetWeakPtr(), | 212 return base::Bind(&ProvidedFileSystem::Abort, weak_ptr_factory_.GetWeakPtr(), |
213 request_id); | 213 request_id); |
214 } | 214 } |
215 | 215 |
216 AbortCallback ProvidedFileSystem::ExecuteAction( | 216 AbortCallback ProvidedFileSystem::ExecuteAction( |
217 const base::FilePath& entry_path, | 217 const std::vector<base::FilePath>& entry_paths, |
218 const std::string& action_id, | 218 const std::string& action_id, |
219 const storage::AsyncFileUtil::StatusCallback& callback) { | 219 const storage::AsyncFileUtil::StatusCallback& callback) { |
220 const int request_id = request_manager_->CreateRequest( | 220 const int request_id = request_manager_->CreateRequest( |
221 EXECUTE_ACTION, | 221 EXECUTE_ACTION, |
222 scoped_ptr<RequestManager::HandlerInterface>( | 222 scoped_ptr<RequestManager::HandlerInterface>( |
223 new operations::ExecuteAction(event_router_, file_system_info_, | 223 new operations::ExecuteAction(event_router_, file_system_info_, |
224 entry_path, action_id, callback))); | 224 entry_paths, action_id, callback))); |
225 if (!request_id) { | 225 if (!request_id) { |
226 callback.Run(base::File::FILE_ERROR_SECURITY); | 226 callback.Run(base::File::FILE_ERROR_SECURITY); |
227 return AbortCallback(); | 227 return AbortCallback(); |
228 } | 228 } |
229 | 229 |
230 return base::Bind(&ProvidedFileSystem::Abort, weak_ptr_factory_.GetWeakPtr(), | 230 return base::Bind(&ProvidedFileSystem::Abort, weak_ptr_factory_.GetWeakPtr(), |
231 request_id); | 231 request_id); |
232 } | 232 } |
233 | 233 |
234 AbortCallback ProvidedFileSystem::ReadDirectory( | 234 AbortCallback ProvidedFileSystem::ReadDirectory( |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 const storage::AsyncFileUtil::StatusCallback& callback, | 834 const storage::AsyncFileUtil::StatusCallback& callback, |
835 base::File::Error result) { | 835 base::File::Error result) { |
836 // Closing files is final. Even if an error happened, we remove it from the | 836 // Closing files is final. Even if an error happened, we remove it from the |
837 // list of opened files. | 837 // list of opened files. |
838 opened_files_.erase(file_handle); | 838 opened_files_.erase(file_handle); |
839 callback.Run(result); | 839 callback.Run(result); |
840 } | 840 } |
841 | 841 |
842 } // namespace file_system_provider | 842 } // namespace file_system_provider |
843 } // namespace chromeos | 843 } // namespace chromeos |
OLD | NEW |