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

Unified Diff: webkit/browser/fileapi/sandbox_file_system_backend.h

Issue 21116008: FileAPI: Move FileSystemQuotaUtil related functions into SandboxContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up Created 7 years, 5 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: webkit/browser/fileapi/sandbox_file_system_backend.h
diff --git a/webkit/browser/fileapi/sandbox_file_system_backend.h b/webkit/browser/fileapi/sandbox_file_system_backend.h
index 061cd7d77e1a8ace19971a0bb499b2382789c988..77f6ae5e72df616b401505927c95545920bb3436 100644
--- a/webkit/browser/fileapi/sandbox_file_system_backend.h
+++ b/webkit/browser/fileapi/sandbox_file_system_backend.h
@@ -7,43 +7,21 @@
#include <set>
#include <string>
-#include <vector>
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "url/gurl.h"
#include "webkit/browser/fileapi/file_system_backend.h"
-#include "webkit/browser/fileapi/file_system_options.h"
#include "webkit/browser/fileapi/file_system_quota_util.h"
+#include "webkit/browser/fileapi/sandbox_context.h"
#include "webkit/browser/fileapi/task_runner_bound_observer_list.h"
#include "webkit/browser/quota/special_storage_policy.h"
#include "webkit/browser/webkit_storage_browser_export.h"
-namespace base {
-class SequencedTaskRunner;
-}
-
-namespace quota {
-class QuotaManagerProxy;
-class SpecialStoragePolicy;
-}
-
-namespace sync_file_system {
-class CannedSyncableFileSystem;
-class SyncableFileSystemOperation;
-}
-
namespace fileapi {
-class FileSystemUsageCache;
-class LocalFileSystemOperation;
-class ObfuscatedFileUtil;
-class SandboxContext;
-class SandboxQuotaObserver;
-
// An interface to construct or crack sandboxed filesystem paths for
// TEMPORARY or PERSISTENT filesystems, which are placed under the user's
// profile directory in a sandboxed way.
@@ -53,22 +31,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackend
: public FileSystemBackend,
public FileSystemQuotaUtil {
public:
- // Origin enumerator interface.
- // An instance of this interface is assumed to be called on the file thread.
- class OriginEnumerator {
- public:
- virtual ~OriginEnumerator() {}
-
- // Returns the next origin. Returns empty if there are no more origins.
- virtual GURL Next() = 0;
-
- // Returns the current origin's information.
- virtual bool HasFileSystemType(FileSystemType type) const = 0;
- };
-
- SandboxFileSystemBackend(
- SandboxContext* sandbox_context,
- const FileSystemOptions& file_system_options);
+ explicit SandboxFileSystemBackend(SandboxContext* sandbox_context);
virtual ~SandboxFileSystemBackend();
// FileSystemBackend overrides.
@@ -101,18 +64,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackend
// Returns an origin enumerator of this backend.
// This method can only be called on the file thread.
- OriginEnumerator* CreateOriginEnumerator();
-
- // Gets a base directory path of the sandboxed filesystem that is
- // specified by |origin_url| and |type|.
- // (The path is similar to the origin's root path but doesn't contain
- // the 'unique' part.)
- // Returns an empty path if the given type is invalid.
- // This method can only be called on the file thread.
- base::FilePath GetBaseDirectoryForOriginAndType(
- const GURL& origin_url,
- FileSystemType type,
- bool create);
+ SandboxContext::OriginEnumerator* CreateOriginEnumerator();
// FileSystemQuotaUtil overrides.
virtual base::PlatformFileError DeleteOriginDataOnFileThread(
@@ -158,51 +110,15 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackend
void CollectOpenFileSystemMetrics(base::PlatformFileError error_code);
- // Performs API-specific validity checks on the given path |url|.
- // Returns true if access to |url| is valid in this filesystem.
- bool IsAccessValid(const FileSystemURL& url) const;
-
void set_enable_temporary_file_system_in_incognito(bool enable) {
enable_temporary_file_system_in_incognito_ = enable;
}
private:
- friend class SandboxQuotaObserver;
- friend class SandboxFileSystemTestHelper;
- friend class SandboxFileSystemBackendMigrationTest;
- friend class SandboxFileSystemBackendOriginEnumeratorTest;
-
- // Returns a path to the usage cache file.
- base::FilePath GetUsageCachePathForOriginAndType(
- const GURL& origin_url,
- FileSystemType type);
-
- // Returns a path to the usage cache file (static version).
- static base::FilePath GetUsageCachePathForOriginAndType(
- ObfuscatedFileUtil* sandbox_file_util,
- const GURL& origin_url,
- FileSystemType type,
- base::PlatformFileError* error_out);
-
- // Returns true if the given |url|'s scheme is allowed to access
- // filesystem.
- bool IsAllowedScheme(const GURL& url) const;
-
- ObfuscatedFileUtil* sandbox_sync_file_util();
- FileSystemUsageCache* usage_cache();
-
- int64 RecalculateUsage(FileSystemContext* context,
- const GURL& origin,
- FileSystemType type);
-
SandboxContext* sandbox_context_; // Not owned.
- FileSystemOptions file_system_options_;
bool enable_temporary_file_system_in_incognito_;
- // Acccessed only on the file thread.
- std::set<GURL> visited_origins_;
-
// Observers.
UpdateObserverList update_observers_;
ChangeObserverList change_observers_;
@@ -214,8 +130,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackend
base::Time next_release_time_for_open_filesystem_stat_;
- std::set<std::pair<GURL, FileSystemType> > sticky_dirty_origins_;
-
base::WeakPtrFactory<SandboxFileSystemBackend> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackend);
« no previous file with comments | « webkit/browser/fileapi/sandbox_context_unittest.cc ('k') | webkit/browser/fileapi/sandbox_file_system_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698