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/chromeos/fileapi/remote_file_system_operation.h" | 5 #include "webkit/chromeos/fileapi/remote_file_system_operation.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 } | 166 } |
167 DCHECK(SetPendingOperationType(kOperationOpenFile)); | 167 DCHECK(SetPendingOperationType(kOperationOpenFile)); |
168 remote_proxy_->OpenFile( | 168 remote_proxy_->OpenFile( |
169 url, | 169 url, |
170 file_flags, | 170 file_flags, |
171 peer_handle, | 171 peer_handle, |
172 base::Bind(&RemoteFileSystemOperation::DidOpenFile, | 172 base::Bind(&RemoteFileSystemOperation::DidOpenFile, |
173 base::Owned(this), callback)); | 173 base::Owned(this), callback)); |
174 } | 174 } |
175 | 175 |
| 176 void RemoteFileSystemOperation::NotifyCloseFile( |
| 177 const fileapi::FileSystemURL& url) { |
| 178 DCHECK(SetPendingOperationType(kOperationCloseFile)); |
| 179 remote_proxy_->NotifyCloseFile(url); |
| 180 // Unlike other operations, NotifyCloseFile does not require callback. |
| 181 // So it must be deleted here right now. |
| 182 delete this; |
| 183 } |
| 184 |
176 fileapi::FileSystemOperation* | 185 fileapi::FileSystemOperation* |
177 RemoteFileSystemOperation::AsFileSystemOperation() { | 186 RemoteFileSystemOperation::AsFileSystemOperation() { |
178 NOTIMPLEMENTED(); | 187 NOTIMPLEMENTED(); |
179 return NULL; | 188 return NULL; |
180 } | 189 } |
181 | 190 |
182 void RemoteFileSystemOperation::CreateSnapshotFile( | 191 void RemoteFileSystemOperation::CreateSnapshotFile( |
183 const FileSystemURL& url, | 192 const FileSystemURL& url, |
184 const SnapshotFileCallback& callback) { | 193 const SnapshotFileCallback& callback) { |
185 DCHECK(SetPendingOperationType(kOperationCreateSnapshotFile)); | 194 DCHECK(SetPendingOperationType(kOperationCreateSnapshotFile)); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 275 |
267 void RemoteFileSystemOperation::DidOpenFile( | 276 void RemoteFileSystemOperation::DidOpenFile( |
268 const OpenFileCallback& callback, | 277 const OpenFileCallback& callback, |
269 base::PlatformFileError result, | 278 base::PlatformFileError result, |
270 base::PlatformFile file, | 279 base::PlatformFile file, |
271 base::ProcessHandle peer_handle) { | 280 base::ProcessHandle peer_handle) { |
272 callback.Run(result, file, peer_handle); | 281 callback.Run(result, file, peer_handle); |
273 } | 282 } |
274 | 283 |
275 } // namespace chromeos | 284 } // namespace chromeos |
OLD | NEW |