| 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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPEN_FILE_OPERATION_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPEN_FILE_OPERATION_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPEN_FILE_OPERATION_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPEN_FILE_OPERATION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 FileError error); | 65 FileError error); |
| 66 | 66 |
| 67 // Part of OpenFile(). Called after file downloading is completed. | 67 // Part of OpenFile(). Called after file downloading is completed. |
| 68 void OpenFileAfterFileDownloaded(const OpenFileCallback& callback, | 68 void OpenFileAfterFileDownloaded(const OpenFileCallback& callback, |
| 69 FileError error, | 69 FileError error, |
| 70 const base::FilePath& local_file_path, | 70 const base::FilePath& local_file_path, |
| 71 scoped_ptr<ResourceEntry> entry); | 71 scoped_ptr<ResourceEntry> entry); |
| 72 | 72 |
| 73 // Part of OpenFile(). Called after marking the cache file dirty. | 73 // Part of OpenFile(). Called after marking the cache file dirty. |
| 74 void OpenFileAfterMarkDirty(const base::FilePath& local_file_path, | 74 void OpenFileAfterMarkDirty(const base::FilePath& local_file_path, |
| 75 const std::string& resource_id, | 75 const std::string& local_id, |
| 76 const OpenFileCallback& callback, | 76 const OpenFileCallback& callback, |
| 77 FileError error); | 77 FileError error); |
| 78 | 78 |
| 79 // Closes the file with |resource_id|. | 79 // Closes the file with |local_id|. |
| 80 void CloseFile(const std::string& resource_id); | 80 void CloseFile(const std::string& local_id); |
| 81 | 81 |
| 82 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 82 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 83 OperationObserver* observer_; | 83 OperationObserver* observer_; |
| 84 internal::FileCache* cache_; | 84 internal::FileCache* cache_; |
| 85 | 85 |
| 86 scoped_ptr<CreateFileOperation> create_file_operation_; | 86 scoped_ptr<CreateFileOperation> create_file_operation_; |
| 87 scoped_ptr<DownloadOperation> download_operation_; | 87 scoped_ptr<DownloadOperation> download_operation_; |
| 88 | 88 |
| 89 // The map from resource id for an opened file to the number how many times | 89 // The map from local id for an opened file to the number how many times |
| 90 // the file is opened. | 90 // the file is opened. |
| 91 std::map<std::string, int> open_files_; | 91 std::map<std::string, int> open_files_; |
| 92 | 92 |
| 93 // Note: This should remain the last member so it'll be destroyed and | 93 // Note: This should remain the last member so it'll be destroyed and |
| 94 // invalidate its weak pointers before any other members are destroyed. | 94 // invalidate its weak pointers before any other members are destroyed. |
| 95 base::WeakPtrFactory<OpenFileOperation> weak_ptr_factory_; | 95 base::WeakPtrFactory<OpenFileOperation> weak_ptr_factory_; |
| 96 DISALLOW_COPY_AND_ASSIGN(OpenFileOperation); | 96 DISALLOW_COPY_AND_ASSIGN(OpenFileOperation); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } // namespace file_system | 99 } // namespace file_system |
| 100 } // namespace drive | 100 } // namespace drive |
| 101 | 101 |
| 102 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPEN_FILE_OPERATION_H_ | 102 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPEN_FILE_OPERATION_H_ |
| OLD | NEW |