| 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" |
| (...skipping 22 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 AbortCallback RequestUnmount( | 42 virtual AbortCallback RequestUnmount( |
| 43 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 43 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 44 virtual AbortCallback GetMetadata( | 44 virtual AbortCallback GetMetadata( |
| 45 const base::FilePath& entry_path, | 45 const base::FilePath& entry_path, |
| 46 MetadataFieldMask fields, | 46 MetadataFieldMask fields, |
| 47 const GetMetadataCallback& callback) OVERRIDE; | 47 const GetMetadataCallback& callback) override; |
| 48 virtual AbortCallback ReadDirectory( | 48 virtual AbortCallback ReadDirectory( |
| 49 const base::FilePath& directory_path, | 49 const base::FilePath& directory_path, |
| 50 const storage::AsyncFileUtil::ReadDirectoryCallback& callback) OVERRIDE; | 50 const storage::AsyncFileUtil::ReadDirectoryCallback& callback) override; |
| 51 virtual AbortCallback OpenFile(const base::FilePath& file_path, | 51 virtual AbortCallback OpenFile(const base::FilePath& file_path, |
| 52 OpenFileMode mode, | 52 OpenFileMode mode, |
| 53 const OpenFileCallback& callback) OVERRIDE; | 53 const OpenFileCallback& callback) override; |
| 54 virtual AbortCallback CloseFile( | 54 virtual AbortCallback CloseFile( |
| 55 int file_handle, | 55 int file_handle, |
| 56 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 56 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 57 virtual AbortCallback ReadFile( | 57 virtual AbortCallback ReadFile( |
| 58 int file_handle, | 58 int file_handle, |
| 59 net::IOBuffer* buffer, | 59 net::IOBuffer* buffer, |
| 60 int64 offset, | 60 int64 offset, |
| 61 int length, | 61 int length, |
| 62 const ReadChunkReceivedCallback& callback) OVERRIDE; | 62 const ReadChunkReceivedCallback& callback) override; |
| 63 virtual AbortCallback CreateDirectory( | 63 virtual AbortCallback CreateDirectory( |
| 64 const base::FilePath& directory_path, | 64 const base::FilePath& directory_path, |
| 65 bool recursive, | 65 bool recursive, |
| 66 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 66 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 67 virtual AbortCallback DeleteEntry( | 67 virtual AbortCallback DeleteEntry( |
| 68 const base::FilePath& entry_path, | 68 const base::FilePath& entry_path, |
| 69 bool recursive, | 69 bool recursive, |
| 70 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 70 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 71 virtual AbortCallback CreateFile( | 71 virtual AbortCallback CreateFile( |
| 72 const base::FilePath& file_path, | 72 const base::FilePath& file_path, |
| 73 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 73 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 74 virtual AbortCallback CopyEntry( | 74 virtual AbortCallback CopyEntry( |
| 75 const base::FilePath& source_path, | 75 const base::FilePath& source_path, |
| 76 const base::FilePath& target_path, | 76 const base::FilePath& target_path, |
| 77 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 77 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 78 virtual AbortCallback MoveEntry( | 78 virtual AbortCallback MoveEntry( |
| 79 const base::FilePath& source_path, | 79 const base::FilePath& source_path, |
| 80 const base::FilePath& target_path, | 80 const base::FilePath& target_path, |
| 81 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 81 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 82 virtual AbortCallback Truncate( | 82 virtual AbortCallback Truncate( |
| 83 const base::FilePath& file_path, | 83 const base::FilePath& file_path, |
| 84 int64 length, | 84 int64 length, |
| 85 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 85 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 86 virtual AbortCallback WriteFile( | 86 virtual AbortCallback WriteFile( |
| 87 int file_handle, | 87 int file_handle, |
| 88 net::IOBuffer* buffer, | 88 net::IOBuffer* buffer, |
| 89 int64 offset, | 89 int64 offset, |
| 90 int length, | 90 int length, |
| 91 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 91 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 92 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; | 92 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const override; |
| 93 virtual RequestManager* GetRequestManager() OVERRIDE; | 93 virtual RequestManager* GetRequestManager() override; |
| 94 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; | 94 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() override; |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 // Aborts an operation executed with a request id equal to | 97 // Aborts an operation executed with a request id equal to |
| 98 // |operation_request_id|. The request is removed immediately on the C++ side | 98 // |operation_request_id|. The request is removed immediately on the C++ side |
| 99 // despite being handled by the providing extension or not. | 99 // despite being handled by the providing extension or not. |
| 100 void Abort(int operation_request_id, | 100 void Abort(int operation_request_id, |
| 101 const storage::AsyncFileUtil::StatusCallback& callback); | 101 const storage::AsyncFileUtil::StatusCallback& callback); |
| 102 | 102 |
| 103 Profile* profile_; // Not owned. | 103 Profile* profile_; // Not owned. |
| 104 extensions::EventRouter* event_router_; // Not owned. May be NULL. | 104 extensions::EventRouter* event_router_; // Not owned. May be NULL. |
| 105 ProvidedFileSystemInfo file_system_info_; | 105 ProvidedFileSystemInfo file_system_info_; |
| 106 scoped_ptr<NotificationManagerInterface> notification_manager_; | 106 scoped_ptr<NotificationManagerInterface> notification_manager_; |
| 107 RequestManager request_manager_; | 107 RequestManager request_manager_; |
| 108 | 108 |
| 109 base::WeakPtrFactory<ProvidedFileSystem> weak_ptr_factory_; | 109 base::WeakPtrFactory<ProvidedFileSystem> weak_ptr_factory_; |
| 110 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem); | 110 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem); |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 } // namespace file_system_provider | 113 } // namespace file_system_provider |
| 114 } // namespace chromeos | 114 } // namespace chromeos |
| 115 | 115 |
| 116 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ | 116 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ |
| OLD | NEW |