| 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 <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 bool create, | 51 bool create, |
| 52 const OpenFileCallback& callback) OVERRIDE; | 52 const OpenFileCallback& callback) OVERRIDE; |
| 53 virtual void CloseFile( | 53 virtual void CloseFile( |
| 54 int file_handle, | 54 int file_handle, |
| 55 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 55 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 56 virtual void ReadFile(int file_handle, | 56 virtual void ReadFile(int file_handle, |
| 57 net::IOBuffer* buffer, | 57 net::IOBuffer* buffer, |
| 58 int64 offset, | 58 int64 offset, |
| 59 int length, | 59 int length, |
| 60 const ReadChunkReceivedCallback& callback) OVERRIDE; | 60 const ReadChunkReceivedCallback& callback) OVERRIDE; |
| 61 virtual void CreateDirectory( |
| 62 const base::FilePath& directory_path, |
| 63 bool exclusive, |
| 64 bool recursive, |
| 65 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 61 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; | 66 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; |
| 62 virtual RequestManager* GetRequestManager() OVERRIDE; | 67 virtual RequestManager* GetRequestManager() OVERRIDE; |
| 63 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; | 68 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; |
| 64 | 69 |
| 65 // Factory callback, to be used in Service::SetFileSystemFactory(). The | 70 // Factory callback, to be used in Service::SetFileSystemFactory(). The |
| 66 // |event_router| argument can be NULL. | 71 // |event_router| argument can be NULL. |
| 67 static ProvidedFileSystemInterface* Create( | 72 static ProvidedFileSystemInterface* Create( |
| 68 Profile* profile, | 73 Profile* profile, |
| 69 const ProvidedFileSystemInfo& file_system_info); | 74 const ProvidedFileSystemInfo& file_system_info); |
| 70 | 75 |
| 71 private: | 76 private: |
| 72 typedef std::map<int, base::FilePath> OpenedFilesMap; | 77 typedef std::map<int, base::FilePath> OpenedFilesMap; |
| 73 | 78 |
| 74 ProvidedFileSystemInfo file_system_info_; | 79 ProvidedFileSystemInfo file_system_info_; |
| 75 OpenedFilesMap opened_files_; | 80 OpenedFilesMap opened_files_; |
| 76 int last_file_handle_; | 81 int last_file_handle_; |
| 77 | 82 |
| 78 base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_; | 83 base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_; |
| 79 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem); | 84 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem); |
| 80 }; | 85 }; |
| 81 | 86 |
| 82 } // namespace file_system_provider | 87 } // namespace file_system_provider |
| 83 } // namespace chromeos | 88 } // namespace chromeos |
| 84 | 89 |
| 85 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE
M_H_ | 90 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE
M_H_ |
| OLD | NEW |