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

Unified Diff: webkit/fileapi/local_file_system_operation.cc

Issue 14265022: [Quota][FileAPI] Add quota policy to FileSystemOperationContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: drop .gitmodule change 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
« no previous file with comments | « webkit/fileapi/file_system_operation_context.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/local_file_system_operation.cc
diff --git a/webkit/fileapi/local_file_system_operation.cc b/webkit/fileapi/local_file_system_operation.cc
index 1bd0e521ad7e0d225328cfff44e74122a8cbaa1d..2534af8fa8cd41927457b3f9f56bbe81323bacdb 100644
--- a/webkit/fileapi/local_file_system_operation.cc
+++ b/webkit/fileapi/local_file_system_operation.cc
@@ -331,7 +331,9 @@ void LocalFileSystemOperation::OpenFile(const FileSystemURL& url,
(base::PLATFORM_FILE_ENUMERATE | base::PLATFORM_FILE_TEMPORARY |
base::PLATFORM_FILE_HIDDEN))) {
callback.Run(base::PLATFORM_FILE_ERROR_FAILED,
- base::PlatformFile(), base::ProcessHandle());
+ base::kInvalidPlatformFileValue,
+ base::kNullProcessHandle,
+ quota::kQuotaLimitTypeLimited);
return;
}
if (file_flags &
@@ -342,13 +344,19 @@ void LocalFileSystemOperation::OpenFile(const FileSystemURL& url,
base::PLATFORM_FILE_WRITE_ATTRIBUTES)) {
base::PlatformFileError result = SetUp(url, OPERATION_MODE_WRITE);
if (result != base::PLATFORM_FILE_OK) {
- callback.Run(result, base::PlatformFile(), base::ProcessHandle());
+ callback.Run(result,
+ base::kInvalidPlatformFileValue,
+ base::kNullProcessHandle,
+ quota::kQuotaLimitTypeLimited);
return;
}
} else {
base::PlatformFileError result = SetUp(url, OPERATION_MODE_READ);
if (result != base::PLATFORM_FILE_OK) {
- callback.Run(result, base::PlatformFile(), base::ProcessHandle());
+ callback.Run(result,
+ base::kInvalidPlatformFileValue,
+ base::kNullProcessHandle,
+ quota::kQuotaLimitTypeLimited);
return;
}
}
@@ -359,7 +367,8 @@ void LocalFileSystemOperation::OpenFile(const FileSystemURL& url,
url, callback, file_flags),
base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED,
base::kInvalidPlatformFileValue,
- base::kNullProcessHandle));
+ base::kNullProcessHandle,
+ quota::kQuotaLimitTypeLimited));
}
void LocalFileSystemOperation::NotifyCloseFile(const FileSystemURL& url) {
@@ -562,12 +571,21 @@ void LocalFileSystemOperation::GetUsageAndQuotaThenRunTask(
// If we don't have the quota manager or the requested filesystem type
// does not support quota, we should be able to let it go.
operation_context()->set_allowed_bytes_growth(kint64max);
+ operation_context()->set_quota_limit_type(quota::kQuotaLimitTypeUnlimited);
kinuko 2013/04/26 06:44:21 Looks like this is the primary change you want to
tzik 2013/04/26 06:55:11 Done.
task.Run();
return;
}
DCHECK(quota_manager_proxy);
DCHECK(quota_manager_proxy->quota_manager());
+ if (quota_manager_proxy->quota_manager()->IsStorageUnlimited(
+ url.origin(),
+ FileSystemTypeToQuotaStorageType(url.type()))) {
+ operation_context()->set_quota_limit_type(quota::kQuotaLimitTypeUnlimited);
+ } else {
+ operation_context()->set_quota_limit_type(quota::kQuotaLimitTypeLimited);
+ }
+
quota_manager_proxy->quota_manager()->GetUsageAndQuota(
url.origin(),
FileSystemTypeToQuotaStorageType(url.type()),
@@ -819,7 +837,9 @@ void LocalFileSystemOperation::DidOpenFile(
bool unused) {
if (rv == base::PLATFORM_FILE_OK)
CHECK_NE(base::kNullProcessHandle, peer_handle_);
- callback.Run(rv, file.ReleaseValue(), peer_handle_);
+ callback.Run(rv, file.ReleaseValue(),
+ peer_handle_,
+ operation_context()->quota_limit_type());
}
void LocalFileSystemOperation::DidCreateSnapshotFile(
« no previous file with comments | « webkit/fileapi/file_system_operation_context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698