pmaports/main/qt5-qtwebengine/patches-luna/0013-Implement-RequestQuotePermission.patch

35 lines
1.4 KiB
Diff

From 1c2d6d5507e49812a3e26763c651bca8c8df989e Mon Sep 17 00:00:00 2001
From: Christophe Chapuis <chris.chapuis@gmail.com>
Date: Thu, 29 Sep 2016 18:40:37 +0000
Subject: [PATCH 13/18] Implement RequestQuotePermission
Allows 64MB for local URL, and 5MB otherwise.
Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
---
src/core/content_browser_client_qt.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index d446d8f..2e8a87f 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -377,9 +377,13 @@ class QuotaPermissionContextQt : public content::QuotaPermissionContext {
public:
void RequestQuotaPermission(const content::StorageQuotaParams &params, int render_process_id, const PermissionCallback &callback) override
{
- Q_UNUSED(params);
Q_UNUSED(render_process_id);
- callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
+ if((params.origin_url.SchemeIsFile() && params.requested_size < 64*1024*1024) || // local URL: 64MB
+ params.requested_size < 5*1024*1024) { // remote URL: 5MB
+ callback.Run(QUOTA_PERMISSION_RESPONSE_ALLOW);
+ } else {
+ callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
+ }
}
};
--
2.7.4