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

Unified Diff: webkit/fileapi/sandbox_mount_point_provider.cc

Issue 14265022: [Quota][FileAPI] Add quota policy to FileSystemOperationContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add special storage policy Created 7 years, 8 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/fileapi/sandbox_mount_point_provider.cc
diff --git a/webkit/fileapi/sandbox_mount_point_provider.cc b/webkit/fileapi/sandbox_mount_point_provider.cc
index 5180a05a95bf3f99cffad7f2fce8b878d89c4794..606bb087d5a40e7d088ee411839eab33a2240900 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.cc
+++ b/webkit/fileapi/sandbox_mount_point_provider.cc
@@ -141,7 +141,8 @@ SandboxMountPointProvider::SandboxMountPointProvider(
quota::QuotaManagerProxy* quota_manager_proxy,
base::SequencedTaskRunner* file_task_runner,
const base::FilePath& profile_path,
- const FileSystemOptions& file_system_options)
+ const FileSystemOptions& file_system_options,
+ quota::SpecialStoragePolicy* special_storage_policy)
: file_task_runner_(file_task_runner),
profile_path_(profile_path),
file_system_options_(file_system_options),
@@ -159,6 +160,7 @@ SandboxMountPointProvider::SandboxMountPointProvider(
enable_usage_tracking_(
!CommandLine::ForCurrentProcess()->HasSwitch(
kDisableUsageTracking)),
+ special_storage_policy_(special_storage_policy),
weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
// Set quota observers.
UpdateObserverList::Source update_observers_src;
@@ -332,6 +334,14 @@ FileSystemOperation* SandboxMountPointProvider::CreateFileSystemOperation(
// For regular sandboxed types.
operation_context->set_update_observers(update_observers_);
operation_context->set_access_observers(access_observers_);
+
+ if (special_storage_policy_ &&
+ special_storage_policy_->IsStorageUnlimited(url.origin())) {
+ operation_context->set_quota_limit_type(quota::kQuotaLimitTypeUnlimited);
+ } else {
+ operation_context->set_quota_limit_type(quota::kQuotaLimitTypeLimited);
+ }
+
return new LocalFileSystemOperation(context, operation_context.Pass());
}
« no previous file with comments | « webkit/fileapi/sandbox_mount_point_provider.h ('k') | webkit/fileapi/sandbox_mount_point_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698