Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5405)

Unified Diff: chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h

Issue 288113004: [fsp] Add FileStreamReader for the reading operation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h
diff --git a/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h
index 3401dc0f0963e8244fdb562a955630cd58bbd396..18feb7bb233c9e82c47336c8332ca1dfbf48b394 100644
--- a/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h
+++ b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h
@@ -5,8 +5,9 @@
#ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTEM_H_
#define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTEM_H_
-#include <set>
+#include <map>
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/file_system_provider/provided_file_system_info.h"
#include "chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h"
@@ -23,6 +24,11 @@ namespace file_system_provider {
class RequestManager;
+extern const char kFakeFileName[];
+extern const char kFakeFilePath[];
+extern const char kFakeFileText[];
+extern const size_t kFakeFileSize;
+
// Fake provided file system implementation. Does not communicate with target
// extensions. Used for unit tests.
class FakeProvidedFileSystem : public ProvidedFileSystemInterface {
@@ -54,6 +60,7 @@ class FakeProvidedFileSystem : public ProvidedFileSystemInterface {
const ReadChunkReceivedCallback& callback) OVERRIDE;
virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE;
virtual RequestManager* GetRequestManager() OVERRIDE;
+ virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE;
// Factory callback, to be used in Service::SetFileSystemFactory(). The
// |event_router| argument can be NULL.
@@ -62,10 +69,13 @@ class FakeProvidedFileSystem : public ProvidedFileSystemInterface {
const ProvidedFileSystemInfo& file_system_info);
private:
+ typedef std::map<int, base::FilePath> OpenedFilesMap;
+
ProvidedFileSystemInfo file_system_info_;
- std::set<int> opened_files_;
+ OpenedFilesMap opened_files_;
int last_file_handle_;
+ base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem);
};

Powered by Google App Engine
This is Rietveld 408576698