| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROVIDED_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" | 9 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" |
| 10 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" | 10 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" |
| 11 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" | 11 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" |
| 12 #include "webkit/browser/fileapi/async_file_util.h" | 12 #include "storage/browser/fileapi/async_file_util.h" |
| 13 | 13 |
| 14 class Profile; | 14 class Profile; |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 class IOBuffer; | 17 class IOBuffer; |
| 18 } // namespace net | 18 } // namespace net |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class FilePath; | 21 class FilePath; |
| 22 } // namespace base | 22 } // namespace base |
| (...skipping 10 matching lines...) Expand all Loading... |
| 33 // Provided file system implementation. Forwards requests between providers and | 33 // Provided file system implementation. Forwards requests between providers and |
| 34 // clients. | 34 // clients. |
| 35 class ProvidedFileSystem : public ProvidedFileSystemInterface { | 35 class ProvidedFileSystem : public ProvidedFileSystemInterface { |
| 36 public: | 36 public: |
| 37 ProvidedFileSystem(Profile* profile, | 37 ProvidedFileSystem(Profile* profile, |
| 38 const ProvidedFileSystemInfo& file_system_info); | 38 const ProvidedFileSystemInfo& file_system_info); |
| 39 virtual ~ProvidedFileSystem(); | 39 virtual ~ProvidedFileSystem(); |
| 40 | 40 |
| 41 // ProvidedFileSystemInterface overrides. | 41 // ProvidedFileSystemInterface overrides. |
| 42 virtual void RequestUnmount( | 42 virtual void RequestUnmount( |
| 43 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 43 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 44 virtual void GetMetadata(const base::FilePath& entry_path, | 44 virtual void GetMetadata(const base::FilePath& entry_path, |
| 45 const GetMetadataCallback& callback) OVERRIDE; | 45 const GetMetadataCallback& callback) OVERRIDE; |
| 46 virtual void ReadDirectory( | 46 virtual void ReadDirectory( |
| 47 const base::FilePath& directory_path, | 47 const base::FilePath& directory_path, |
| 48 const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) OVERRIDE; | 48 const storage::AsyncFileUtil::ReadDirectoryCallback& callback) OVERRIDE; |
| 49 virtual void OpenFile(const base::FilePath& file_path, | 49 virtual void OpenFile(const base::FilePath& file_path, |
| 50 OpenFileMode mode, | 50 OpenFileMode mode, |
| 51 const OpenFileCallback& callback) OVERRIDE; | 51 const OpenFileCallback& callback) OVERRIDE; |
| 52 virtual void CloseFile( | 52 virtual void CloseFile( |
| 53 int file_handle, | 53 int file_handle, |
| 54 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 54 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 55 virtual void ReadFile(int file_handle, | 55 virtual void ReadFile(int file_handle, |
| 56 net::IOBuffer* buffer, | 56 net::IOBuffer* buffer, |
| 57 int64 offset, | 57 int64 offset, |
| 58 int length, | 58 int length, |
| 59 const ReadChunkReceivedCallback& callback) OVERRIDE; | 59 const ReadChunkReceivedCallback& callback) OVERRIDE; |
| 60 virtual void CreateDirectory( | 60 virtual void CreateDirectory( |
| 61 const base::FilePath& directory_path, | 61 const base::FilePath& directory_path, |
| 62 bool exclusive, | 62 bool exclusive, |
| 63 bool recursive, | 63 bool recursive, |
| 64 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 64 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 65 virtual void DeleteEntry( | 65 virtual void DeleteEntry( |
| 66 const base::FilePath& entry_path, | 66 const base::FilePath& entry_path, |
| 67 bool recursive, | 67 bool recursive, |
| 68 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 68 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 69 virtual void CreateFile( | 69 virtual void CreateFile( |
| 70 const base::FilePath& file_path, | 70 const base::FilePath& file_path, |
| 71 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 71 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 72 virtual void CopyEntry( | 72 virtual void CopyEntry( |
| 73 const base::FilePath& source_path, | 73 const base::FilePath& source_path, |
| 74 const base::FilePath& target_path, | 74 const base::FilePath& target_path, |
| 75 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 75 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 76 virtual void MoveEntry( | 76 virtual void MoveEntry( |
| 77 const base::FilePath& source_path, | 77 const base::FilePath& source_path, |
| 78 const base::FilePath& target_path, | 78 const base::FilePath& target_path, |
| 79 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 79 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 80 virtual void Truncate( | 80 virtual void Truncate( |
| 81 const base::FilePath& file_path, | 81 const base::FilePath& file_path, |
| 82 int64 length, | 82 int64 length, |
| 83 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 83 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 84 virtual void WriteFile( | 84 virtual void WriteFile( |
| 85 int file_handle, | 85 int file_handle, |
| 86 net::IOBuffer* buffer, | 86 net::IOBuffer* buffer, |
| 87 int64 offset, | 87 int64 offset, |
| 88 int length, | 88 int length, |
| 89 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 89 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 90 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; | 90 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; |
| 91 virtual RequestManager* GetRequestManager() OVERRIDE; | 91 virtual RequestManager* GetRequestManager() OVERRIDE; |
| 92 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; | 92 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 Profile* profile_; // Not owned. | 95 Profile* profile_; // Not owned. |
| 96 extensions::EventRouter* event_router_; // Not owned. May be NULL. | 96 extensions::EventRouter* event_router_; // Not owned. May be NULL. |
| 97 ProvidedFileSystemInfo file_system_info_; | 97 ProvidedFileSystemInfo file_system_info_; |
| 98 scoped_ptr<NotificationManagerInterface> notification_manager_; | 98 scoped_ptr<NotificationManagerInterface> notification_manager_; |
| 99 RequestManager request_manager_; | 99 RequestManager request_manager_; |
| 100 | 100 |
| 101 base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_; | 101 base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_; |
| 102 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem); | 102 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 } // namespace file_system_provider | 105 } // namespace file_system_provider |
| 106 } // namespace chromeos | 106 } // namespace chromeos |
| 107 | 107 |
| 108 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ | 108 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ |
| OLD | NEW |