From 2adc7eabb86dd3a7435ca205324091ca4095c78d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCri=20Valdmann?= <juri.valdmann@qt.io>
Date: Fri, 2 Mar 2018 11:18:47 +0100
Subject: [PATCH] Private constructors for permission classes

Change-Id: I55b033a03ec581841e1cea55c3d707067ee5ef42
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
---
 src/core/api/qwebenginequotarequest.h                   | 6 ++++--
 src/core/api/qwebengineregisterprotocolhandlerrequest.h | 8 +++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/core/api/qwebenginequotarequest.h b/src/core/api/qwebenginequotarequest.h
index dbba6ad82..be71635c1 100644
--- a/src/core/api/qwebenginequotarequest.h
+++ b/src/core/api/qwebenginequotarequest.h
@@ -45,7 +45,8 @@
 #include <QtWebEngineCore/qtwebenginecoreglobal.h>
 
 namespace QtWebEngineCore {
-    class QuotaRequestController;
+class QuotaPermissionContextQt;
+class QuotaRequestController;
 }
 
 QT_BEGIN_NAMESPACE
@@ -56,7 +57,6 @@ class QWEBENGINE_EXPORT QWebEngineQuotaRequest {
     Q_PROPERTY(qint64 requestedSize READ requestedSize CONSTANT FINAL)
 public:
     QWebEngineQuotaRequest() {}
-    QWebEngineQuotaRequest(QSharedPointer<QtWebEngineCore::QuotaRequestController>);
     Q_INVOKABLE void accept();
     Q_INVOKABLE void reject();
     QUrl origin() const;
@@ -64,6 +64,8 @@ public:
     bool operator==(const QWebEngineQuotaRequest &that) const { return d_ptr == that.d_ptr; }
     bool operator!=(const QWebEngineQuotaRequest &that) const { return d_ptr != that.d_ptr; }
 private:
+    QWebEngineQuotaRequest(QSharedPointer<QtWebEngineCore::QuotaRequestController>);
+    friend QtWebEngineCore::QuotaPermissionContextQt;
     QSharedPointer<QtWebEngineCore::QuotaRequestController> d_ptr;
 };
 
diff --git a/src/core/api/qwebengineregisterprotocolhandlerrequest.h b/src/core/api/qwebengineregisterprotocolhandlerrequest.h
index 936043b4d..b3707bc59 100644
--- a/src/core/api/qwebengineregisterprotocolhandlerrequest.h
+++ b/src/core/api/qwebengineregisterprotocolhandlerrequest.h
@@ -45,7 +45,8 @@
 #include <QtWebEngineCore/qtwebenginecoreglobal.h>
 
 namespace QtWebEngineCore {
-    class RegisterProtocolHandlerRequestController;
+class RegisterProtocolHandlerRequestController;
+class WebContentsDelegateQt;
 }
 
 QT_BEGIN_NAMESPACE
@@ -56,8 +57,6 @@ class QWEBENGINE_EXPORT QWebEngineRegisterProtocolHandlerRequest {
     Q_PROPERTY(QString scheme READ scheme CONSTANT FINAL)
 public:
     QWebEngineRegisterProtocolHandlerRequest() {}
-    QWebEngineRegisterProtocolHandlerRequest(
-        QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController>);
     Q_INVOKABLE void accept();
     Q_INVOKABLE void reject();
     QUrl origin() const;
@@ -65,6 +64,9 @@ public:
     bool operator==(const QWebEngineRegisterProtocolHandlerRequest &that) const { return d_ptr == that.d_ptr; }
     bool operator!=(const QWebEngineRegisterProtocolHandlerRequest &that) const { return d_ptr != that.d_ptr; }
 private:
+    QWebEngineRegisterProtocolHandlerRequest(
+        QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController>);
+    friend QtWebEngineCore::WebContentsDelegateQt;
     QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController> d_ptr;
 };
 
-- 
GitLab