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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 163 } |
164 DCHECK(SetPendingOperationType(kOperationOpenFile)); | 164 DCHECK(SetPendingOperationType(kOperationOpenFile)); |
165 remote_proxy_->OpenFile( | 165 remote_proxy_->OpenFile( |
166 path, | 166 path, |
167 file_flags, | 167 file_flags, |
168 peer_handle, | 168 peer_handle, |
169 base::Bind(&RemoteFileSystemOperation::DidOpenFile, | 169 base::Bind(&RemoteFileSystemOperation::DidOpenFile, |
170 base::Owned(this), callback)); | 170 base::Owned(this), callback)); |
171 } | 171 } |
172 | 172 |
| 173 void RemoteFileSystemOperation::NotifyCloseFile(const GURL& path) { |
| 174 DCHECK(SetPendingOperationType(kOperationCloseFile)); |
| 175 remote_proxy_->NotifyCloseFile(path); |
| 176 // Unlike other operations, NotifyCloseFile does not require callback. |
| 177 // So it must be deleted here right now. |
| 178 delete this; |
| 179 } |
| 180 |
173 fileapi::FileSystemOperation* | 181 fileapi::FileSystemOperation* |
174 RemoteFileSystemOperation::AsFileSystemOperation() { | 182 RemoteFileSystemOperation::AsFileSystemOperation() { |
175 NOTIMPLEMENTED(); | 183 NOTIMPLEMENTED(); |
176 return NULL; | 184 return NULL; |
177 } | 185 } |
178 | 186 |
179 void RemoteFileSystemOperation::CreateSnapshotFile( | 187 void RemoteFileSystemOperation::CreateSnapshotFile( |
180 const GURL& path, | 188 const GURL& path, |
181 const SnapshotFileCallback& callback) { | 189 const SnapshotFileCallback& callback) { |
182 DCHECK(SetPendingOperationType(kOperationCreateSnapshotFile)); | 190 DCHECK(SetPendingOperationType(kOperationCreateSnapshotFile)); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 271 |
264 void RemoteFileSystemOperation::DidOpenFile( | 272 void RemoteFileSystemOperation::DidOpenFile( |
265 const OpenFileCallback& callback, | 273 const OpenFileCallback& callback, |
266 base::PlatformFileError result, | 274 base::PlatformFileError result, |
267 base::PlatformFile file, | 275 base::PlatformFile file, |
268 base::ProcessHandle peer_handle) { | 276 base::ProcessHandle peer_handle) { |
269 callback.Run(result, file, peer_handle); | 277 callback.Run(result, file, peer_handle); |
270 } | 278 } |
271 | 279 |
272 } // namespace chromeos | 280 } // namespace chromeos |
OLD | NEW |