summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_path_manager.h
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-22 11:05:54 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-22 11:05:54 +0000
commita13832a1c24681144c0d6ec31be09d812eacd285 (patch)
treea8d2c9bf5b3957a6df5f7cfdc3bf73a4fa801d7f /webkit/fileapi/file_system_path_manager.h
parente1943b7dda014c0f3f3304ea256e13c3d484e25d (diff)
downloadchromium_src-a13832a1c24681144c0d6ec31be09d812eacd285.zip
chromium_src-a13832a1c24681144c0d6ec31be09d812eacd285.tar.gz
chromium_src-a13832a1c24681144c0d6ec31be09d812eacd285.tar.bz2
Add a utility method that returns a list of origins that have FileSystem storage.
The method is to be used to retrieve total amount of usage for a type, to collect all the origins at startup after initialization etc. BUG=none TEST=FileSystemUtilListOriginsTest Review URL: http://codereview.chromium.org/6524038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75582 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_path_manager.h')
-rw-r--r--webkit/fileapi/file_system_path_manager.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/webkit/fileapi/file_system_path_manager.h b/webkit/fileapi/file_system_path_manager.h
index be9ceff..28082aa 100644
--- a/webkit/fileapi/file_system_path_manager.h
+++ b/webkit/fileapi/file_system_path_manager.h
@@ -4,10 +4,11 @@
#ifndef WEBKIT_FILEAPI_FILE_SYSTEM_PATH_MANAGER_H_
#define WEBKIT_FILEAPI_FILE_SYSTEM_PATH_MANAGER_H_
+#pragma once
#include "base/callback.h"
#include "base/file_path.h"
-#include "base/scoped_ptr.h"
+#include "base/file_util.h"
#include "webkit/fileapi/file_system_types.h"
class GURL;
@@ -18,6 +19,9 @@ class MessageLoopProxy;
namespace fileapi {
+// TODO(kinuko): Probably this module must be called FileSystemPathUtil
+// or something similar.
+
// An interface to construct or crack sandboxed filesystem paths.
// Currently each sandboxed filesystem path looks like:
//
@@ -96,6 +100,25 @@ class FileSystemPathManager {
const std::string& origin_identifier,
fileapi::FileSystemType type);
+ // Enumerates origins under the given |base_path|.
+ // This must be used on the FILE thread.
+ class OriginEnumerator {
+ public:
+ OriginEnumerator(const FilePath& base_path);
+
+ // Returns the next origin identifier. Returns empty if there are no
+ // more origins.
+ std::string Next();
+
+ bool HasTemporary();
+ bool HasPersistent();
+ const FilePath& path() { return current_; }
+
+ private:
+ file_util::FileEnumerator enumerator_;
+ FilePath current_;
+ };
+
private:
class GetFileSystemRootPathTask;