summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_path_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/fileapi/file_system_path_manager.cc')
-rw-r--r--webkit/fileapi/file_system_path_manager.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/webkit/fileapi/file_system_path_manager.cc b/webkit/fileapi/file_system_path_manager.cc
index 8aee5d5..8ef0631 100644
--- a/webkit/fileapi/file_system_path_manager.cc
+++ b/webkit/fileapi/file_system_path_manager.cc
@@ -4,12 +4,12 @@
#include "webkit/fileapi/file_system_path_manager.h"
-#include "base/file_util.h"
#include "base/rand_util.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/message_loop_proxy.h"
#include "base/scoped_callback_factory.h"
+#include "base/scoped_ptr.h"
#include "base/stringprintf.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
@@ -351,6 +351,27 @@ FilePath FileSystemPathManager::GetFileSystemBaseDirectoryForOriginAndType(
.AppendASCII(type_string);
}
+FileSystemPathManager::OriginEnumerator::OriginEnumerator(
+ const FilePath& base_path)
+ : enumerator_(base_path, false /* recursive */,
+ file_util::FileEnumerator::DIRECTORIES) {
+}
+
+std::string FileSystemPathManager::OriginEnumerator::Next() {
+ current_ = enumerator_.Next();
+ return FilePathStringToASCII(current_.BaseName().value());
+}
+
+bool FileSystemPathManager::OriginEnumerator::HasTemporary() {
+ return !current_.empty() && file_util::DirectoryExists(current_.AppendASCII(
+ FileSystemPathManager::kTemporaryName));
+}
+
+bool FileSystemPathManager::OriginEnumerator::HasPersistent() {
+ return !current_.empty() && file_util::DirectoryExists(current_.AppendASCII(
+ FileSystemPathManager::kPersistentName));
+}
+
} // namespace fileapi
COMPILE_ASSERT(int(WebFileSystem::TypeTemporary) == \