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

Unified Diff: webkit/fileapi/media/filtering_file_enumerator.h

Issue 10823171: Add path filtering to DeviceMediaFileUtil (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: buildfix for windows Created 8 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
« no previous file with comments | « webkit/fileapi/media/device_media_file_util.cc ('k') | webkit/fileapi/media/filtering_file_enumerator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/media/filtering_file_enumerator.h
diff --git a/webkit/fileapi/media/filtering_file_enumerator.h b/webkit/fileapi/media/filtering_file_enumerator.h
new file mode 100644
index 0000000000000000000000000000000000000000..bda070847ffd071be8d28686f7aad84cfe51ab60
--- /dev/null
+++ b/webkit/fileapi/media/filtering_file_enumerator.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_FILEAPI_MEDIA_FILTERING_FILE_ENUMERATOR_H_
+#define WEBKIT_FILEAPI_MEDIA_FILTERING_FILE_ENUMERATOR_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "webkit/fileapi/file_system_file_util.h"
+#include "webkit/fileapi/fileapi_export.h"
+#include "webkit/fileapi/media/media_path_filter.h"
+
+namespace fileapi {
+
+// This class wraps another file enumerator and filters out non-media files
+// from its result, refering given MediaPathFilter.
+class FILEAPI_EXPORT FilteringFileEnumerator
+ : public NON_EXPORTED_BASE(FileSystemFileUtil::AbstractFileEnumerator) {
+ public:
+ FilteringFileEnumerator(
+ scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> base_enumerator,
+ MediaPathFilter* filter);
+ virtual ~FilteringFileEnumerator();
+
+ virtual FilePath Next() OVERRIDE;
+ virtual int64 Size() OVERRIDE;
+ virtual base::Time LastModifiedTime() OVERRIDE;
+ virtual bool IsDirectory() OVERRIDE;
+
+ private:
+ // The file enumerator to be wrapped.
+ scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> base_enumerator_;
+
+ // Path filter to filter out non-Media files.
+ MediaPathFilter* filter_;
+};
+
+} // namespace fileapi
+
+#endif // WEBKIT_FILEAPI_MEDIA_FILTERING_FILE_ENUMERATOR_H_
« no previous file with comments | « webkit/fileapi/media/device_media_file_util.cc ('k') | webkit/fileapi/media/filtering_file_enumerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698