summaryrefslogtreecommitdiffstats
path: root/src/core/quota_permission_context_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-22 14:18:16 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-01-13 16:11:59 +0100
commit7869ec5823da36a3ce33b379d3d664204756cad5 (patch)
tree45b692a4ed986b0a8932f2f6a183ed9408439e33 /src/core/quota_permission_context_qt.cpp
parentffb13e6927ae14a7185bb45ee0dfd03973e5ebb0 (diff)
Adaptations for Chromium 86
Change-Id: I7e0ebecdbb68cfff0b574c966f3fa80d28680e1c Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/quota_permission_context_qt.cpp')
-rw-r--r--src/core/quota_permission_context_qt.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/core/quota_permission_context_qt.cpp b/src/core/quota_permission_context_qt.cpp
index c7f1e856c..549414d33 100644
--- a/src/core/quota_permission_context_qt.cpp
+++ b/src/core/quota_permission_context_qt.cpp
@@ -61,7 +61,7 @@ void QuotaPermissionContextQt::RequestQuotaPermission(const StorageQuotaParams &
if (params.storage_type != blink::mojom::StorageType::kPersistent) {
// For now we only support requesting quota with this interface
// for Persistent storage type.
- std::move(callback).Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
+ dispatchCallbackOnIOThread(std::move(callback), QUOTA_PERMISSION_RESPONSE_DISALLOW);
return;
}
@@ -74,16 +74,26 @@ void QuotaPermissionContextQt::RequestQuotaPermission(const StorageQuotaParams &
}
RenderFrameHost *renderFrameHost = RenderFrameHost::FromID(render_process_id, params.render_frame_id);
- if (!renderFrameHost)
+ if (!renderFrameHost) {
+ LOG(WARNING) << "Attempt to request quota from frameless renderer: "
+ << render_process_id << "," << params.render_frame_id;
+ dispatchCallbackOnIOThread(std::move(callback), QUOTA_PERMISSION_RESPONSE_CANCELLED);
return;
+ }
WebContents *webContents = WebContents::FromRenderFrameHost(renderFrameHost);
- if (!webContents)
+ if (!webContents) {
+ LOG(ERROR) << "Attempt to request quota from frame missing webcontents";
+ dispatchCallbackOnIOThread(std::move(callback), QUOTA_PERMISSION_RESPONSE_CANCELLED);
return;
+ }
WebContentsAdapterClient *client = WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(webContents)->GetView())->client();
- if (!client)
+ if (!client) {
+ LOG(ERROR) << "Attempt to request quota from content missing webcontents client";
+ dispatchCallbackOnIOThread(std::move(callback), QUOTA_PERMISSION_RESPONSE_CANCELLED);
return;
+ }
QWebEngineQuotaRequest request(
QSharedPointer<QuotaRequestControllerImpl>::create(this, params, std::move(callback)));