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

Unified Diff: content/browser/fileapi/fileapi_message_filter.cc

Issue 13508005: Allow RequestOSFileHandle if an app has unlimited storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert most of patch set 2 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 | « chrome/test/ppapi/ppapi_test.cc ('k') | content/common/fileapi/file_system_dispatcher.h » ('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 7472115213db042bb44b6e3fc10a9ee4b1b1d499..ac81220e319ef79db300da9f4a555b4fc07d4e28 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;
@@ -691,9 +692,26 @@ void FileAPIMessageFilter::DidOpenFile(int request_id,
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_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()))) {
kinuko 2013/04/10 03:35:19 From the discussion, probably we should also check
hamaji 2013/04/10 14:49:18 Hmm, I'm not sure, but if we add this check, we en
dmichael (off chromium) 2013/04/10 16:02:42 I'm not sure I understand. IsInstalledApp(path) lo
kinuko 2013/04/11 02:32:45 Chatted /w hamaji. Currently the only unlimited&&!
+ quota_policy = quota::kQuotaLimitTypeUnlimited;
+ } else {
+ quota_policy = quota::kQuotaLimitTypeLimited;
+ }
+
+ Send(new FileSystemMsg_DidOpenFile(request_id,
+ file_for_transit,
+ quota_policy));
} else {
- Send(new FileSystemMsg_DidFail(request_id, result));
+ Send(new FileSystemMsg_DidFail(request_id,
+ result));
}
UnregisterOperation(request_id);
}
« no previous file with comments | « chrome/test/ppapi/ppapi_test.cc ('k') | content/common/fileapi/file_system_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698