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/syncable/syncable_file_system_operation.h" | 5 #include "webkit/fileapi/syncable/syncable_file_system_operation.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "webkit/blob/shareable_file_reference.h" | 8 #include "webkit/blob/shareable_file_reference.h" |
9 #include "webkit/fileapi/file_system_context.h" | 9 #include "webkit/fileapi/file_system_context.h" |
10 #include "webkit/fileapi/file_system_url.h" | 10 #include "webkit/fileapi/file_system_url.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 file_system_operation_->FileExists(url, callback); | 176 file_system_operation_->FileExists(url, callback); |
177 delete this; | 177 delete this; |
178 } | 178 } |
179 | 179 |
180 void SyncableFileSystemOperation::GetMetadata( | 180 void SyncableFileSystemOperation::GetMetadata( |
181 const FileSystemURL& url, | 181 const FileSystemURL& url, |
182 const GetMetadataCallback& callback) { | 182 const GetMetadataCallback& callback) { |
183 DCHECK(CalledOnValidThread()); | 183 DCHECK(CalledOnValidThread()); |
184 if (!operation_runner_) { | 184 if (!operation_runner_) { |
185 callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, | 185 callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, |
186 base::PlatformFileInfo(), FilePath()); | 186 base::PlatformFileInfo(), base::FilePath()); |
187 delete file_system_operation_; | 187 delete file_system_operation_; |
188 delete this; | 188 delete this; |
189 return; | 189 return; |
190 } | 190 } |
191 file_system_operation_->GetMetadata(url, callback); | 191 file_system_operation_->GetMetadata(url, callback); |
192 delete this; | 192 delete this; |
193 } | 193 } |
194 | 194 |
195 void SyncableFileSystemOperation::ReadDirectory( | 195 void SyncableFileSystemOperation::ReadDirectory( |
196 const FileSystemURL& url, | 196 const FileSystemURL& url, |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 base::Unretained(this))); | 323 base::Unretained(this))); |
324 return file_system_operation_; | 324 return file_system_operation_; |
325 } | 325 } |
326 | 326 |
327 void SyncableFileSystemOperation::CreateSnapshotFile( | 327 void SyncableFileSystemOperation::CreateSnapshotFile( |
328 const FileSystemURL& path, | 328 const FileSystemURL& path, |
329 const SnapshotFileCallback& callback) { | 329 const SnapshotFileCallback& callback) { |
330 DCHECK(CalledOnValidThread()); | 330 DCHECK(CalledOnValidThread()); |
331 if (!operation_runner_) { | 331 if (!operation_runner_) { |
332 callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, | 332 callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, |
333 base::PlatformFileInfo(), FilePath(), NULL); | 333 base::PlatformFileInfo(), base::FilePath(), NULL); |
334 delete file_system_operation_; | 334 delete file_system_operation_; |
335 delete this; | 335 delete this; |
336 return; | 336 return; |
337 } | 337 } |
338 file_system_operation_->CreateSnapshotFile(path, callback); | 338 file_system_operation_->CreateSnapshotFile(path, callback); |
339 delete this; | 339 delete this; |
340 } | 340 } |
341 | 341 |
342 SyncableFileSystemOperation::SyncableFileSystemOperation( | 342 SyncableFileSystemOperation::SyncableFileSystemOperation( |
343 FileSystemContext* file_system_context, | 343 FileSystemContext* file_system_context, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 callback.Run(error); | 392 callback.Run(error); |
393 delete file_system_operation_; | 393 delete file_system_operation_; |
394 delete this; | 394 delete this; |
395 } | 395 } |
396 | 396 |
397 void SyncableFileSystemOperation::Destruct() { | 397 void SyncableFileSystemOperation::Destruct() { |
398 delete this; | 398 delete this; |
399 } | 399 } |
400 | 400 |
401 } // namespace fileapi | 401 } // namespace fileapi |
OLD | NEW |