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

Unified Diff: chrome/browser/media_gallery/linux/mtp_recursive_device_object_enumerator.h

Issue 11855005: [Linux, Media Gallery] Fix MTPRecursiveDeviceObjectEnumerator to recursively enumerate all the medi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments Created 7 years, 11 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_gallery/linux/mtp_recursive_device_object_enumerator.h
diff --git a/chrome/browser/media_gallery/linux/mtp_recursive_device_object_enumerator.h b/chrome/browser/media_gallery/linux/mtp_recursive_device_object_enumerator.h
index 13b5910198f9f5cddf465f0a9115c28648760a59..74a0cfeed67f39b57b5d3fa05cef516214c25d07 100644
--- a/chrome/browser/media_gallery/linux/mtp_recursive_device_object_enumerator.h
+++ b/chrome/browser/media_gallery/linux/mtp_recursive_device_object_enumerator.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_MEDIA_GALLERY_LINUX_MTP_RECURSIVE_DEVICE_OBJECT_ENUMERATOR_H_
#define CHROME_BROWSER_MEDIA_GALLERY_LINUX_MTP_RECURSIVE_DEVICE_OBJECT_ENUMERATOR_H_
+#include <queue>
#include <string>
#include <vector>
@@ -40,6 +41,10 @@ class MTPRecursiveDeviceObjectEnumerator
virtual base::Time LastModifiedTime() OVERRIDE;
private:
+ typedef uint32_t DirectoryEntryId;
+
+ void UpdateEnumeratorToTraverseSubdirectory();
+
// Stores the device handle that was used to open the device.
const std::string device_handle_;
@@ -47,16 +52,13 @@ class MTPRecursiveDeviceObjectEnumerator
// ReadMTPDirectoryWorker object on the correct thread.
scoped_refptr<base::SequencedTaskRunner> media_task_runner_;
- // List of top-level directory file entries.
- const std::vector<MtpFileEntry> file_entries_;
-
- // Iterator to access the individual file entries.
- std::vector<MtpFileEntry>::const_iterator file_entry_iter_;
-
// Enumerator to access current directory Id/path entries.
scoped_ptr<fileapi::FileSystemFileUtil::AbstractFileEnumerator>
current_enumerator_;
+ // Queue of untraversed directories.
+ std::queue<DirectoryEntryId> untraversed_directory_entry_ids_;
+
// |media_task_runner_| can wait on this event until the requested operation
// is complete.
base::WaitableEvent* on_task_completed_event_;

Powered by Google App Engine
This is Rietveld 408576698