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

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

Issue 513683002: [fsp] Add support for providing thumbnails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a test. Created 6 years, 4 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 cf2a02a89c1784f71e2873ad56f09ea933d76a79..f19f176344b43abdbfefb361556762f2baab8f89 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
@@ -10,6 +10,7 @@
#include <vector>
#include "base/callback.h"
+#include "base/memory/linked_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/task/cancelable_task_tracker.h"
#include "chrome/browser/chromeos/file_system_provider/provided_file_system_info.h"
@@ -36,15 +37,15 @@ extern const char kFakeFilePath[];
// Represents a file or a directory on a fake file system.
struct FakeEntry {
- FakeEntry() {}
+ FakeEntry();
+ FakeEntry(scoped_ptr<EntryMetadata> metadata, const std::string& contents);
+ ~FakeEntry();
- FakeEntry(const EntryMetadata& metadata, const std::string& contents)
- : metadata(metadata), contents(contents) {}
-
- virtual ~FakeEntry() {}
-
- EntryMetadata metadata;
+ scoped_ptr<EntryMetadata> metadata;
std::string contents;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(FakeEntry);
};
// Fake provided file system implementation. Does not communicate with target
@@ -65,15 +66,16 @@ class FakeProvidedFileSystem : public ProvidedFileSystemInterface {
std::string contents);
// Fetches a pointer to a fake entry registered in the fake file system. If
- // found, then the result is written to |fake_entry| and true is returned.
- // Otherwise, false is returned. |fake_entry| must not be NULL.
- bool GetEntry(const base::FilePath& entry_path, FakeEntry* fake_entry) const;
+ // not found, then returns NULL. The returned pointes is owned by
+ // FakeProvidedFileSystem.
+ const FakeEntry* GetEntry(const base::FilePath& entry_path) const;
// ProvidedFileSystemInterface overrides.
virtual AbortCallback RequestUnmount(
const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
virtual AbortCallback GetMetadata(
const base::FilePath& entry_path,
+ ProvidedFileSystemInterface::MetadataFieldMask fields,
const ProvidedFileSystemInterface::GetMetadataCallback& callback)
OVERRIDE;
virtual AbortCallback ReadDirectory(
@@ -132,7 +134,7 @@ class FakeProvidedFileSystem : public ProvidedFileSystemInterface {
const ProvidedFileSystemInfo& file_system_info);
private:
- typedef std::map<base::FilePath, FakeEntry> Entries;
+ typedef std::map<base::FilePath, linked_ptr<FakeEntry> > Entries;
typedef std::map<int, base::FilePath> OpenedFilesMap;
// Utility function for posting a task which can be aborted by calling the

Powered by Google App Engine
This is Rietveld 408576698