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

Unified Diff: content/browser/fileapi/fileapi_message_filter.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
« no previous file with comments | « content/browser/fileapi/fileapi_message_filter.h ('k') | webkit/fileapi/file_system_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/fileapi/fileapi_message_filter.cc
diff --git a/content/browser/fileapi/fileapi_message_filter.cc b/content/browser/fileapi/fileapi_message_filter.cc
index d735e312d8e7da80effd8068bcb697c98ca26f8f..04ec7b9ecc3c17a9f68b35c0a551ed652cfc3ec1 100644
--- a/content/browser/fileapi/fileapi_message_filter.cc
+++ b/content/browser/fileapi/fileapi_message_filter.cc
@@ -452,12 +452,26 @@ void FileAPIMessageFilter::OnOpenFile(
return;
}
+ quota::QuotaLimitType quota_policy = quota::kQuotaLimitTypeUnknown;
+ quota::QuotaManagerProxy* quota_manager_proxy =
+ context_->quota_manager_proxy();
+ CHECK(quota_manager_proxy);
+ CHECK(quota_manager_proxy->quota_manager());
+
+ if (quota_manager_proxy->quota_manager()->IsStorageUnlimited(
+ url.origin(), FileSystemTypeToQuotaStorageType(url.type()))) {
+ quota_policy = quota::kQuotaLimitTypeUnlimited;
+ } else {
+ quota_policy = quota::kQuotaLimitTypeLimited;
+ }
+
FileSystemOperation* operation = GetNewOperation(url, request_id);
if (!operation)
return;
operation->OpenFile(
url, file_flags, peer_handle(),
- base::Bind(&FileAPIMessageFilter::DidOpenFile, this, request_id, path));
+ base::Bind(&FileAPIMessageFilter::DidOpenFile, this, request_id, path,
+ quota_policy));
}
void FileAPIMessageFilter::OnNotifyCloseFile(const GURL& path) {
@@ -655,6 +669,7 @@ void FileAPIMessageFilter::DidReadDirectory(
void FileAPIMessageFilter::DidOpenFile(int request_id,
const GURL& path,
+ quota::QuotaLimitType quota_policy,
base::PlatformFileError result,
base::PlatformFile file,
base::ProcessHandle peer_handle) {
@@ -665,19 +680,6 @@ void FileAPIMessageFilter::DidOpenFile(int request_id,
IPC::InvalidPlatformFileForTransit();
open_filesystem_urls_.insert(path);
- quota::QuotaLimitType quota_policy = quota::kQuotaLimitTypeUnknown;
- quota::QuotaManagerProxy* quota_manager_proxy =
- context_->quota_manager_proxy();
- CHECK(quota_manager_proxy);
- CHECK(quota_manager_proxy->quota_manager());
- FileSystemURL url = context_->CrackURL(path);
- if (quota_manager_proxy->quota_manager()->IsStorageUnlimited(
- url.origin(), FileSystemTypeToQuotaStorageType(url.type()))) {
- quota_policy = quota::kQuotaLimitTypeUnlimited;
- } else {
- quota_policy = quota::kQuotaLimitTypeLimited;
- }
-
Send(new FileSystemMsg_DidOpenFile(request_id,
file_for_transit,
quota_policy));
« no previous file with comments | « content/browser/fileapi/fileapi_message_filter.h ('k') | webkit/fileapi/file_system_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698