OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "webkit/browser/fileapi/file_system_operation_runner.h" | 5 #include "webkit/browser/fileapi/file_system_operation_runner.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "webkit/browser/fileapi/file_observers.h" | 8 #include "webkit/browser/fileapi/file_observers.h" |
9 #include "webkit/browser/fileapi/file_system_context.h" | 9 #include "webkit/browser/fileapi/file_system_context.h" |
10 #include "webkit/browser/fileapi/local_file_system_operation.h" | 10 #include "webkit/browser/fileapi/local_file_system_operation.h" |
11 #include "webkit/common/blob/shareable_file_reference.h" | 11 #include "webkit/common/blob/shareable_file_reference.h" |
12 | 12 |
13 namespace fileapi { | 13 namespace fileapi { |
14 | 14 |
15 typedef FileSystemOperationRunner::OperationID OperationID; | 15 typedef FileSystemOperationRunner::OperationID OperationID; |
16 | 16 |
17 const OperationID FileSystemOperationRunner::kErrorOperationID = -1; | 17 const OperationID FileSystemOperationRunner::kErrorOperationID = -1; |
18 | 18 |
19 FileSystemOperationRunner::~FileSystemOperationRunner() { | 19 FileSystemOperationRunner::~FileSystemOperationRunner() { |
20 } | 20 } |
21 | 21 |
| 22 void FileSystemOperationRunner::Shutdown() { |
| 23 operations_.Clear(); |
| 24 } |
| 25 |
22 OperationID FileSystemOperationRunner::CreateFile( | 26 OperationID FileSystemOperationRunner::CreateFile( |
23 const FileSystemURL& url, | 27 const FileSystemURL& url, |
24 bool exclusive, | 28 bool exclusive, |
25 const StatusCallback& callback) { | 29 const StatusCallback& callback) { |
26 base::PlatformFileError error = base::PLATFORM_FILE_OK; | 30 base::PlatformFileError error = base::PLATFORM_FILE_OK; |
27 FileSystemOperation* operation = | 31 FileSystemOperation* operation = |
28 file_system_context_->CreateFileSystemOperation(url, &error); | 32 file_system_context_->CreateFileSystemOperation(url, &error); |
29 if (!operation) { | 33 if (!operation) { |
30 callback.Run(error); | 34 callback.Run(error); |
31 return kErrorOperationID; | 35 return kErrorOperationID; |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 &FileUpdateObserver::OnEndUpdate, MakeTuple(*iter)); | 538 &FileUpdateObserver::OnEndUpdate, MakeTuple(*iter)); |
535 } | 539 } |
536 } | 540 } |
537 write_target_urls_.erase(found); | 541 write_target_urls_.erase(found); |
538 } | 542 } |
539 DCHECK(operations_.Lookup(id)); | 543 DCHECK(operations_.Lookup(id)); |
540 operations_.Remove(id); | 544 operations_.Remove(id); |
541 } | 545 } |
542 | 546 |
543 } // namespace fileapi | 547 } // namespace fileapi |
OLD | NEW |