| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 fileapi::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( |
| 61 const base::FilePath& directory_path, |
| 62 bool exclusive, |
| 63 bool recursive, |
| 64 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
| 60 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; | 65 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; |
| 61 virtual RequestManager* GetRequestManager() OVERRIDE; | 66 virtual RequestManager* GetRequestManager() OVERRIDE; |
| 62 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; | 67 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; |
| 63 | 68 |
| 64 // Factory callback, to be used in Service::SetFileSystemFactory(). The | 69 // Factory callback, to be used in Service::SetFileSystemFactory(). The |
| 65 // |event_router| argument can be NULL. | 70 // |event_router| argument can be NULL. |
| 66 static ProvidedFileSystemInterface* Create( | 71 static ProvidedFileSystemInterface* Create( |
| 67 Profile* profile, | 72 Profile* profile, |
| 68 const ProvidedFileSystemInfo& file_system_info); | 73 const ProvidedFileSystemInfo& file_system_info); |
| 69 | 74 |
| 70 private: | 75 private: |
| 71 typedef std::map<int, base::FilePath> OpenedFilesMap; | 76 typedef std::map<int, base::FilePath> OpenedFilesMap; |
| 72 | 77 |
| 73 ProvidedFileSystemInfo file_system_info_; | 78 ProvidedFileSystemInfo file_system_info_; |
| 74 OpenedFilesMap opened_files_; | 79 OpenedFilesMap opened_files_; |
| 75 int last_file_handle_; | 80 int last_file_handle_; |
| 76 | 81 |
| 77 base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_; | 82 base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_; |
| 78 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem); | 83 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem); |
| 79 }; | 84 }; |
| 80 | 85 |
| 81 } // namespace file_system_provider | 86 } // namespace file_system_provider |
| 82 } // namespace chromeos | 87 } // namespace chromeos |
| 83 | 88 |
| 84 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE
M_H_ | 89 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE
M_H_ |
| OLD | NEW |