| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_THROTTLED_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_THROTTLED_FILE_SYSTEM_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_THROTTLED_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_THROTTLED_FILE_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 virtual void Notify( | 115 virtual void Notify( |
| 116 const base::FilePath& entry_path, | 116 const base::FilePath& entry_path, |
| 117 bool recursive, | 117 bool recursive, |
| 118 storage::WatcherManager::ChangeType change_type, | 118 storage::WatcherManager::ChangeType change_type, |
| 119 scoped_ptr<ProvidedFileSystemObserver::Changes> changes, | 119 scoped_ptr<ProvidedFileSystemObserver::Changes> changes, |
| 120 const std::string& tag, | 120 const std::string& tag, |
| 121 const storage::AsyncFileUtil::StatusCallback& callback) override; | 121 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 122 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() override; | 122 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() override; |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 // Called when an operation enqueued with |queue_token| is aborted. |
| 126 void Abort(int queue_token); |
| 127 |
| 125 // Called when opening a file is completed with either a success or an error. | 128 // Called when opening a file is completed with either a success or an error. |
| 126 void OnOpenFileCompleted(int queue_token, | 129 void OnOpenFileCompleted(int queue_token, |
| 127 const OpenFileCallback& callback, | 130 const OpenFileCallback& callback, |
| 128 int file_handle, | 131 int file_handle, |
| 129 base::File::Error result); | 132 base::File::Error result); |
| 130 | 133 |
| 131 // Called when closing a file is completed with either a success or an error. | 134 // Called when closing a file is completed with either a success or an error. |
| 132 void OnCloseFileCompleted( | 135 void OnCloseFileCompleted( |
| 133 int file_handle, | 136 int file_handle, |
| 134 const storage::AsyncFileUtil::StatusCallback& callback, | 137 const storage::AsyncFileUtil::StatusCallback& callback, |
| 135 base::File::Error result); | 138 base::File::Error result); |
| 136 | 139 |
| 137 scoped_ptr<ProvidedFileSystemInterface> file_system_; | 140 scoped_ptr<ProvidedFileSystemInterface> file_system_; |
| 138 scoped_ptr<Queue> open_queue_; | 141 scoped_ptr<Queue> open_queue_; |
| 139 | 142 |
| 140 // Map from file handles to open queue tokens. | 143 // Map from file handles to open queue tokens. |
| 141 std::map<int, int> opened_files_; | 144 std::map<int, int> opened_files_; |
| 142 | 145 |
| 143 base::WeakPtrFactory<ThrottledFileSystem> weak_ptr_factory_; | 146 base::WeakPtrFactory<ThrottledFileSystem> weak_ptr_factory_; |
| 144 DISALLOW_COPY_AND_ASSIGN(ThrottledFileSystem); | 147 DISALLOW_COPY_AND_ASSIGN(ThrottledFileSystem); |
| 145 }; | 148 }; |
| 146 | 149 |
| 147 } // namespace file_system_provider | 150 } // namespace file_system_provider |
| 148 } // namespace chromeos | 151 } // namespace chromeos |
| 149 | 152 |
| 150 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_THROTTLED_FILE_SYSTEM_H_ | 153 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_THROTTLED_FILE_SYSTEM_H_ |
| OLD | NEW |