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 7472115213db042bb44b6e3fc10a9ee4b1b1d499..032d0f5d586e36511e398b6c75437c1f56bbe84c 100644 |
--- a/content/browser/fileapi/fileapi_message_filter.cc |
+++ b/content/browser/fileapi/fileapi_message_filter.cc |
@@ -35,6 +35,7 @@ |
#include "webkit/fileapi/isolated_context.h" |
#include "webkit/fileapi/local_file_system_operation.h" |
#include "webkit/fileapi/sandbox_mount_point_provider.h" |
+#include "webkit/quota/quota_manager.h" |
using fileapi::FileSystemFileUtil; |
using fileapi::FileSystemMountPointProvider; |
@@ -680,20 +681,38 @@ void FileAPIMessageFilter::DidReadDirectory( |
UnregisterOperation(request_id); |
} |
-void FileAPIMessageFilter::DidOpenFile(int request_id, |
- const GURL& path, |
- base::PlatformFileError result, |
- base::PlatformFile file, |
- base::ProcessHandle peer_handle) { |
+void FileAPIMessageFilter::DidOpenFile( |
+ int request_id, |
+ const GURL& path, |
+ base::PlatformFileError result, |
+ base::PlatformFile file, |
+ base::ProcessHandle peer_handle) { |
if (result == base::PLATFORM_FILE_OK) { |
IPC::PlatformFileForTransit file_for_transit = |
file != base::kInvalidPlatformFileValue ? |
IPC::GetFileHandleForProcess(file, peer_handle, true) : |
IPC::InvalidPlatformFileForTransit(); |
open_filesystem_urls_.insert(path); |
- Send(new FileSystemMsg_DidOpenFile(request_id, file_for_transit)); |
+ |
+ quota::QuotaLimitType quota_limit_type = quota::kQuotaLimitTypeUnknown; |
+ quota::QuotaManagerProxy* quota_manager_proxy = |
+ context_->quota_manager_proxy(); |
+ if (quota_manager_proxy) { |
+ FileSystemURL url = context_->CrackURL(path); |
+ if (quota_manager_proxy->quota_manager()->IsStorageUnlimited( |
+ url.origin(), FileSystemTypeToQuotaStorageType(url.type()))) { |
+ quota_limit_type = quota::kQuotaLimitTypeUnlimited; |
+ } else { |
+ quota_limit_type = quota::kQuotaLimitTypeLimited; |
+ } |
+ } |
+ |
+ Send(new FileSystemMsg_DidOpenFile(request_id, |
+ file_for_transit, |
+ quota_limit_type)); |
} else { |
- Send(new FileSystemMsg_DidFail(request_id, result)); |
+ Send(new FileSystemMsg_DidFail(request_id, |
+ result)); |
} |
UnregisterOperation(request_id); |
} |