| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "storage/browser/fileapi/remove_operation_delegate.h" | 5 #include "storage/browser/fileapi/remove_operation_delegate.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "storage/browser/fileapi/file_system_context.h" | 8 #include "storage/browser/fileapi/file_system_context.h" |
| 9 #include "storage/browser/fileapi/file_system_operation_runner.h" | 9 #include "storage/browser/fileapi/file_system_operation_runner.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 | 22 |
| 23 RemoveOperationDelegate::~RemoveOperationDelegate() {} | 23 RemoveOperationDelegate::~RemoveOperationDelegate() {} |
| 24 | 24 |
| 25 void RemoveOperationDelegate::Run() { | 25 void RemoveOperationDelegate::Run() { |
| 26 operation_runner()->RemoveFile(url_, base::Bind( | 26 operation_runner()->RemoveFile(url_, base::Bind( |
| 27 &RemoveOperationDelegate::DidTryRemoveFile, weak_factory_.GetWeakPtr())); | 27 &RemoveOperationDelegate::DidTryRemoveFile, weak_factory_.GetWeakPtr())); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void RemoveOperationDelegate::RunRecursively() { | 30 void RemoveOperationDelegate::RunRecursively() { |
| 31 StartRecursiveOperation(url_, callback_); | 31 StartRecursiveOperation(url_, FileSystemOperation::ERROR_BEHAVIOR_TERMINATE, |
| 32 callback_); |
| 32 } | 33 } |
| 33 | 34 |
| 34 void RemoveOperationDelegate::ProcessFile(const FileSystemURL& url, | 35 void RemoveOperationDelegate::ProcessFile(const FileSystemURL& url, |
| 35 const StatusCallback& callback) { | 36 const StatusCallback& callback) { |
| 36 operation_runner()->RemoveFile( | 37 operation_runner()->RemoveFile( |
| 37 url, | 38 url, |
| 38 base::Bind(&RemoveOperationDelegate::DidRemoveFile, | 39 base::Bind(&RemoveOperationDelegate::DidRemoveFile, |
| 39 weak_factory_.GetWeakPtr(), callback)); | 40 weak_factory_.GetWeakPtr(), callback)); |
| 40 } | 41 } |
| 41 | 42 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 void RemoveOperationDelegate::DidRemoveFile(const StatusCallback& callback, | 74 void RemoveOperationDelegate::DidRemoveFile(const StatusCallback& callback, |
| 74 base::File::Error error) { | 75 base::File::Error error) { |
| 75 if (error == base::File::FILE_ERROR_NOT_FOUND) { | 76 if (error == base::File::FILE_ERROR_NOT_FOUND) { |
| 76 callback.Run(base::File::FILE_OK); | 77 callback.Run(base::File::FILE_OK); |
| 77 return; | 78 return; |
| 78 } | 79 } |
| 79 callback.Run(error); | 80 callback.Run(error); |
| 80 } | 81 } |
| 81 | 82 |
| 82 } // namespace storage | 83 } // namespace storage |
| OLD | NEW |