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

Unified Diff: webkit/fileapi/file_system_context.cc

Issue 6609009: Remove FileSystemQuotaManager class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fix Created 9 years, 10 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/file_system_context.h ('k') | webkit/fileapi/file_system_context_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_context.cc
diff --git a/webkit/fileapi/file_system_context.cc b/webkit/fileapi/file_system_context.cc
index 6cb97e92298cd11ed53dc556a148c608a55b4def..71e5ed22b14283239021c8e10de62bf376c21cf0 100644
--- a/webkit/fileapi/file_system_context.cc
+++ b/webkit/fileapi/file_system_context.cc
@@ -6,8 +6,8 @@
#include "base/file_util.h"
#include "base/message_loop_proxy.h"
+#include "googleurl/src/gurl.h"
#include "webkit/fileapi/file_system_path_manager.h"
-#include "webkit/fileapi/file_system_quota_manager.h"
#include "webkit/fileapi/file_system_usage_tracker.h"
namespace fileapi {
@@ -22,10 +22,11 @@ FileSystemContext::FileSystemContext(
bool unlimited_quota)
: file_message_loop_(file_message_loop),
io_message_loop_(io_message_loop),
+ special_storage_policy_(special_storage_policy),
+ allow_file_access_from_files_(allow_file_access),
+ unlimited_quota_(unlimited_quota),
path_manager_(new FileSystemPathManager(
file_message_loop, profile_path, is_incognito, allow_file_access)),
- quota_manager_(new FileSystemQuotaManager(
- allow_file_access, unlimited_quota, special_storage_policy)),
usage_tracker_(new FileSystemUsageTracker(
file_message_loop, profile_path, is_incognito)) {
}
@@ -33,6 +34,16 @@ FileSystemContext::FileSystemContext(
FileSystemContext::~FileSystemContext() {
}
+bool FileSystemContext::IsStorageUnlimited(const GURL& origin) {
+ // If allow-file-access-from-files flag is explicitly given and the scheme
+ // is file, or if unlimited quota for this process was explicitly requested,
+ // return true.
+ return unlimited_quota_ ||
+ (allow_file_access_from_files_ && origin.SchemeIsFile()) ||
+ (special_storage_policy_.get() &&
+ special_storage_policy_->IsStorageUnlimited(origin));
+}
+
void FileSystemContext::DeleteDataForOriginOnFileThread(
const GURL& origin_url) {
DCHECK(path_manager_.get());
« no previous file with comments | « webkit/fileapi/file_system_context.h ('k') | webkit/fileapi/file_system_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698