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

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

Issue 1432403003: Do not call stat() when reading directories via File API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Whitespace cleanup. Created 5 years, 1 month 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_task_helper.h
diff --git a/chrome/browser/media_galleries/linux/mtp_device_task_helper.h b/chrome/browser/media_galleries/linux/mtp_device_task_helper.h
index c21c8527067fd17344469650b0f599733e9a71d8..491848af637a22992758c32f07b5612b167f068c 100644
--- a/chrome/browser/media_galleries/linux/mtp_device_task_helper.h
+++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper.h
@@ -26,6 +26,15 @@ struct SnapshotRequestInfo;
// MTP device storage.
class MTPDeviceTaskHelper {
public:
+ struct MTPEntry {
+ MTPEntry();
Lei Zhang 2015/11/12 07:25:17 blank line after
mtomasz 2015/11/12 07:48:24 Done.
+ uint32 file_id;
Lei Zhang 2015/11/12 07:25:17 uint32_t in new code.
mtomasz 2015/11/12 07:48:24 Oops. Done.
+ std::string name;
+ base::File::Info file_info;
+ };
+
+ typedef std::vector<MTPEntry> MTPEntries;
Lei Zhang 2015/11/12 07:25:17 Can we use "using foo = bar" in new code?
mtomasz 2015/11/12 07:48:24 I think we can, but it would be very inconsistent
Lei Zhang 2015/11/12 07:56:48 Ok, no worries.
+
typedef base::Callback<void(bool succeeded)> OpenStorageCallback;
typedef MTPDeviceAsyncDelegate::GetFileInfoSuccessCallback
@@ -33,10 +42,8 @@ class MTPDeviceTaskHelper {
typedef base::Closure CreateDirectorySuccessCallback;
- // NOTE: The file names in the entry list have their file id appended at the
- // end. e.g. foo.jpg with file id 45 becomes foo.jpg,45.
- typedef base::Callback<void(const storage::AsyncFileUtil::EntryList& entries,
- bool has_more)> ReadDirectorySuccessCallback;
+ typedef base::Callback<void(const MTPEntries& entries, bool has_more)>
+ ReadDirectorySuccessCallback;
typedef base::Closure RenameObjectSuccessCallback;

Powered by Google App Engine
This is Rietveld 408576698