OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/fileapi/file_system_file_util_proxy.h" | 5 #include "webkit/fileapi/file_system_file_util_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
10 #include "base/task_runner_util.h" | 10 #include "base/task_runner_util.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 private: | 102 private: |
103 base::PlatformFileError error_; | 103 base::PlatformFileError error_; |
104 std::vector<Proxy::Entry> entries_; | 104 std::vector<Proxy::Entry> entries_; |
105 DISALLOW_COPY_AND_ASSIGN(ReadDirectoryHelper); | 105 DISALLOW_COPY_AND_ASSIGN(ReadDirectoryHelper); |
106 }; | 106 }; |
107 | 107 |
108 } // namespace | 108 } // namespace |
109 | 109 |
110 // static | 110 // static |
111 bool FileSystemFileUtilProxy::Delete( | 111 bool FileSystemFileUtilProxy::DeleteFile( |
112 FileSystemOperationContext* context, | 112 FileSystemOperationContext* context, |
113 FileSystemFileUtil* file_util, | 113 FileSystemFileUtil* file_util, |
114 const FileSystemURL& url, | 114 const FileSystemURL& url, |
115 bool recursive, | |
116 const StatusCallback& callback) { | 115 const StatusCallback& callback) { |
117 return base::PostTaskAndReplyWithResult( | 116 return base::PostTaskAndReplyWithResult( |
118 context->task_runner(), FROM_HERE, | 117 context->task_runner(), FROM_HERE, |
119 Bind(&FileUtilHelper::Delete, context, file_util, url, recursive), | 118 Bind(&FileSystemFileUtil::DeleteFile, Unretained(file_util), |
| 119 context, url), |
120 callback); | 120 callback); |
121 } | 121 } |
122 | 122 |
| 123 // static |
| 124 bool FileSystemFileUtilProxy::DeleteDirectory( |
| 125 FileSystemOperationContext* context, |
| 126 FileSystemFileUtil* file_util, |
| 127 const FileSystemURL& url, |
| 128 const StatusCallback& callback) { |
| 129 return base::PostTaskAndReplyWithResult( |
| 130 context->task_runner(), FROM_HERE, |
| 131 Bind(&FileSystemFileUtil::DeleteDirectory, Unretained(file_util), |
| 132 context, url), |
| 133 callback); |
| 134 } |
| 135 |
123 // static | 136 // static |
124 bool FileSystemFileUtilProxy::CreateOrOpen( | 137 bool FileSystemFileUtilProxy::CreateOrOpen( |
125 FileSystemOperationContext* context, | 138 FileSystemOperationContext* context, |
126 FileSystemFileUtil* file_util, | 139 FileSystemFileUtil* file_util, |
127 const FileSystemURL& url, | 140 const FileSystemURL& url, |
128 int file_flags, | 141 int file_flags, |
129 const CreateOrOpenCallback& callback) { | 142 const CreateOrOpenCallback& callback) { |
130 return base::FileUtilProxy::RelayCreateOrOpen( | 143 return base::FileUtilProxy::RelayCreateOrOpen( |
131 context->task_runner(), | 144 context->task_runner(), |
132 Bind(&FileSystemFileUtil::CreateOrOpen, Unretained(file_util), | 145 Bind(&FileSystemFileUtil::CreateOrOpen, Unretained(file_util), |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 int64 length, | 287 int64 length, |
275 const StatusCallback& callback) { | 288 const StatusCallback& callback) { |
276 return base::PostTaskAndReplyWithResult( | 289 return base::PostTaskAndReplyWithResult( |
277 context->task_runner(), FROM_HERE, | 290 context->task_runner(), FROM_HERE, |
278 Bind(&FileSystemFileUtil::Truncate, Unretained(file_util), | 291 Bind(&FileSystemFileUtil::Truncate, Unretained(file_util), |
279 context, url, length), | 292 context, url, length), |
280 callback); | 293 callback); |
281 } | 294 } |
282 | 295 |
283 } // namespace fileapi | 296 } // namespace fileapi |
OLD | NEW |