| 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 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/task/cancelable_task_tracker.h" | 16 #include "base/task/cancelable_task_tracker.h" |
| 17 #include "chrome/browser/chromeos/file_system_provider/observed_entry.h" | |
| 18 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" | 17 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" |
| 19 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" | 18 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" |
| 20 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_obse
rver.h" | 19 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_obse
rver.h" |
| 20 #include "chrome/browser/chromeos/file_system_provider/watcher.h" |
| 21 #include "url/gurl.h" | 21 #include "url/gurl.h" |
| 22 | 22 |
| 23 class Profile; | 23 class Profile; |
| 24 | 24 |
| 25 namespace base { | 25 namespace base { |
| 26 class Time; | 26 class Time; |
| 27 } // namespace base | 27 } // namespace base |
| 28 | 28 |
| 29 namespace net { | 29 namespace net { |
| 30 class IOBuffer; | 30 class IOBuffer; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 virtual AbortCallback Truncate( | 119 virtual AbortCallback Truncate( |
| 120 const base::FilePath& file_path, | 120 const base::FilePath& file_path, |
| 121 int64 length, | 121 int64 length, |
| 122 const storage::AsyncFileUtil::StatusCallback& callback) override; | 122 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 123 virtual AbortCallback WriteFile( | 123 virtual AbortCallback WriteFile( |
| 124 int file_handle, | 124 int file_handle, |
| 125 net::IOBuffer* buffer, | 125 net::IOBuffer* buffer, |
| 126 int64 offset, | 126 int64 offset, |
| 127 int length, | 127 int length, |
| 128 const storage::AsyncFileUtil::StatusCallback& callback) override; | 128 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 129 virtual AbortCallback ObserveDirectory( | 129 virtual AbortCallback AddWatcher( |
| 130 const GURL& origin, | 130 const GURL& origin, |
| 131 const base::FilePath& directory_path, | 131 const base::FilePath& entry_path, |
| 132 bool recursive, | 132 bool recursive, |
| 133 bool persistent, | 133 bool persistent, |
| 134 const storage::AsyncFileUtil::StatusCallback& callback) override; | 134 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 135 virtual void UnobserveEntry( | 135 virtual void RemoveWatcher( |
| 136 const GURL& origin, | 136 const GURL& origin, |
| 137 const base::FilePath& entry_path, | 137 const base::FilePath& entry_path, |
| 138 bool recursive, | 138 bool recursive, |
| 139 const storage::AsyncFileUtil::StatusCallback& callback) override; | 139 const storage::AsyncFileUtil::StatusCallback& callback) override; |
| 140 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const override; | 140 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const override; |
| 141 virtual RequestManager* GetRequestManager() override; | 141 virtual RequestManager* GetRequestManager() override; |
| 142 virtual ObservedEntries* GetObservedEntries() override; | 142 virtual Watchers* GetWatchers() override; |
| 143 virtual void AddObserver(ProvidedFileSystemObserver* observer) override; | 143 virtual void AddObserver(ProvidedFileSystemObserver* observer) override; |
| 144 virtual void RemoveObserver(ProvidedFileSystemObserver* observer) override; | 144 virtual void RemoveObserver(ProvidedFileSystemObserver* observer) override; |
| 145 virtual bool Notify(const base::FilePath& observed_path, | 145 virtual bool Notify(const base::FilePath& entry_path, |
| 146 bool recursive, | 146 bool recursive, |
| 147 ProvidedFileSystemObserver::ChangeType change_type, | 147 ProvidedFileSystemObserver::ChangeType change_type, |
| 148 scoped_ptr<ProvidedFileSystemObserver::Changes> changes, | 148 scoped_ptr<ProvidedFileSystemObserver::Changes> changes, |
| 149 const std::string& tag) override; | 149 const std::string& tag) override; |
| 150 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() override; | 150 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() override; |
| 151 | 151 |
| 152 // Factory callback, to be used in Service::SetFileSystemFactory(). The | 152 // Factory callback, to be used in Service::SetFileSystemFactory(). The |
| 153 // |event_router| argument can be NULL. | 153 // |event_router| argument can be NULL. |
| 154 static ProvidedFileSystemInterface* Create( | 154 static ProvidedFileSystemInterface* Create( |
| 155 Profile* profile, | 155 Profile* profile, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 173 // called. | 173 // called. |
| 174 void AbortMany(const std::vector<int>& task_ids, | 174 void AbortMany(const std::vector<int>& task_ids, |
| 175 const storage::AsyncFileUtil::StatusCallback& callback); | 175 const storage::AsyncFileUtil::StatusCallback& callback); |
| 176 | 176 |
| 177 ProvidedFileSystemInfo file_system_info_; | 177 ProvidedFileSystemInfo file_system_info_; |
| 178 Entries entries_; | 178 Entries entries_; |
| 179 OpenedFilesMap opened_files_; | 179 OpenedFilesMap opened_files_; |
| 180 int last_file_handle_; | 180 int last_file_handle_; |
| 181 base::CancelableTaskTracker tracker_; | 181 base::CancelableTaskTracker tracker_; |
| 182 ObserverList<ProvidedFileSystemObserver> observers_; | 182 ObserverList<ProvidedFileSystemObserver> observers_; |
| 183 ObservedEntries observed_entries_; | 183 Watchers watchers_; |
| 184 | 184 |
| 185 base::WeakPtrFactory<FakeProvidedFileSystem> weak_ptr_factory_; | 185 base::WeakPtrFactory<FakeProvidedFileSystem> weak_ptr_factory_; |
| 186 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem); | 186 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem); |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 } // namespace file_system_provider | 189 } // namespace file_system_provider |
| 190 } // namespace chromeos | 190 } // namespace chromeos |
| 191 | 191 |
| 192 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE
M_H_ | 192 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE
M_H_ |
| OLD | NEW |