summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2014-12-04 07:07:32 -0800
committerSzabolcs David <davidsz@inf.u-szeged.hu>2014-12-04 19:38:20 +0100
commitff47f09a94a0a31edd40500985ff670e8f35cc2c (patch)
tree111076ae419cf24465f2b731c2dd294d6f97ae21
parentb4b6d85fea56fde2447b57c8a6e379b6d8a2ec41 (diff)
Add a stub QuotaPermissionContext implementation
This prevents the crash when the application requests persistent storage access using the Quota API (e.g. on http://codepen.io/matt-west/full/CrfKh). The request has been disallowed for now, because it should rely on user permission. Change-Id: I4ae057c9485d3f06f45a637c7eeda9dd69fe6b54 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
-rw-r--r--src/core/content_browser_client_qt.cpp16
-rw-r--r--src/core/content_browser_client_qt.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index ee403298..4948d1d8 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -42,6 +42,7 @@
#include "content/public/browser/browser_main_parts.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/media_observer.h"
+#include "content/public/browser/quota_permission_context.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
@@ -294,6 +295,16 @@ void ShareGroupQtQuick::AboutToAddFirstContext()
m_shareContextQtQuick = make_scoped_refptr(new QtShareGLContext(shareContext));
}
+class QuotaPermissionContextQt : public content::QuotaPermissionContext {
+public:
+ virtual void RequestQuotaPermission(const content::StorageQuotaParams &params, int render_process_id, const PermissionCallback &callback) Q_DECL_OVERRIDE
+ {
+ Q_UNUSED(params);
+ Q_UNUSED(render_process_id);
+ callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
+ }
+};
+
ContentBrowserClientQt::ContentBrowserClientQt()
: m_browserMainParts(0)
{
@@ -374,6 +385,11 @@ void ContentBrowserClientQt::enableInspector(bool enable)
}
}
+content::QuotaPermissionContext *ContentBrowserClientQt::CreateQuotaPermissionContext()
+{
+ return new QuotaPermissionContextQt;
+}
+
void ContentBrowserClientQt::AllowCertificateError(int render_process_id, int render_frame_id, int cert_error,
const net::SSLInfo& ssl_info, const GURL& request_url,
ResourceType::Type resource_type,
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index 4f216030..f1ecf582 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -80,6 +80,7 @@ public:
virtual content::MediaObserver* GetMediaObserver() Q_DECL_OVERRIDE;
virtual void OverrideWebkitPrefs(content::RenderViewHost *, const GURL &, WebPreferences *) Q_DECL_OVERRIDE;
virtual content::AccessTokenStore *CreateAccessTokenStore() Q_DECL_OVERRIDE;
+ virtual content::QuotaPermissionContext *CreateQuotaPermissionContext() Q_DECL_OVERRIDE;
virtual void AllowCertificateError(
int render_process_id,
int render_frame_id,