| 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_INTERF
ACE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERF
ACE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERF
ACE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERF
ACE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Interface for a provided file system. Acts as a proxy between providers | 26 // Interface for a provided file system. Acts as a proxy between providers |
| 27 // and clients. | 27 // and clients. |
| 28 // TODO(mtomasz): Add more methods once implemented. | 28 // TODO(mtomasz): Add more methods once implemented. |
| 29 class ProvidedFileSystemInterface { | 29 class ProvidedFileSystemInterface { |
| 30 public: | 30 public: |
| 31 typedef base::Callback<void(int file_handle, base::File::Error result)> | 31 typedef base::Callback<void(int file_handle, base::File::Error result)> |
| 32 OpenFileCallback; | 32 OpenFileCallback; |
| 33 | 33 |
| 34 typedef base::Callback< | 34 typedef base::Callback< |
| 35 void(int chunk_length, bool has_next, base::File::Error result)> | 35 void(int chunk_length, bool has_more, base::File::Error result)> |
| 36 ReadChunkReceivedCallback; | 36 ReadChunkReceivedCallback; |
| 37 | 37 |
| 38 // Mode of opening a file. Used by OpenFile(). | 38 // Mode of opening a file. Used by OpenFile(). |
| 39 enum OpenFileMode { OPEN_FILE_MODE_READ, OPEN_FILE_MODE_WRITE }; | 39 enum OpenFileMode { OPEN_FILE_MODE_READ, OPEN_FILE_MODE_WRITE }; |
| 40 | 40 |
| 41 virtual ~ProvidedFileSystemInterface() {} | 41 virtual ~ProvidedFileSystemInterface() {} |
| 42 | 42 |
| 43 // Requests unmounting of the file system. The callback is called when the | 43 // Requests unmounting of the file system. The callback is called when the |
| 44 // request is accepted or rejected, with an error code. | 44 // request is accepted or rejected, with an error code. |
| 45 virtual void RequestUnmount( | 45 virtual void RequestUnmount( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 virtual RequestManager* GetRequestManager() = 0; | 87 virtual RequestManager* GetRequestManager() = 0; |
| 88 | 88 |
| 89 // Returns a weak pointer to this object. | 89 // Returns a weak pointer to this object. |
| 90 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() = 0; | 90 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() = 0; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace file_system_provider | 93 } // namespace file_system_provider |
| 94 } // namespace chromeos | 94 } // namespace chromeos |
| 95 | 95 |
| 96 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INT
ERFACE_H_ | 96 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INT
ERFACE_H_ |
| OLD | NEW |