summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhstspolicy.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-03-02 09:04:38 +0100
committerLiang Qi <liang.qi@qt.io>2017-03-02 09:04:38 +0100
commit71264bae08d81bdeceb96133fdb01c370504dfcc (patch)
treed5dadaac8209d5ef1857a4d65197b9ee12b39848 /src/network/access/qhstspolicy.cpp
parent5e785c0b83c9908c665f253c131629ac325a21f5 (diff)
parent6d10f739cd750968d0dd0e9d8fa4b64353a86c6c (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Diffstat (limited to 'src/network/access/qhstspolicy.cpp')
-rw-r--r--src/network/access/qhstspolicy.cpp34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/network/access/qhstspolicy.cpp b/src/network/access/qhstspolicy.cpp
index 6922e1d8f9..634bf4784b 100644
--- a/src/network/access/qhstspolicy.cpp
+++ b/src/network/access/qhstspolicy.cpp
@@ -60,10 +60,10 @@ QT_BEGIN_NAMESPACE
applies to subdomains, either in the constructor or by calling setExpiry(),
setHost() and setIncludesSubdomains().
- \sa QNetworkAccessManager::enableStrictTransportSecurity()
+ \sa QNetworkAccessManager::setStrictTransportSecurityEnabled()
*/
-class QHstsPolicyPrivate
+class QHstsPolicyPrivate : public QSharedData
{
public:
QUrl url;
@@ -78,6 +78,15 @@ public:
};
/*!
+ Returns \c true if the two policies have the same host and expiration date
+ while agreeing on whether to include or exclude subdomains.
+*/
+bool operator==(const QHstsPolicy &lhs, const QHstsPolicy &rhs)
+{
+ return *lhs.d == *rhs.d;
+}
+
+/*!
Constructs an invalid (expired) policy with empty host name and subdomains
not included.
*/
@@ -121,17 +130,7 @@ QHstsPolicy::~QHstsPolicy()
*/
QHstsPolicy &QHstsPolicy::operator=(const QHstsPolicy &other)
{
- *d = *other.d;
- return *this;
-}
-
-
-/*!
- Move-assignment operator.
-*/
-QHstsPolicy &QHstsPolicy::operator=(QHstsPolicy &&other) Q_DECL_NOTHROW
-{
- qSwap(d, other.d);
+ d = other.d;
return *this;
}
@@ -196,15 +195,6 @@ bool QHstsPolicy::includesSubDomains() const
}
/*!
- Returns \c true if the two policies have the same host and expiration date
- while agreeing on whether to include or exclude subdomains.
-*/
-bool QHstsPolicy::operator==(const QHstsPolicy &other) const
-{
- return *d == *other.d;
-}
-
-/*!
Return \c true if this policy has a valid expiration date and this date
is greater than QDateTime::currentGetDateTimeUtc().