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_FAKE_PROVIDED_FILE_SYSTEM_H
_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTEM_H
_ |
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTEM_H
_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTEM_H
_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" | 10 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" |
11 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" | 11 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" |
12 | 12 |
| 13 namespace net { |
| 14 class IOBuffer; |
| 15 } // namespace net |
| 16 |
13 namespace extensions { | 17 namespace extensions { |
14 class EventRouter; | 18 class EventRouter; |
15 } // namespace extensions | 19 } // namespace extensions |
16 | 20 |
17 namespace chromeos { | 21 namespace chromeos { |
18 namespace file_system_provider { | 22 namespace file_system_provider { |
19 | 23 |
20 class RequestManager; | 24 class RequestManager; |
21 | 25 |
22 // Fake provided file system implementation. Does not communicate with target | 26 // Fake provided file system implementation. Does not communicate with target |
(...skipping 13 matching lines...) Expand all Loading... |
36 virtual void ReadDirectory( | 40 virtual void ReadDirectory( |
37 const base::FilePath& directory_path, | 41 const base::FilePath& directory_path, |
38 const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) OVERRIDE; | 42 const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) OVERRIDE; |
39 virtual void OpenFile(const base::FilePath& file_path, | 43 virtual void OpenFile(const base::FilePath& file_path, |
40 OpenFileMode mode, | 44 OpenFileMode mode, |
41 bool create, | 45 bool create, |
42 const OpenFileCallback& callback) OVERRIDE; | 46 const OpenFileCallback& callback) OVERRIDE; |
43 virtual void CloseFile( | 47 virtual void CloseFile( |
44 int file_handle, | 48 int file_handle, |
45 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 49 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 50 virtual void ReadFile(int file_handle, |
| 51 net::IOBuffer* buffer, |
| 52 int64 offset, |
| 53 int length, |
| 54 const ReadChunkReceivedCallback& callback) OVERRIDE; |
46 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; | 55 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; |
47 virtual RequestManager* GetRequestManager() OVERRIDE; | 56 virtual RequestManager* GetRequestManager() OVERRIDE; |
48 | 57 |
49 // Factory callback, to be used in Service::SetFileSystemFactory(). The | 58 // Factory callback, to be used in Service::SetFileSystemFactory(). The |
50 // |event_router| argument can be NULL. | 59 // |event_router| argument can be NULL. |
51 static ProvidedFileSystemInterface* Create( | 60 static ProvidedFileSystemInterface* Create( |
52 extensions::EventRouter* event_router, | 61 extensions::EventRouter* event_router, |
53 const ProvidedFileSystemInfo& file_system_info); | 62 const ProvidedFileSystemInfo& file_system_info); |
54 | 63 |
55 private: | 64 private: |
56 ProvidedFileSystemInfo file_system_info_; | 65 ProvidedFileSystemInfo file_system_info_; |
57 std::set<int> opened_files_; | 66 std::set<int> opened_files_; |
58 int last_file_handle_; | 67 int last_file_handle_; |
59 | 68 |
60 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem); | 69 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem); |
61 }; | 70 }; |
62 | 71 |
63 } // namespace file_system_provider | 72 } // namespace file_system_provider |
64 } // namespace chromeos | 73 } // namespace chromeos |
65 | 74 |
66 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE
M_H_ | 75 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE
M_H_ |
OLD | NEW |