| 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" |
| 11 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" | 11 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" |
| 12 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" | 12 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" |
| 13 | 13 |
| 14 class Profile; |
| 15 |
| 14 namespace net { | 16 namespace net { |
| 15 class IOBuffer; | 17 class IOBuffer; |
| 16 } // namespace net | 18 } // namespace net |
| 17 | 19 |
| 18 namespace extensions { | |
| 19 class EventRouter; | |
| 20 } // namespace extensions | |
| 21 | |
| 22 namespace chromeos { | 20 namespace chromeos { |
| 23 namespace file_system_provider { | 21 namespace file_system_provider { |
| 24 | 22 |
| 25 class RequestManager; | 23 class RequestManager; |
| 26 | 24 |
| 27 extern const char kFakeFileName[]; | 25 extern const char kFakeFileName[]; |
| 28 extern const char kFakeFilePath[]; | 26 extern const char kFakeFilePath[]; |
| 29 extern const char kFakeFileText[]; | 27 extern const char kFakeFileText[]; |
| 30 extern const size_t kFakeFileSize; | 28 extern const size_t kFakeFileSize; |
| 31 | 29 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 58 int64 offset, | 56 int64 offset, |
| 59 int length, | 57 int length, |
| 60 const ReadChunkReceivedCallback& callback) OVERRIDE; | 58 const ReadChunkReceivedCallback& callback) OVERRIDE; |
| 61 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; | 59 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; |
| 62 virtual RequestManager* GetRequestManager() OVERRIDE; | 60 virtual RequestManager* GetRequestManager() OVERRIDE; |
| 63 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; | 61 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; |
| 64 | 62 |
| 65 // Factory callback, to be used in Service::SetFileSystemFactory(). The | 63 // Factory callback, to be used in Service::SetFileSystemFactory(). The |
| 66 // |event_router| argument can be NULL. | 64 // |event_router| argument can be NULL. |
| 67 static ProvidedFileSystemInterface* Create( | 65 static ProvidedFileSystemInterface* Create( |
| 68 extensions::EventRouter* event_router, | 66 Profile* profile, |
| 69 const ProvidedFileSystemInfo& file_system_info); | 67 const ProvidedFileSystemInfo& file_system_info); |
| 70 | 68 |
| 71 private: | 69 private: |
| 72 typedef std::map<int, base::FilePath> OpenedFilesMap; | 70 typedef std::map<int, base::FilePath> OpenedFilesMap; |
| 73 | 71 |
| 74 ProvidedFileSystemInfo file_system_info_; | 72 ProvidedFileSystemInfo file_system_info_; |
| 75 OpenedFilesMap opened_files_; | 73 OpenedFilesMap opened_files_; |
| 76 int last_file_handle_; | 74 int last_file_handle_; |
| 77 | 75 |
| 78 base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_; | 76 base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_; |
| 79 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem); | 77 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem); |
| 80 }; | 78 }; |
| 81 | 79 |
| 82 } // namespace file_system_provider | 80 } // namespace file_system_provider |
| 83 } // namespace chromeos | 81 } // namespace chromeos |
| 84 | 82 |
| 85 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE
M_H_ | 83 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE
M_H_ |
| OLD | NEW |