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

Unified Diff: chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h

Issue 495433002: Media Galleries: Cache file info during a directory read to service incoming requests to get file i… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix device path 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/media_galleries/linux/mtp_device_delegate_impl_linux.h
diff --git a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h
index 44d390dfd4bca66436487b4a4ba1bcb851fc0bfc..770c0603b0175e36fb345a518b9665baba214282 100644
--- a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h
+++ b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h
@@ -60,6 +60,9 @@ class MTPDeviceDelegateImplLinux : public MTPDeviceAsyncDelegate {
// Maps file ids to file nodes.
typedef std::map<uint32, MTPFileNode*> FileIdToMTPFileNodeMap;
+ // Maps file paths to file info.
+ typedef std::map<base::FilePath, fileapi::DirectoryEntry> FileInfoCache;
+
// Should only be called by CreateMTPDeviceAsyncDelegate() factory call.
// Defer the device initializations until the first file operation request.
// Do all the initializations in EnsureInitAndRunTask() function.
@@ -278,6 +281,11 @@ class MTPDeviceDelegateImplLinux : public MTPDeviceAsyncDelegate {
// can return results over multiple callbacks, is in progress.
std::set<std::string> child_nodes_seen_;
+ // A cache to store file metadata for file entries read during a ReadDirectory
+ // operation. Used to service incoming GetFileInfo calls for the duration of
+ // the ReadDirectory operation.
+ FileInfoCache file_info_cache_;
+
// For callbacks that may run after destruction.
base::WeakPtrFactory<MTPDeviceDelegateImplLinux> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698